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

Method create_function

src/cpp_generator.cpp:264–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264std::string cpp_generator::create_function(const cpp_generator::function& f)
265{
266 impl->function_count++;
267 if(not f.tparams.empty())
268 impl->fs << "template<" << join_strings(f.tparams, ", ") << ">\n";
269 std::string name = f.name.empty() ? "f" + std::to_string(impl->function_count) : f.name;
270 impl->fs << join_strings(f.attributes, " ") << " " << f.return_type << " " << name;
271 char delim = '(';
272 if(f.params.empty())
273 impl->fs << delim;
274 for(auto&& p : f.params)
275 {
276 impl->fs << delim << p.type << " " << to_c_id(p.name);
277 delim = ',';
278 }
279 impl->fs << ") {\n" << f.body << "\n}\n";
280 return name;
281}
282
283} // namespace MIGRAPHX_INLINE_NS
284} // namespace migraphx

Callers 3

compile_moduleFunction · 0.80
generate_pointwiseFunction · 0.80
generate_reduceFunction · 0.80

Calls 4

join_stringsFunction · 0.85
to_c_idFunction · 0.85
to_stringFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected