[libcxx-commits] [clang] [libc] [lldb] [llvm] [mlir] [compiler-rt] [lld] [libcxx] [Driver] Test ignored target-specific options for AMDGPU/NVPTX (PR #79222)

Fangrui Song via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 23 19:00:01 PST 2024


================
@@ -0,0 +1,7 @@
+/// Some target-specific options are ignored for GPU, so %clang exits with code 0.
+// DEFINE: %{gpu_opts} = --cuda-gpu-arch=sm_60 --cuda-path=%S/Inputs/CUDA/usr/local/cuda --no-cuda-version-check
+// DEFINE: %{check} = %clang -### -c %{gpu_opts} -mcmodel=medium %s
+// RUN: %{check} -fbasic-block-sections=all
----------------
MaskRay wrote:

Added `-x cuda`. The test is to show we don't get an error (`err_drv_unsupported_opt_for_target`) when compiling for x86_64 using a device (AMDGPU/NVPTX) when certain target-specified options are specified.

I am not familiar with offloading but specifying `--cuda-host-only` would defeat the purpose.

https://github.com/llvm/llvm-project/pull/79222


More information about the libcxx-commits mailing list