Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit d22b329

Browse files
authored
[SYCL] Add bf16 aspect (#888)
This PR adds the bf16 aspect to aspects.cpp test. Depends on: intel/llvm#5720
1 parent 1ca16ca commit d22b329

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

SYCL/BFloat16/bfloat16_type_cuda.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// REQUIRES: gpu, cuda
22
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -Xsycl-target-backend --cuda-gpu-arch=sm_80 %s -o %t.out
3-
// TODO: Currently the CI does not have a sm_80 capable machine. Enable the test
4-
// execution once it does.
5-
// RUNx: %t.out
3+
// RUN: %t.out
64

75
//==--------- bfloat16_type_cuda.cpp - SYCL bfloat16 type test -------------==//
86
//
@@ -14,4 +12,13 @@
1412

1513
#include "bfloat16_type.hpp"
1614

17-
int main() { return run_tests(); }
15+
int main() {
16+
bool has_bfloat16_aspect = false;
17+
for (const auto &plt : sycl::platform::get_platforms()) {
18+
if (plt.has(aspect::ext_oneapi_bfloat16))
19+
has_bfloat16_aspect = true;
20+
}
21+
22+
if (has_bfloat16_aspect)
23+
return run_tests();
24+
}

SYCL/Basic/aspects.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ int main() {
5757
if (plt.has(aspect::fp64)) {
5858
std::cout << " fp64" << std::endl;
5959
}
60+
if (plt.has(aspect::ext_oneapi_bfloat16)) {
61+
std::cout << " ext_oneapi_bfloat16" << std::endl;
62+
}
6063
if (plt.has(aspect::int64_base_atomics)) {
6164
std::cout << " base atomic operations" << std::endl;
6265
}

0 commit comments

Comments
 (0)