From e113c4da2c18a99659e7168afffd68e5d62e305a Mon Sep 17 00:00:00 2001 From: "Sang, Tao" Date: Mon, 23 Jun 2025 09:59:53 -0400 Subject: [PATCH] SWDEV-533964 - Let comgr compile SPIRV to exec directly (#494) [ROCm/clr commit: 7755660eeb4c4cf5f04f89b7f5e94b53a94304fc] --- projects/clr/hipamd/src/hip_fatbin.cpp | 43 ++++++-------------------- 1 file changed, 10 insertions(+), 33 deletions(-) diff --git a/projects/clr/hipamd/src/hip_fatbin.cpp b/projects/clr/hipamd/src/hip_fatbin.cpp index 722e8b2c23..cf5e9fbcba 100644 --- a/projects/clr/hipamd/src/hip_fatbin.cpp +++ b/projects/clr/hipamd/src/hip_fatbin.cpp @@ -352,18 +352,13 @@ hipError_t FatBinaryInfo::ExtractFatBinaryUsingCOMGR(const std::vector> compiled_co; // code object cache + comgr_helper::ComgrDataSetUniqueHandle spirv_data_set; + comgr_helper::ComgrDataUniqueHandle spirv_data; - auto compile_spv_bitcode = [&]() { - comgr_helper::ComgrDataSetUniqueHandle spirv_data_set; - comgr_helper::ComgrDataUniqueHandle spirv_data; - comgr_helper::ComgrActionInfoUniqueHandle action; - + auto get_spirv_data = [&]() { if (comgr_status = spirv_data_set.Create(); comgr_status != AMD_COMGR_STATUS_SUCCESS) { LogError("Failed to create SPIRV Data set"); return; @@ -396,23 +391,7 @@ hipError_t FatBinaryInfo::ExtractFatBinaryUsingCOMGR(const std::vectordevices()[0]->isa().targetId(); if (auto code_iter = compiled_co.find(target_id); code_iter != compiled_co.end()) { // We have already compiled for it, lets reuse the code object @@ -488,8 +465,8 @@ hipError_t FatBinaryInfo::ExtractFatBinaryUsingCOMGR(const std::vector