Skip to content

Commit 56d6e03

Browse files
committed
[SYCL][E2E] Fix some tests in multi-device mode
The atomic tests can be run by multiple SYCL devices, in which case the compiler needs to be told which device the `--cuda-gpu-arch` parameter applies to. The changes to the bfloat16 tests try and restore earlier behaviour, where the `aspect-ext_oneapi_bfloat16_math_functions` feature was preventing other devices from running. It also removes RUN lines from a shared header file (which we don't consider a valid test file) which may mislead people into thinking it itself is a runnable test.
1 parent b163134 commit 56d6e03

File tree

4 files changed

+3
-17
lines changed

4 files changed

+3
-17
lines changed

sycl/test-e2e/BFloat16/bfloat16_builtins.hpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,6 @@
44
// + sm_80 and above uses some native bfloat16 math instructions
55
// + below sm_80 always uses generic impls
66

7-
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
8-
// REQUIRES: aspect-ext_oneapi_bfloat16_math_functions
9-
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %if any-device-is-cuda %{ -Xsycl-target-backend --cuda-gpu-arch=sm_80 %} %s -o %t.out %{mathflags}
10-
// RUN: %{run} %t.out
11-
12-
// Test "new" (ABI breaking) for all platforms ( sm_80/native if CUDA )
13-
// RUN: %if preview-breaking-changes-supported %{ %clangxx -fsycl -fpreview-breaking-changes -fsycl-targets=%{sycl_triple} %if any-device-is-cuda %{ -Xsycl-target-backend --cuda-gpu-arch=sm_80 %} %s -o %t2.out %{mathflags} %}
14-
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}
15-
16-
// If CUDA, test "new" again for sm_75/generic
17-
// RUN: %if any-device-is-cuda %{ %if preview-breaking-changes-supported %{ %clangxx -fsycl -fpreview-breaking-changes -fsycl-targets=%{sycl_triple} -Xsycl-target-backend --cuda-gpu-arch=sm_75 %s -o %t3.out %{mathflags} %} %}
18-
// RUN: %if any-device-is-cuda %{ %if preview-breaking-changes-supported %{ %{run} %t3.out %} %}
19-
20-
// Currently the feature isn't supported on FPGA.
21-
// UNSUPPORTED: accelerator
227
#include <sycl/sycl.hpp>
238

249
#include <cmath>

sycl/test-e2e/BFloat16/bfloat16_builtins_cuda_generic.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// + below sm_80 always uses generic impls
66

77
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
8+
// REQUIRES: aspect-ext_oneapi_bfloat16_math_functions
89

910
// If CUDA, test "new" again for sm_75/generic
1011
// RUN: %if any-device-is-cuda %{ %if preview-breaking-changes-supported %{ %clangxx -fsycl -fpreview-breaking-changes -fsycl-targets=%{sycl_triple} -Xsycl-target-backend --cuda-gpu-arch=sm_75 %s -o %t3.out %{mathflags} %} %}

sycl/test-e2e/syclcompat/atomic/atomic_class.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
// UNSUPPORTED: hip || (windows && level_zero)
3434

35-
// RUN: %clangxx -std=c++20 -fsycl -fsycl-targets=%{sycl_triple} %if any-device-is-cuda %{ -Xsycl-target-backend --cuda-gpu-arch=sm_70 %} %s -o %t.out
35+
// RUN: %clangxx -std=c++20 -fsycl -fsycl-targets=%{sycl_triple} %if any-device-is-cuda %{ -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_70 %} %s -o %t.out
3636
// RUN: %{run} %t.out
3737

3838
#include <sycl/sycl.hpp>

sycl/test-e2e/syclcompat/atomic/atomic_memory_acq_rel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
// UNSUPPORTED: hip
3434

35-
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %if any-device-is-cuda %{ -Xsycl-target-backend --cuda-gpu-arch=sm_70 %} %s -o %t.out
35+
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %if any-device-is-cuda %{ -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_70 %} %s -o %t.out
3636
// RUN: %{run} %t.out
3737

3838
#include <iostream>

0 commit comments

Comments
 (0)