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

[SYCL] Add bf16 aspect #888

Merged
merged 5 commits into from
Jun 13, 2022
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
15 changes: 11 additions & 4 deletions SYCL/BFloat16/bfloat16_type_cuda.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// REQUIRES: gpu, cuda
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -Xsycl-target-backend --cuda-gpu-arch=sm_80 %s -o %t.out
// TODO: Currently the CI does not have a sm_80 capable machine. Enable the test
// execution once it does.
// RUNx: %t.out
// RUN: %t.out

//==--------- bfloat16_type_cuda.cpp - SYCL bfloat16 type test -------------==//
//
Expand All @@ -14,4 +12,13 @@

#include "bfloat16_type.hpp"

int main() { return run_tests(); }
int main() {
bool has_bfloat16_aspect = false;
for (const auto &plt : sycl::platform::get_platforms()) {
if (plt.has(aspect::ext_oneapi_bfloat16))
has_bfloat16_aspect = true;
}

if (has_bfloat16_aspect)
return run_tests();
}
3 changes: 3 additions & 0 deletions SYCL/Basic/aspects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ int main() {
if (plt.has(aspect::fp64)) {
std::cout << " fp64" << std::endl;
}
if (plt.has(aspect::ext_oneapi_bfloat16)) {
std::cout << " ext_oneapi_bfloat16" << std::endl;
}
if (plt.has(aspect::int64_base_atomics)) {
std::cout << " base atomic operations" << std::endl;
}
Expand Down