Skip to content

Commit 566a06f

Browse files
steffenlarsenbb-sycl
authored andcommitted
[SYCL][CUDA] Add SM version check to bfloat16 CUDA test (intel#1423)
* [SYCL][CUDA] Add SM version check to bfloat16 CUDA test bfloat16 requires SM80 on the CUDA backend. This commit changes CUDA tests to do an early exit if that requirement is not met. * Remove CUDA specific test and try run SM80 Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 7b3ed30 commit 566a06f

File tree

2 files changed

+25
-21
lines changed

2 files changed

+25
-21
lines changed

SYCL/BFloat16/bfloat16_type.cpp

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
// UNSUPPORTED: hip
2-
// RUN: %if cuda %{%clangxx -fsycl -fsycl-targets=%sycl_triple -Xsycl-target-backend --cuda-gpu-arch=sm_80 %s -o %t.out %}
3-
// TODO enable the below when CI supports >=sm_80
4-
// RUNx: %if cuda %{%GPU_RUN_PLACEHOLDER %t.out %}
5-
// RUN: %clangxx -fsycl %s -o %t.out
1+
// RUN: %if cuda %{%clangxx -fsycl -fsycl-targets=%sycl_triple -DUSE_CUDA_SM80=1 -Xsycl-target-backend --cuda-gpu-arch=sm_80 %s -o %t.out %}
2+
// RUN: %if cuda %{%GPU_RUN_PLACEHOLDER %t.out %}
3+
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
64
// TODO currently the feature isn't supported on FPGA.
75
// RUN: %CPU_RUN_PLACEHOLDER %t.out
86
// RUN: %GPU_RUN_PLACEHOLDER %t.out
97
// RUNx: %ACC_RUN_PLACEHOLDER %t.out
8+
//
9+
// Not currently supported on HIP.
10+
// UNSUPPORTED: hip
1011

1112
//==----------- bfloat16_type.cpp - SYCL bfloat16 type test ----------------==//
1213
//
@@ -18,4 +19,22 @@
1819

1920
#include "bfloat16_type.hpp"
2021

21-
int main() { return run_tests(); }
22+
int main() {
23+
24+
#ifdef USE_CUDA_SM80
25+
// Special build for SM80 CUDA.
26+
sycl::device Dev{default_selector_v};
27+
if (Dev.get_platform().get_backend() != backend::ext_oneapi_cuda) {
28+
std::cout << "Test skipped; CUDA run was not run with CUDA device."
29+
<< std::endl;
30+
return 0;
31+
}
32+
if (std::stof(Dev.get_info<sycl::info::device::backend_version>()) < 8.0f) {
33+
std::cout << "Test skipped; CUDA device does not support SM80 or newer."
34+
<< std::endl;
35+
return 0;
36+
}
37+
#endif
38+
39+
return run_tests();
40+
}

SYCL/BFloat16/bfloat16_type_cuda.cpp

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)