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

Method add_to_cfunction

tools/api.py:392–403  ·  view source on GitHub ↗
(self, cfunction: CFunction)

Source from the content-addressed store, hash-verified

390 return [self.substitute(w, result=result) for w in self.write]
391
392 def add_to_cfunction(self, cfunction: CFunction) -> None:
393 for t, name in self.cparams:
394 if t.startswith('...'):
395 cfunction.add_vlist(name)
396 else:
397 cfunction.add_param(self.substitute(t), self.substitute(name))
398 if self.bad_param_check:
399 msg = 'Bad parameter {name}: {msg}'.format(
400 name=self.name, msg=self.bad_param_check.msg)
401 cfunction.add_statement('if ({cond}) {body}'.format(
402 cond=self.substitute(self.bad_param_check.cond),
403 body=bad_param_error(msg)))
404
405
406def template_var(s: str) -> str:

Callers 1

create_cfunctionMethod · 0.80

Calls 6

substituteMethod · 0.95
add_vlistMethod · 0.80
add_statementMethod · 0.80
bad_param_errorFunction · 0.70
add_paramMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected