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

Function compile_hip_raw

src/targets/gpu/compile_hip_code_object.cpp:172–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172std::vector<char>
173compile_hip_raw(context& ctx, const std::string& content, hip_compile_options options)
174{
175 assert(options.global > 0);
176 assert(options.local > 0);
177 std::vector<src_file> srcs = options.additional_src_files;
178 static auto kernels{::migraphx_kernels()};
179 std::transform(
180 kernels.begin(),
181 kernels.end(),
182 std::back_inserter(srcs),
183 [](const std::pair<std::string_view, std::string_view>& elem) { return src_file{elem}; });
184 srcs.emplace_back("main.cpp", content);
185
186 if(options.global % options.local != 0 and hip_accept_non_uniform_wg())
187 options.emplace_param("-fno-offload-uniform-block");
188 else
189 assert(options.global % options.local == 0);
190
191 options.emplace_param("-DMIGRAPHX_NGLOBAL=" + std::to_string(options.global));
192 options.emplace_param("-DMIGRAPHX_NLOCAL=" + std::to_string(options.local));
193 options.emplace_param("-DMIGRAPHX_WAVEFRONTSIZE=" +
194 std::to_string(ctx.get_current_device().get_wavefront_size()));
195 const auto& warnings = compiler_warnings();
196 options.params.insert(options.params.end(), warnings.begin(), warnings.end());
197 options.emplace_param("-ftemplate-backtrace-limit=0");
198 options.emplace_param("-Werror");
199 auto cos = compile_hip_src(srcs, options.params, ctx.get_current_device().get_device_name());
200 if(cos.size() != 1)
201 MIGRAPHX_THROW("No code object");
202 return cos.front();
203}
204
205operation
206compile_hip_code_object(context& ctx, const std::string& content, hip_compile_options options)

Callers 2

compileMethod · 0.85
compile_hip_code_objectFunction · 0.85

Calls 13

compile_hip_srcFunction · 0.85
emplace_backMethod · 0.80
emplace_paramMethod · 0.80
get_wavefront_sizeMethod · 0.80
get_device_nameMethod · 0.80
frontMethod · 0.80
transformFunction · 0.50
to_stringFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected