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

Method virtual_output_declarations

tools/api.py:331–349  ·  view source on GitHub ↗
(self,
                                    prefix: Optional[str] = None)

Source from the content-addressed store, hash-verified

329 return decl_list
330
331 def virtual_output_declarations(self,
332 prefix: Optional[str] = None) -> List[str]:
333 container_type = self.type.remove_generic().basic().str()
334 container = (container_type == "std::vector"
335 or container_type == "vector")
336 decl_list: List[str] = []
337 for t, n, in self.cparams:
338 if not decl_list and container:
339 inner_t = self.type.inner_type()
340 if inner_t:
341 decl_list.append(
342 'std::array<{inner_t}, 1024> {prefix}{n};'.format(
343 inner_t=inner_t.str(), prefix=prefix or '', n=n))
344 else:
345 decl_list.append(
346 'std::remove_pointer_t<{type}> {prefix}{n}'.format(
347 type=Type(t).str(), prefix=prefix or '', n=n))
348 decl_list[-1] += '=1024;' if container else ';'
349 return decl_list
350
351 def virtual_output(self, prefix: Optional[str] = None) -> str:
352 write = self.virtual_write

Callers 1

generate_virtual_implFunction · 0.80

Calls 7

TypeClass · 0.85
basicMethod · 0.80
remove_genericMethod · 0.80
inner_typeMethod · 0.80
strMethod · 0.45
appendMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected