def transform(self, tree, program_config):
     args_subconfig, tuning_config = program_config
     function = tree.body[0]
     c_func = PyBasicConversions().visit(function)
     #print(c_func)
     c_func.defn = c_func.defn[1:]
     #print(c_func)
     c_func.params[0].type = ctree.types.get_ctype(args_subconfig)
     c_func.params[1].type =c_func.params[0].type
     c_func.params.append(SymbolRef('arr', ctypes.POINTER(ctypes.c_int32)()))
     #print(c_func)
     return CFile(body=[c_func])
Exemplo n.º 2
0
 def transform(self, tree, program_config):
     args_subconfig, tuning_config = program_config
     function = tree.body[0]
     c_func = PyBasicConversions().visit(function)
     #print(c_func)
     c_func.defn = c_func.defn[1:]
     #print(c_func)
     c_func.params[0].type = ctree.types.get_ctype(args_subconfig)
     c_func.params[1].type = c_func.params[0].type
     c_func.params.append(SymbolRef('arr',
                                    ctypes.POINTER(ctypes.c_int32)()))
     #print(c_func)
     return CFile(body=[c_func])