Skip to content

Commit 8bb00cb

Browse files
[AMDGPU][OpenMP] Do not attach -fcuda-is-device flag for AMDGPU OpenMP (#96909)
`-fcuda-is-device` flag is not used for OpenMP offloading for AMD GPUs and it does not need to be added as clang cc1 option for OpenMP code.
1 parent 3562001 commit 8bb00cb

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ void AMDGPUOpenMPToolChain::addClangTargetOptions(
4747
assert(DeviceOffloadingKind == Action::OFK_OpenMP &&
4848
"Only OpenMP offloading kinds are supported.");
4949

50-
CC1Args.push_back("-fcuda-is-device");
51-
5250
if (DriverArgs.hasArg(options::OPT_nogpulib))
5351
return;
5452

clang/test/Driver/amdgpu-openmp-toolchain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// verify the tools invocations
99
// CHECK: "-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}}"-emit-llvm-bc"{{.*}}"-x" "c"
10-
// CHECK: "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu"{{.*}}"-fcuda-is-device"{{.*}}"-target-cpu" "gfx906"
10+
// CHECK: "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-unknown-linux-gnu"{{.*}}"-target-cpu" "gfx906"
1111
// CHECK: "-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}}"-emit-obj"
1212
// CHECK: clang-linker-wrapper{{.*}} "-o" "a.out"
1313

0 commit comments

Comments
 (0)