提交 3ae8778e authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Add support for optional inputs/outputs in COp.

上级 3896827b
......@@ -1434,7 +1434,15 @@ class COp(Op):
# Generate an string containing the arguments sent to the external C
# function. The argstring will be of format :
# "input0, input1, input2, &output0, &output1"
return ", ".join(list(inp) + ["&%s" % o for o in out])
inp = list(inp)
numi = getattr(self, '_cop_numi', len(inp))
while len(inp) < numi:
inp.append('NULL')
out = ["&%s" % o for o in out]
numo = getattr(self, '_cop_numo', len(out))
while len(out) < numo:
out.append('NULL')
return ", ".join(inp + out)
def get_c_macros(self, node, name, check_input=None):
define_template = "#define %s %s"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论