Skip to content

Commit fa14b78

Browse files
committed
Update HIPAMD toolchain. Update tests.
1 parent 1c8829a commit fa14b78

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

clang/lib/Driver/ToolChains/HIPAMD.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ void HIPAMDToolChain::addClangTargetOptions(
238238
assert(DeviceOffloadingKind == Action::OFK_HIP &&
239239
"Only HIP offloading kinds are supported for GPUs.");
240240

241-
CC1Args.push_back("-fcuda-is-device");
241+
CC1Args.append({"-fcuda-is-device", "-fno-threadsafe-statics"});
242242

243243
if (!DriverArgs.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc,
244244
false))

clang/test/Driver/cuda-no-threadsafe-statics.cu

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
// Check that -fno-thread-safe-statics get passed down to device-side
22
// compilation only.
33
//
4-
// RUN: not %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s 2>&1 \
5-
// RUN: | FileCheck %s
4+
// RUN: %clang -### -x cuda --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s \
5+
// RUN: -nocudainc -nocudalib 2>&1 | FileCheck %s
6+
7+
// RUN: %clang -### -x hip --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx1010 %s \
8+
// RUN: -nocudainc -nocudalib 2>&1 | FileCheck %s
69
//
710
// CHECK: "-fcuda-is-device"
811
// CHECK-SAME: "-fno-threadsafe-statics"

0 commit comments

Comments
 (0)