Skip to content
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
7 changes: 5 additions & 2 deletions clang/lib/Driver/ToolChains/SYCL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,10 +553,13 @@ static void addSYCLDeviceSanitizerLibs(
if (SYCLTargetStr.starts_with("spir64_x86_64"))
return AOT_CPU;

if (SYCLTargetStr == "intel_gpu_pvc")
// Resolve intel_gpu_* so that every alias of a device (e.g.
// intel_gpu_12_60_7 for pvc) selects the same library.
StringRef GenDevice = SYCL::gen::resolveGenDevice(SYCLTargetStr);
if (GenDevice == "pvc")
return AOT_PVC;

if (SYCLTargetStr.starts_with("intel_gpu_dg2"))
if (GenDevice == "dg2" || GenDevice.starts_with("acm_g"))
Comment thread
mdtoguchi marked this conversation as resolved.
return AOT_DG2;

if (SYCLTargetStr.starts_with("spir64_gen")) {
Expand Down
10 changes: 10 additions & 0 deletions clang/test/Driver/sycl-device-lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
/// test behavior of linking libsycl-asan-pvc for PVC target AOT compilation when asan flag is applied.
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_pvc --offload-new-driver %s --sysroot=%S/Inputs/SYCL \
// RUN: -Xarch_device -fsanitize=address -### 2>&1 | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_ASAN_PVC
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_12_60_7 --offload-new-driver %s --sysroot=%S/Inputs/SYCL \
// RUN: -Xarch_device -fsanitize=address -### 2>&1 | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_ASAN_PVC
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen --offload-new-driver %s --sysroot=%S/Inputs/SYCL \
// RUN: -Xarch_device -fsanitize=address -Xsycl-target-backend "-device pvc" -### 2>&1 \
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_ASAN_PVC
Expand Down Expand Up @@ -98,6 +100,10 @@
/// test behavior of linking libsycl-asan-dg2 for DG2 target AOT compilation when asan flag is applied.
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_dg2_g10 --offload-new-driver %s --sysroot=%S/Inputs/SYCL \
// RUN: -Xarch_device -fsanitize=address -### 2>&1 | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_ASAN_DG2
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_12_55_8 --offload-new-driver %s --sysroot=%S/Inputs/SYCL \
// RUN: -Xarch_device -fsanitize=address -### 2>&1 | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_ASAN_DG2
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_acm_g10 --offload-new-driver %s --sysroot=%S/Inputs/SYCL \
// RUN: -Xarch_device -fsanitize=address -### 2>&1 | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_ASAN_DG2
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen --offload-new-driver %s --sysroot=%S/Inputs/SYCL \
// RUN: -Xarch_device -fsanitize=address -Xsycl-target-backend "-device dg2" -### 2>&1 \
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_ASAN_DG2
Expand Down Expand Up @@ -151,6 +157,8 @@
/// test behavior of msan libdevice linking when -fsanitize=memory is available for AOT targets
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_pvc --offload-new-driver %s --sysroot=%S/Inputs/SYCL \
// RUN: -fsanitize=memory -### 2>&1 | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_MSAN_PVC
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_12_60_7 --offload-new-driver %s --sysroot=%S/Inputs/SYCL \
// RUN: -fsanitize=memory -### 2>&1 | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_MSAN_PVC
// SYCL_DEVICE_LIB_MSAN_PVC: clang{{.*}} "-mlink-bitcode-file" "{{.*}}libsycl-msan-pvc.bc"

/// test behavior of msan libdevice linking when -fsanitize=memory is available for AOT targets
Expand Down Expand Up @@ -183,6 +191,8 @@
/// test behavior of tsan libdevice linking when -fsanitize=thread is available for AOT targets
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_pvc --offload-new-driver %s --sysroot=%S/Inputs/SYCL \
// RUN: -fsanitize=thread -### 2>&1 | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_TSAN_PVC
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_12_60_7 --offload-new-driver %s --sysroot=%S/Inputs/SYCL \
// RUN: -fsanitize=thread -### 2>&1 | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_TSAN_PVC
// SYCL_DEVICE_LIB_TSAN_PVC: clang{{.*}} "-mlink-bitcode-file" "{{.*}}libsycl-tsan-pvc.bc"

/// test behavior of tsan libdevice linking when -fsanitize=thread is available for AOT targets
Expand Down
Loading