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

Commit

Permalink
[SYCL][CUDA] Add SM version check to bfloat16 CUDA test (#1423)
Browse files Browse the repository at this point in the history
* [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 <steffen.larsen@intel.com>
  • Loading branch information
steffenlarsen authored Nov 29, 2022
1 parent 6ae6148 commit 80d18fc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
31 changes: 25 additions & 6 deletions SYCL/BFloat16/bfloat16_type.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// UNSUPPORTED: hip
// RUN: %if cuda %{%clangxx -fsycl -fsycl-targets=%sycl_triple -Xsycl-target-backend --cuda-gpu-arch=sm_80 %s -o %t.out %}
// TODO enable the below when CI supports >=sm_80
// RUNx: %if cuda %{%GPU_RUN_PLACEHOLDER %t.out %}
// RUN: %clangxx -fsycl %s -o %t.out
// 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 %}
// RUN: %if cuda %{%GPU_RUN_PLACEHOLDER %t.out %}
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
// TODO currently the feature isn't supported on FPGA.
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out
// RUNx: %ACC_RUN_PLACEHOLDER %t.out
//
// Not currently supported on HIP.
// UNSUPPORTED: hip

//==----------- bfloat16_type.cpp - SYCL bfloat16 type test ----------------==//
//
Expand All @@ -18,4 +19,22 @@

#include "bfloat16_type.hpp"

int main() { return run_tests(); }
int main() {

#ifdef USE_CUDA_SM80
// Special build for SM80 CUDA.
sycl::device Dev{default_selector_v};
if (Dev.get_platform().get_backend() != backend::ext_oneapi_cuda) {
std::cout << "Test skipped; CUDA run was not run with CUDA device."
<< std::endl;
return 0;
}
if (std::stof(Dev.get_info<sycl::info::device::backend_version>()) < 8.0f) {
std::cout << "Test skipped; CUDA device does not support SM80 or newer."
<< std::endl;
return 0;
}
#endif

return run_tests();
}
15 changes: 0 additions & 15 deletions SYCL/BFloat16/bfloat16_type_cuda.cpp

This file was deleted.

0 comments on commit 80d18fc

Please sign in to comment.