gentoo-overlay/dev-libs/rocm-comgr/files/rocm-comgr-6.3.0-fix-comgr-default-flags.patch

40 lines
1.5 KiB
Diff

--- a/src/comgr-compiler.cpp
+++ b/src/comgr-compiler.cpp
@@ -1031,9 +1031,8 @@ AMDGPUCompiler::addTargetIdentifierFlags(llvm::StringRef IdentStr,
}
amd_comgr_status_t AMDGPUCompiler::addCompilationFlags() {
- HIPIncludePath = (Twine(env::getHIPPath()) + "/include").str();
- // HIP headers depend on hsa.h which is in ROCM_DIR/include.
- ROCMIncludePath = (Twine(env::getROCMPath()) + "/include").str();
+ // Allow to include <include/cuda_wrappers/algorithm> (used in some hip files)
+ ClangIncludePath = @CLANG_RESOURCE_DIR@;
// Default to O3 for all contexts
Args.push_back("-O3");
@@ -1059,9 +1058,7 @@ amd_comgr_status_t AMDGPUCompiler::addCompilationFlags() {
Args.push_back("-nogpuinc");
Args.push_back("--offload-device-only");
Args.push_back("-isystem");
- Args.push_back(ROCMIncludePath.c_str());
- Args.push_back("-isystem");
- Args.push_back(HIPIncludePath.c_str());
+ Args.push_back(ClangIncludePath.c_str());
break;
default:
return AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT;
--- a/src/comgr-compiler.h
+++ b/src/comgr-compiler.h
@@ -95,12 +95,7 @@ class AMDGPUCompiler {
/// User supplied target GPU Arch.
std::string GPUArch;
std::string OffloadArch;
- /// ROCM include Path
- std::string ROCMIncludePath;
- /// HIP and Clang Include Paths
- std::string HIPIncludePath;
std::string ClangIncludePath;
- std::string ClangIncludePath2;
/// Perform out-of-process compilation.
bool CompileOOP = false;
/// Precompiled header file paths.