MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / create_cfunction

Method create_cfunction

tools/api.py:485–507  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

483 "self.cfunction is None: self.update() needs to be called.")
484
485 def create_cfunction(self) -> None:
486 self.cfunction = CFunction(self.name)
487 # Add the return as a parameter
488 if self.returns:
489 self.returns.add_to_cfunction(self.cfunction)
490 # Add the input parameters
491 for param in self.params:
492 param.add_to_cfunction(self.cfunction)
493 f: Optional[str] = self.get_invoke()
494 # Write the assignments
495 assigns = []
496 if self.returns:
497 result = f
498 if self.write_to_tmp_var() and f:
499 f = 'auto&& api_result = ' + f
500 result = 'api_result'
501 else:
502 f = None
503 assigns = self.returns.outputs(result)
504 if f:
505 self.cfunction.add_statement(f)
506 for assign in assigns:
507 self.cfunction.add_statement(assign)
508
509
510cpp_class_template = Template('''

Callers 1

updateMethod · 0.95

Calls 6

get_invokeMethod · 0.95
write_to_tmp_varMethod · 0.95
CFunctionClass · 0.85
add_to_cfunctionMethod · 0.80
outputsMethod · 0.80
add_statementMethod · 0.80

Tested by

no test coverage detected