MCPcopy Create free account
hub / github.com/ROCm/clr / linkLLVMBitcode

Method linkLLVMBitcode

rocclr/device/devprogram.cpp:263–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263bool Program::linkLLVMBitcode(const amd_comgr_data_set_t inputs,
264 const std::vector<std::string>& options,
265 amd::option::Options* amdOptions, amd_comgr_data_set_t* output,
266 char* binaryData[], size_t* binarySize) {
267 amd_comgr_language_t langver = getCOMGRLanguage(isHIP(), *amdOptions);
268 if (langver == AMD_COMGR_LANGUAGE_NONE) {
269 return false;
270 }
271
272 // Create the action for linking
273 amd_comgr_action_info_t action;
274 bool hasAction = false;
275
276 amd_comgr_status_t status = createAction(langver, options, &action, &hasAction);
277
278 if (status == AMD_COMGR_STATUS_SUCCESS) {
279 status = amd::Comgr::do_action(AMD_COMGR_ACTION_LINK_BC_TO_BC, action, inputs, *output);
280 extractBuildLog(*output);
281 }
282
283 if (status == AMD_COMGR_STATUS_SUCCESS) {
284 std::string dumpFileName;
285 if (amdOptions->isDumpFlagSet(amd::option::DUMP_BC_LINKED)) {
286 dumpFileName = amdOptions->getDumpFileName("_linked.bc");
287 }
288 status = extractByteCodeBinary(*output, AMD_COMGR_DATA_KIND_BC, dumpFileName, binaryData,
289 binarySize);
290 }
291
292 if (hasAction) {
293 amd::Comgr::destroy_action_info(action);
294 }
295
296 return (status == AMD_COMGR_STATUS_SUCCESS);
297}
298
299bool Program::compileToLLVMBitcode(const amd_comgr_data_set_t compileInputs,
300 const std::vector<std::string>& options,

Callers

nothing calls this directly

Calls 6

getCOMGRLanguageFunction · 0.85
createActionFunction · 0.85
extractBuildLogFunction · 0.85
extractByteCodeBinaryFunction · 0.85
isDumpFlagSetMethod · 0.80
getDumpFileNameMethod · 0.80

Tested by

no test coverage detected