Skip to content

Commit a879c42

Browse files
committed
[clang][openmp] - Do not add hip_host_overlay.h for HIP compilation
This header only needs added for openmp offloading involving hipMalloc or hipHostMalloc. This fixes a linker error regarding a missing symbol, omp_register_coarse_grain_mem, when compiling HIP with host openmp via -fopenmp. Change-Id: I8f1842661a026e4172a87dc25112478dd032bae9
1 parent 2d8aab2 commit a879c42

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,8 +1125,7 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
11251125

11261126
// When host compiling with OpenMP or HIP offloading include
11271127
// the host overlay definitions.
1128-
if ((JA.isHostOffloading(Action::OFK_OpenMP)) ||
1129-
(JA.isHostOffloading(Action::OFK_HIP))) {
1128+
if (JA.isHostOffloading(Action::OFK_OpenMP)) {
11301129
SmallString<128> P(D.ResourceDir);
11311130
llvm::sys::path::append(P, "include");
11321131
llvm::sys::path::append(P, "openmp_wrappers");

0 commit comments

Comments
 (0)