Skip to content
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

[SYCL] Correct some driver diagnostic wording #4243

Merged
merged 2 commits into from
Aug 4, 2021
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
13 changes: 7 additions & 6 deletions clang/include/clang/Basic/DiagnosticDriverKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ def warn_drv_unknown_cuda_version: Warning<
InGroup<CudaUnknownVersion>;
def err_drv_cuda_host_arch : Error<"unsupported architecture '%0' for host compilation.">;
def err_drv_no_sycl_libspirv : Error<
"cannot find `libspirv-nvptx64--nvidiacl.bc`. Provide path to libspirv library via "
"-fsycl-libspirv-path, or pass -fno-sycl-libspirv to build without linking with libspirv.">;
"cannot find 'libspirv-nvptx64--nvidiacl.bc'; provide path to libspirv "
"library via '-fsycl-libspirv-path', or pass '-fno-sycl-libspirv' to build "
"without linking with libspirv">;
def err_drv_mix_cuda_hip : Error<"Mixed Cuda and HIP compilation is not supported.">;
def err_drv_bad_target_id : Error<"Invalid target ID: %0 (A target ID is a processor name "
"followed by an optional list of predefined features post-fixed by a plus or minus sign deliminated "
Expand Down Expand Up @@ -285,12 +286,12 @@ def err_drv_omp_host_target_not_supported : Error<
def err_drv_expecting_fopenmp_with_fopenmp_targets : Error<
"The option -fopenmp-targets must be used in conjunction with a -fopenmp option compatible with offloading, please use -fopenmp=libomp or -fopenmp=libiomp5.">;
def err_drv_expecting_fsycl_with_sycl_opt : Error<
"The option %0 must be used in conjunction with -fsycl to enable offloading.">;
"'%0' must be used in conjunction with '-fsycl' to enable offloading">;
def err_drv_fsycl_with_c_type : Error<
"The option '%0' must not be used in conjunction with '-fsycl', which expects C++ source.">;
"'%0' must not be used in conjunction with '-fsycl', which expects C++ source">;
def warn_drv_sycl_offload_target_duplicate : Warning<
"The SYCL offloading target '%0' is similar to target '%1' already specified - will be ignored.">,
InGroup<SyclTarget>;
"SYCL offloading target '%0' is similar to target '%1' already specified; "
"will be ignored">, InGroup<SyclTarget>;
def err_drv_omp_offload_target_missingbcruntime : Error<
"No library '%0' found in the default clang lib directory or in LIBRARY_PATH. Please use --libomptarget-%1-bc-path to specify %1 bitcode library.">;
def err_drv_omp_offload_target_bcruntime_not_found : Error<"Bitcode library '%0' does not exist.">;
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Driver/sycl-libspirv-invalid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
// RUN: -fsycl-targets=nvptx64-nvidia-nvcl-sycldevice --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: -fsycl-libspirv-path=%S/Inputs/SYCL/no-libspirv-exists-here.bc %s 2>&1 \
// RUN: | FileCheck --check-prefix=ERR %s
// ERR: cannot find `libspirv-nvptx64--nvidiacl.bc`
// ERR: cannot find 'libspirv-nvptx64--nvidiacl.bc'

// RUN: %clangxx -### -std=c++11 -target x86_64-unknown-linux-gnu -fsycl \
// RUN: -fsycl-targets=nvptx64-nvidia-nvcl-sycldevice --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
// RUN: -fsycl-libspirv-path=%S/Inputs/SYCL/no-libspirv-exists-here.bc -fno-sycl-libspirv %s 2>&1 \
// RUN: | FileCheck --check-prefix=OK %s
// OK-NOT: cannot find `libspirv-nvptx64--nvidiacl.bc`
// OK-NOT: cannot find 'libspirv-nvptx64--nvidiacl.bc'
14 changes: 7 additions & 7 deletions clang/test/Driver/sycl-offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@
// RUN: | FileCheck -check-prefix=CHK-NO-FSYCL %s
// RUN: %clang_cl -### -fsycl-targets=spir64-unknown-unknown-sycldevice %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHK-NO-FSYCL %s
// CHK-NO-FSYCL: error: The option -fsycl-targets must be used in conjunction with -fsycl to enable offloading.
// CHK-NO-FSYCL: error: '-fsycl-targets' must be used in conjunction with '-fsycl' to enable offloading
// RUN: %clang -### -fsycl-link-targets=spir64-unknown-unknown-sycldevice %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHK-NO-FSYCL-LINK-TGTS %s
// CHK-NO-FSYCL-LINK-TGTS: error: The option -fsycl-link-targets must be used in conjunction with -fsycl to enable offloading.
// CHK-NO-FSYCL-LINK-TGTS: error: '-fsycl-link-targets' must be used in conjunction with '-fsycl' to enable offloading
// RUN: %clang -### -fsycl-add-targets=spir64-unknown-unknown-sycldevice %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHK-NO-FSYCL-ADD %s
// CHK-NO-FSYCL-ADD: error: The option -fsycl-add-targets must be used in conjunction with -fsycl to enable offloading.
// CHK-NO-FSYCL-ADD: error: '-fsycl-add-targets' must be used in conjunction with '-fsycl' to enable offloading
// RUN: %clang -### -fsycl-link %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHK-NO-FSYCL-LINK %s
// CHK-NO-FSYCL-LINK: error: The option -fsycl-link must be used in conjunction with -fsycl to enable offloading.
// CHK-NO-FSYCL-LINK: error: '-fsycl-link' must be used in conjunction with '-fsycl' to enable offloading
// RUN: %clang -### -fintelfpga %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHK-NO-FSYCL-FINTELFPGA %s
// CHK-NO-FSYCL-FINTELFPGA: error: The option -fintelfpga must be used in conjunction with -fsycl to enable offloading.
// CHK-NO-FSYCL-FINTELFPGA: error: '-fintelfpga' must be used in conjunction with '-fsycl' to enable offloading

/// ###########################################################################

Expand Down Expand Up @@ -142,7 +142,7 @@
/// Check warning for duplicate offloading targets.
// RUN: %clang -### -ccc-print-phases -fsycl -fsycl-targets=spir64-unknown-unknown-sycldevice,spir64-unknown-unknown-sycldevice %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHK-DUPLICATES %s
// CHK-DUPLICATES: warning: The SYCL offloading target 'spir64-unknown-unknown-sycldevice' is similar to target 'spir64-unknown-unknown-sycldevice' already specified - will be ignored.
// CHK-DUPLICATES: warning: SYCL offloading target 'spir64-unknown-unknown-sycldevice' is similar to target 'spir64-unknown-unknown-sycldevice' already specified; will be ignored

/// ###########################################################################

Expand Down Expand Up @@ -916,7 +916,7 @@
// RUN: %clangxx -### -c -fsycl -xc %s 2>&1 | FileCheck -check-prefixes=CHECK_XC_FSYCL %s
// RUN: %clangxx -### -c -fsycl -xc-header %s 2>&1 | FileCheck -check-prefixes=CHECK_XC_FSYCL %s
// RUN: %clangxx -### -c -fsycl -xcpp-output %s 2>&1 | FileCheck -check-prefixes=CHECK_XC_FSYCL %s
// CHECK_XC_FSYCL: The option '-x c{{.*}}' must not be used in conjunction with '-fsycl'
// CHECK_XC_FSYCL: '-x c{{.*}}' must not be used in conjunction with '-fsycl'

// -std=c++17 check (check all 3 compilations)
// RUN: %clangxx -### -c -fsycl -xc++ %s 2>&1 | FileCheck -check-prefix=CHECK-STD %s
Expand Down