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

Function compile_function

test/jit.cpp:46–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44
45template <class F>
46static std::function<F> compile_function(std::string_view src, const std::string& symbol_name)
47{
48 migraphx::src_compiler compiler;
49 compiler.flags.emplace_back("-std=c++14");
50#ifndef _WIN32
51 compiler.flags.emplace_back("-fPIC");
52 compiler.flags.emplace_back("-DEXPORT=\"\"");
53#else
54 compiler.flags.emplace_back("-DEXPORT=__declspec(dllexport)");
55#endif
56 compiler.flags.emplace_back("-shared");
57 compiler.output = migraphx::make_shared_object_filename("simple");
58 migraphx::src_file f{"main.cpp", src};
59 auto image = compiler.compile({f});
60 return migraphx::dynamic_loader{image}.get_function<F>(symbol_name);
61}
62
63template <class F>
64static std::function<F> compile_module(const migraphx::module& m)

Callers

nothing calls this directly

Calls 3

emplace_backMethod · 0.80
compileMethod · 0.45

Tested by

no test coverage detected