| 525 | } |
| 526 | |
| 527 | bool linkLLVMBitcode(const amd_comgr_data_set_t linkInputs, const std::string& isa, |
| 528 | std::vector<std::string>& linkOptions, std::string& buildLog, |
| 529 | std::vector<char>& LinkedLLVMBitcode) { |
| 530 | const amd_comgr_language_t lang = AMD_COMGR_LANGUAGE_HIP; |
| 531 | amd_comgr_action_info_t action; |
| 532 | |
| 533 | if (!createAction(action, linkOptions, isa, lang)) { |
| 534 | return false; |
| 535 | } |
| 536 | |
| 537 | amd_comgr_data_set_t output; |
| 538 | if (auto res = amd::Comgr::create_data_set(&output); res != AMD_COMGR_STATUS_SUCCESS) { |
| 539 | amd::Comgr::destroy_action_info(action); |
| 540 | return false; |
| 541 | } |
| 542 | |
| 543 | if (auto res = amd::Comgr::do_action(AMD_COMGR_ACTION_LINK_BC_TO_BC, action, linkInputs, output); |
| 544 | res != AMD_COMGR_STATUS_SUCCESS) { |
| 545 | amd::Comgr::destroy_action_info(action); |
| 546 | amd::Comgr::destroy_data_set(output); |
| 547 | return false; |
| 548 | } |
| 549 | |
| 550 | if (!extractBuildLog(output, buildLog)) { |
| 551 | amd::Comgr::destroy_action_info(action); |
| 552 | amd::Comgr::destroy_data_set(output); |
| 553 | return false; |
| 554 | } |
| 555 | |
| 556 | if (!extractByteCodeBinary(output, AMD_COMGR_DATA_KIND_BC, LinkedLLVMBitcode)) { |
| 557 | amd::Comgr::destroy_action_info(action); |
| 558 | amd::Comgr::destroy_data_set(output); |
| 559 | return false; |
| 560 | } |
| 561 | |
| 562 | amd::Comgr::destroy_action_info(action); |
| 563 | amd::Comgr::destroy_data_set(output); |
| 564 | return true; |
| 565 | } |
| 566 | |
| 567 | bool convertSPIRVToLLVMBC(const amd_comgr_data_set_t linkInputs, const std::string& isa, |
| 568 | std::vector<std::string>& linkOptions, std::string& buildLog, |
no test coverage detected