File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff 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 ))
Original file line number Diff line number Diff line change 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"
You can’t perform that action at this time.
0 commit comments