Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions clang/lib/Driver/ToolChains/SYCL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static bool selectBfloatLibs(const llvm::Triple &Triple, const Compilation &C,
"intel_gpu_pvc", "intel_gpu_acm_g10", "intel_gpu_acm_g11",
"intel_gpu_acm_g12", "intel_gpu_dg2_g10", "intel_gpu_dg2_g11",
"intel_dg2_g12", "intel_gpu_bmg_g21", "intel_gpu_lnl_m",
"intel_gpu_ptl_h", "intel_gpu_ptl_u"};
"intel_gpu_ptl_h", "intel_gpu_ptl_u", "intel_gpu_wcl"};
const llvm::opt::ArgList &Args = C.getArgs();
bool NeedLibs = false;

Expand Down Expand Up @@ -294,7 +294,8 @@ static bool selectBfloatLibs(const llvm::Triple &Triple, const Compilation &C,
auto checkBF = [](StringRef Device) {
return Device.starts_with("pvc") || Device.starts_with("ats") ||
Device.starts_with("dg2") || Device.starts_with("bmg") ||
Device.starts_with("lnl") || Device.starts_with("ptl");
Device.starts_with("lnl") || Device.starts_with("ptl") ||
Device.starts_with("wcl");
};

auto checkSpirvJIT = [](StringRef Target) {
Expand Down
40 changes: 40 additions & 0 deletions clang/test/Driver/sycl-device-lib-bfloat16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@
// RUN: "-device pvc" %s --sysroot=%S/Inputs/SYCL -### 2>&1 \
// RUN: | FileCheck %s -check-prefix=BFLOAT16-NATIVE

// Test that a wcl AOT compilation uses the native library.
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend \
// RUN: "-device wcl" %s --sysroot=%S/Inputs/SYCL -### 2>&1 \
// RUN: | FileCheck %s -check-prefix=BFLOAT16-NATIVE
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_wcl %s \
// RUN: --sysroot=%S/Inputs/SYCL -### 2>&1 \
// RUN: | FileCheck %s -check-prefix=BFLOAT16-NATIVE
// RUN: %clang_cl -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend \
// RUN: "-device wcl" %s --sysroot=%S/Inputs/SYCL -### 2>&1 \
// RUN: | FileCheck %s -check-prefix=BFLOAT16-NATIVE

// Test that unless all targets support bfloat16, AOT compilation uses the
// fallback library.
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend \
Expand Down Expand Up @@ -147,6 +158,23 @@
// RUN: --sysroot=%S/Inputs/SYCL %s -### 2>&1 \
// RUN: | FileCheck %s -check-prefix=BFLOAT16-NATIVE-NONE

// Test AOT-wcl + JIT compilation uses native libs + no libs
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_wcl,spir64 \
// RUN: --sysroot=%S/Inputs/SYCL %s -### 2>&1 \
// RUN: | FileCheck %s -check-prefix=BFLOAT16-NATIVE-NONE
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_wcl,spirv64 \
// RUN: --sysroot=%S/Inputs/SYCL %s -### 2>&1 \
// RUN: | FileCheck %s -check-prefix=BFLOAT16-NATIVE-NONE
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_wcl,spir64-unknown-unknown \
// RUN: --sysroot=%S/Inputs/SYCL %s -### 2>&1 \
// RUN: | FileCheck %s -check-prefix=BFLOAT16-NATIVE-NONE
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_wcl,spirv64-unknown-unknown \
// RUN: --sysroot=%S/Inputs/SYCL %s -### 2>&1 \
// RUN: | FileCheck %s -check-prefix=BFLOAT16-NATIVE-NONE
// RUN: %clang_cl -fsycl -fsycl-targets=intel_gpu_wcl,spir64 \
// RUN: --sysroot=%S/Inputs/SYCL %s -### 2>&1 \
// RUN: | FileCheck %s -check-prefix=BFLOAT16-NATIVE-NONE

// Test AOT-DG1 + JIT compilation uses native libs + no libs
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_dg1,spir64 \
// RUN: --sysroot=%S/Inputs/SYCL %s -### 2>&1 \
Expand Down Expand Up @@ -291,6 +319,18 @@
// RUN: %clang_cl -fsycl -fsycl-targets=intel_gpu_ptl_h,spir64_gen \
// RUN: --sysroot=%S/Inputs/SYCL -Xsycl-target-backend=spir64_gen "-device dg1" \
// RUN: %s -### 2>&1 | FileCheck %s -check-prefix=BFLOAT16-FALLBACK-FALLBACK

// Test AOT-wcl + AOT-DG1 specified via different options, uses fallback libs
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_wcl,spir64_gen \
// RUN: --sysroot=%S/Inputs/SYCL -Xsycl-target-backend=spir64_gen "-device dg1" \
// RUN: %s -### 2>&1 | FileCheck %s -check-prefix=BFLOAT16-FALLBACK-FALLBACK
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_dg1,spir64_gen \
// RUN: --sysroot=%S/Inputs/SYCL -Xsycl-target-backend=spir64_gen "-device wcl" \
// RUN: %s -### 2>&1 | FileCheck %s -check-prefix=BFLOAT16-FALLBACK-FALLBACK
// RUN: %clang_cl -fsycl -fsycl-targets=intel_gpu_wcl,spir64_gen \
// RUN: --sysroot=%S/Inputs/SYCL -Xsycl-target-backend=spir64_gen "-device dg1" \
// RUN: %s -### 2>&1 | FileCheck %s -check-prefix=BFLOAT16-FALLBACK-FALLBACK

// BFLOAT16-NOT: llvm-link{{.*}} "{{.*}}libsycl-{{fallback|native}}-bfloat16.bc"

// BFLOAT16-NATIVE: llvm-link{{.*}} "{{.*}}libsycl-native-bfloat16.bc"
Expand Down
Loading