Skip to content

[SYCL][Clang] Rename -Wno-libspirv-hip-cuda to -Wunsafe-libspirv-not-linked #19053

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/include/clang/Basic/DiagnosticDriverKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def err_drv_no_sycl_libspirv : Error<
def warn_flag_no_sycl_libspirv
: Warning<"'-fno-sycl-libspirv' should not be used with target '%0'; "
"libspirv is required for correct behavior">,
InGroup<NoLibspirvHipCuda>;
InGroup<UnsafeLibspirvNotLinked>;
def err_drv_mix_cuda_hip : Error<
"mixed CUDA and HIP compilation is not supported">;
def err_drv_bad_target_id : Error<
Expand Down
6 changes: 3 additions & 3 deletions clang/include/clang/Basic/DiagnosticGroups.td
Original file line number Diff line number Diff line change
Expand Up @@ -1600,9 +1600,9 @@ def CudaUnknownVersion: DiagGroup<"unknown-cuda-version">;
// ignored by CUDA.
def HIPOnly : DiagGroup<"hip-only">;

// A warning generated when compiling SYCL applications for HIP or CUDA backends
// without linking LIBSPIRV.
def NoLibspirvHipCuda : DiagGroup<"no-libspirv-hip-cuda">;
// A warning generated when compiling SYCL applications without linking LIBSPIRV
// for targets that require it.
def UnsafeLibspirvNotLinked : DiagGroup<"unsafe-libspirv-not-linked">;

// Warning about mixed HIP and OpenMP compilation / target offloading.
def HIPOpenMPOffloading: DiagGroup<"hip-omp-target-directives">;
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Driver/sycl-fno-libspirv-warn.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// Test that appropriate warnings are output when -fno-sycl-libspirv is used.

// RUN: not %clangxx -fsycl -fsycl-targets=nvptx64-nvidia-cuda,amdgcn-amd-amdhsa -fno-sycl-libspirv %s -### 2>&1 | FileCheck %s
// CHECK-DAG: warning: '-fno-sycl-libspirv' should not be used with target 'nvptx64-nvidia-cuda'; libspirv is required for correct behavior [-Wno-libspirv-hip-cuda]
// CHECK-DAG: warning: '-fno-sycl-libspirv' should not be used with target 'amdgcn-amd-amdhsa'; libspirv is required for correct behavior [-Wno-libspirv-hip-cuda]
// CHECK-DAG: warning: '-fno-sycl-libspirv' should not be used with target 'nvptx64-nvidia-cuda'; libspirv is required for correct behavior [-Wunsafe-libspirv-not-linked]
// CHECK-DAG: warning: '-fno-sycl-libspirv' should not be used with target 'amdgcn-amd-amdhsa'; libspirv is required for correct behavior [-Wunsafe-libspirv-not-linked]
// RUN: %clangxx -fsycl -fsycl-targets=spir64-unknown-unknown -fno-sycl-libspirv %s -### 2>&1 | FileCheck --check-prefix=CHECK-SPIR64 %s
// CHECK-SPIR64: ignoring '-fno-sycl-libspirv' option as it is not currently supported for target 'spir64-unknown-unknown' [-Woption-ignored]