提交 1e9cefee authored 作者: Frederic Bastien's avatar Frederic Bastien

more check that the c implementation of scalar op exist.

上级 e06004c8
...@@ -1294,6 +1294,16 @@ def local_elemwise_fusion(node): ...@@ -1294,6 +1294,16 @@ def local_elemwise_fusion(node):
otype = node.outputs[0].type otype = node.outputs[0].type
s_new_out=node.op.scalar_op(*s_g) s_new_out=node.op.scalar_op(*s_g)
try:
s_new_out.owner.op.c_code(s_inputs, "test_presence_of_c_code",
["x" for x in s_g],
"z",{})
except MethodNotDefined:
print "OPTIMISATION WARNING: ",i.owner.op.scalar_op,"don't implement the c_code fonction. This is not fast and disable the fusion of loop."
return False
except NotImplementedError:
print "OPTIMISATION WARNING: ",s_new_out.owner.op,"don't implement the c_code fonction. This disable the fusion of loop."
return False
#create the composite op. #create the composite op.
C = scalar.Composite(s_inputs,[s_new_out]) C = scalar.Composite(s_inputs,[s_new_out])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论