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

Method virtual

tools/api.py:1177–1204  ·  view source on GitHub ↗
(self,
                name: str,
                params: Optional[List[Parameter]] = None,
                const: Optional[bool] = None,
                **kwargs)

Source from the content-addressed store, hash-verified

1175 return self
1176
1177 def virtual(self,
1178 name: str,
1179 params: Optional[List[Parameter]] = None,
1180 const: Optional[bool] = None,
1181 **kwargs) -> 'Interface':
1182
1183 # Add this parameter to the function
1184 this = Parameter('obj', 'void*', this=True)
1185 this.virtual_read = ['object_ptr.data']
1186 exception_msg = Parameter('exception_msg', 'char*', hidden=True)
1187 exception_msg.virtual_read = ['${name}.data()']
1188 exception_msg_size = Parameter('exception_msg_size',
1189 'size_t',
1190 hidden=True)
1191 exception_msg_size.virtual_read = ['exception_msg.size()']
1192 f = Function(name,
1193 params=[this, exception_msg, exception_msg_size] +
1194 (params or []),
1195 virtual=True,
1196 **kwargs)
1197 self.ifunctions.append(f)
1198
1199 add_function(self.cname('set_' + name),
1200 params=gparams(obj=self.opaque_type,
1201 input=self.cname(name)),
1202 invoke='${{obj}}->{name} = ${{input}}'.format(
1203 name=self.mname(name)))
1204 return self
1205
1206 def generate_function(self, f: Function):
1207 cname = self.cname(f.name)

Callers 1

experimental_custom_opFunction · 0.80

Calls 7

mnameMethod · 0.95
ParameterClass · 0.85
FunctionClass · 0.85
add_functionFunction · 0.85
cnameMethod · 0.80
appendMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected