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 @@ -248,7 +248,8 @@ static bool selectBfloatLibs(const llvm::Triple &Triple, const Compilation &C,
static llvm::SmallSet<StringRef, 8> GPUArchsWithNBF16{
"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_dg2_g12", "intel_gpu_bmg_g21", "intel_gpu_lnl_m",
"intel_gpu_ptl_h", "intel_gpu_ptl_u"};
const llvm::opt::ArgList &Args = C.getArgs();
bool NeedLibs = false;

Expand Down Expand Up @@ -290,7 +291,7 @@ 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("lnl") || Device.starts_with("ptl");
};

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

// Test AOT-PTL + AOT-LNL specified via different options, uses native libs
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_lnl_m,spir64_gen \
// RUN: --sysroot=%S/Inputs/SYCL -Xsycl-target-backend=spir64_gen "-device ptl_h" \
// RUN: %s -### 2>&1 | FileCheck %s -check-prefix=BFLOAT16-NATIVE-NATIVE
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_lnl_m,spir64_gen \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these supported in clang_cl mode?
If yes, please add test cases for the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @srividya-sundaram
Yes, these tests should work with clang_cl mode.
Thanks very much.

// RUN: --sysroot=%S/Inputs/SYCL -Xsycl-target-backend=spir64_gen "-device ptl_u" \
// RUN: %s -### 2>&1 | FileCheck %s -check-prefix=BFLOAT16-NATIVE-NATIVE
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_ptl_h,spir64_gen \
// RUN: --sysroot=%S/Inputs/SYCL -Xsycl-target-backend=spir64_gen "-device lnl_m" \
// RUN: %s -### 2>&1 | FileCheck %s -check-prefix=BFLOAT16-NATIVE-NATIVE
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_ptl_u,spir64_gen \
// RUN: --sysroot=%S/Inputs/SYCL -Xsycl-target-backend=spir64_gen "-device lnl_m" \
// RUN: %s -### 2>&1 | FileCheck %s -check-prefix=BFLOAT16-NATIVE-NATIVE

// Test AOT-PTL + AOT-DG1 specified via different options, uses fallback libs
// RUN: %clangxx -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
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_dg1,spir64_gen \
// RUN: --sysroot=%S/Inputs/SYCL -Xsycl-target-backend=spir64_gen "-device ptl_u" \
// 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