From e8a4f178c110e692289d6e78654c9a3524b82312 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Wed, 1 Feb 2023 14:30:11 -0500 Subject: [PATCH] Stop hipcc from passing --hip-device-lib-path (#56) to clang by default. Let clang determine device lib path by itself by default. Only do that if env var DEVICE_LIB_PATH is set. Change-Id: I403cf3e6a10215f85871f9dad79cd57f67395e59 --- amd/hipcc/src/hipBin_amd.h | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/amd/hipcc/src/hipBin_amd.h b/amd/hipcc/src/hipBin_amd.h index 6c906aa041c816..1cfc6a36e77118 100644 --- a/amd/hipcc/src/hipBin_amd.h +++ b/amd/hipcc/src/hipBin_amd.h @@ -331,28 +331,7 @@ string HipBinAmd::getCppConfig() { string HipBinAmd::getDeviceLibPath() const { const EnvVariables& var = getEnvVariables(); - const string& rocclrHomePath = getRocclrHomePath(); - const string& roccmPath = getRoccmPath(); - fs::path bitCodePath = rocclrHomePath; - bitCodePath /= "lib/bitcode"; string deviceLibPath = var.deviceLibPathEnv_; - if (deviceLibPath.empty() && fs::exists(bitCodePath)) { - deviceLibPath = bitCodePath.string(); - } - - if (deviceLibPath.empty()) { - fs::path amdgcnBitcode = roccmPath; - amdgcnBitcode /= "amdgcn/bitcode"; - if (fs::exists(amdgcnBitcode)) { - deviceLibPath = amdgcnBitcode.string(); - } else { - // This path is to support an older build of the device library - // TODO(hipcc): To be removed in the future. - fs::path lib = roccmPath; - lib /= "lib"; - deviceLibPath = lib.string(); - } - } return deviceLibPath; } @@ -876,9 +855,7 @@ void HipBinAmd::executeHipCCCmd(vector argv) { } if (hasHIP) { - fs::path bitcodeFs = roccmPath; - bitcodeFs /= "amdgcn/bitcode"; - if (deviceLibPath != bitcodeFs.string()) { + if (!deviceLibPath.empty()) { string hip_device_lib_str = " --hip-device-lib-path=\"" + deviceLibPath + "\""; HIPCXXFLAGS += hip_device_lib_str;