提交 0ad8d9fd authored 作者: notoraptor's avatar notoraptor

c_element_type now raises MethodNotDefined.

Update default get_op_params() to take account of it.
上级 ce2d6c24
......@@ -1406,9 +1406,10 @@ class COp(Op):
wrapper = self.params_type
params = [('APPLY_SPECIFIC_WRAPPER', wrapper.name)]
for i in range(wrapper.length):
field_c_element_type = wrapper.types[i].c_element_type()
if field_c_element_type:
params.append(('DTYPE_PARAM_' + wrapper.fields[i], field_c_element_type))
try:
params.append(('DTYPE_PARAM_' + wrapper.fields[i], wrapper.types[i].c_element_type()))
except utils.MethodNotDefined:
pass
return params
return []
......
......@@ -46,7 +46,7 @@ class CLinkerType(CLinkerObject):
- For ``GpuArrayType(dtype='int32', ...)``: should return ``"ga_int"``.
"""
return ''
raise MethodNotDefined("c_element_type", type(self), self.__class__.__name__)
def c_is_simple(self):
"""
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论