Skip to content

Commit 004bfb1

Browse files
[SYCL][NFC] Drop Gen9 detection from E2E tests (#14452)
Gen9 HW is not officially supported anymore by our product, we don't have such machines in our CI and therefore it doesn't make sense to keep those legacy LIT features and their usage. --------- Signed-off-by: Sachkov, Alexey <[email protected]> Co-authored-by: Steffen Larsen <[email protected]>
1 parent 3e98b3a commit 004bfb1

13 files changed

+110
-565
lines changed
Lines changed: 4 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,15 @@
11
///
2-
/// Check if bfloat16 example works using fallback libraries
2+
/// Checks a simple case of bfloat16, also employed for AOT library fallback.
33
///
44

5-
// REQUIRES: opencl-aot, ocloc, gpu-intel-gen9
6-
75
// CUDA is not compatible with SPIR.
86
// UNSUPPORTED: cuda
97

108
// RUN: %clangxx -fsycl %s -o %t.out
119
// RUN: %{run} %t.out
1210

13-
// RUN: %clangxx -fsycl -fsycl-targets=spir64 %s -o %t.out
14-
// RUN: %{run} %t.out
15-
16-
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend "-device gen9" %s -o %t.out
17-
// RUN: %{run} %t.out
18-
19-
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend "-device *" %s -o %t.out
20-
// RUN: %if gpu %{ %{run} %t.out %}
21-
22-
// RUN: %clangxx -fsycl -fsycl-targets=spir64,spir64_gen -Xsycl-target-backend=spir64_gen "-device gen9" %s -o %t.out
23-
// RUN: %{run} %t.out
24-
25-
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_gen -Xsycl-target-backend=spir64_gen "-device gen9" %s -o %t.out
26-
// RUN: %{run} %t.out
27-
28-
// RUN: %clangxx -fsycl -fsycl-targets=spir64,spir64_gen -Xsycl-target-backend=spir64_gen "-device pvc" %s -o %t.out
29-
// RUN: %if cpu %{ %{run} %t.out %}
30-
31-
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_gen -Xsycl-target-backend=spir64_gen "-device pvc" %s -o %t.out
32-
// RUN: %if cpu %{ %{run} %t.out %}
33-
34-
#include <sycl/detail/core.hpp>
35-
#include <sycl/ext/oneapi/bfloat16.hpp>
36-
37-
using namespace sycl;
38-
using sycl::ext::oneapi::bfloat16;
39-
40-
float foo(float a, float b) {
41-
// Convert from float to bfloat16.
42-
bfloat16 A{a};
43-
bfloat16 B{b};
44-
45-
// Convert A and B from bfloat16 to float, do addition on floating-point
46-
// numbers, then convert the result to bfloat16 and store it in C.
47-
bfloat16 C = A + B;
48-
49-
// Return the result converted from bfloat16 to float.
50-
return C;
51-
}
52-
53-
int main(int argc, char *argv[]) {
54-
float data[3] = {7.0f, 8.1f, 0.0f};
55-
56-
float result_host = foo(7.0f, 8.1f);
57-
std::cout << "CPU Result = " << result_host << std::endl;
58-
if (std::abs(15.1f - result_host) > 0.1f) {
59-
std::cout << "Test failed. Expected CPU Result ~= 15.1" << std::endl;
60-
return 1;
61-
}
62-
63-
queue deviceQueue;
64-
buffer<float, 1> buf{data, 3};
65-
66-
deviceQueue.submit([&](handler &cgh) {
67-
accessor numbers{buf, cgh, read_write};
68-
cgh.single_task([=]() { numbers[2] = foo(numbers[0], numbers[1]); });
69-
});
70-
71-
host_accessor hostOutAcc{buf, read_only};
72-
float result_device = hostOutAcc[2];
73-
std::cout << "GPU Result = " << result_device << std::endl;
74-
if (std::abs(result_host - result_device) > 0.1f) {
75-
std::cout << "Test failed. CPU Result !~= GPU result" << std::endl;
76-
return 1;
77-
}
11+
#include "bfloat16_example.hpp"
7812

79-
return 0;
13+
int main() {
14+
return runTest();
8015
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#include <sycl/detail/core.hpp>
2+
#include <sycl/ext/oneapi/bfloat16.hpp>
3+
4+
using namespace sycl;
5+
using sycl::ext::oneapi::bfloat16;
6+
7+
float foo(float a, float b) {
8+
// Convert from float to bfloat16.
9+
bfloat16 A{a};
10+
bfloat16 B{b};
11+
12+
// Convert A and B from bfloat16 to float, do addition on floating-point
13+
// numbers, then convert the result to bfloat16 and store it in C.
14+
bfloat16 C = A + B;
15+
16+
// Return the result converted from bfloat16 to float.
17+
return C;
18+
}
19+
20+
int runTest() {
21+
float data[3] = {7.0f, 8.1f, 0.0f};
22+
23+
float result_host = foo(7.0f, 8.1f);
24+
std::cout << "Host Result = " << result_host << std::endl;
25+
if (std::abs(15.1f - result_host) > 0.1f) {
26+
std::cout << "Test failed. Expected Host Result ~= 15.1" << std::endl;
27+
return 1;
28+
}
29+
30+
queue deviceQueue;
31+
buffer<float, 1> buf{data, 3};
32+
33+
deviceQueue.submit([&](handler &cgh) {
34+
accessor numbers{buf, cgh, read_write};
35+
cgh.single_task([=]() { numbers[2] = foo(numbers[0], numbers[1]); });
36+
});
37+
38+
host_accessor hostOutAcc{buf, read_only};
39+
float result_device = hostOutAcc[2];
40+
std::cout << "Device Result = " << result_device << std::endl;
41+
if (std::abs(result_host - result_device) > 0.1f) {
42+
std::cout << "Test failed. Host Result !~= Device result" << std::endl;
43+
return 1;
44+
}
45+
46+
return 0;
47+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
///
2+
/// Check if bfloat16 example works using fallback libraries AOT compiled for
3+
/// both GPU and CPU.
4+
///
5+
6+
// REQUIRES: opencl-aot, ocloc, gpu-intel-gen12, any-device-is-cpu
7+
8+
// RUN: %clangxx -fsycl -fsycl-targets=spir64 %s -o %t.out
9+
// RUN: %{run} %t.out
10+
11+
// RUN: %clangxx -fsycl -fsycl-targets=spir64,spir64_gen -Xsycl-target-backend=spir64_gen "-device gen12lp" %s -o %t.out
12+
// RUN: %{run} %t.out
13+
14+
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_gen -Xsycl-target-backend=spir64_gen "-device gen12lp" %s -o %t.out
15+
// RUN: %{run} %t.out
16+
17+
#include "bfloat16_example.hpp"
18+
19+
int main() {
20+
return runTest();
21+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
///
2+
/// Check if bfloat16 example works using fallback libraries AOT compiled for
3+
/// CPU.
4+
///
5+
6+
// REQUIRES: opencl-aot, ocloc, gpu-intel-gen12, any-device-is-cpu
7+
8+
// RUN: %clangxx -fsycl -fsycl-targets=spir64,spir64_gen -Xsycl-target-backend=spir64_gen "-device dg1" %s -o %t.out
9+
// RUN: %if cpu %{ %{run} %t.out %}
10+
11+
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_gen -Xsycl-target-backend=spir64_gen "-device dg1" %s -o %t.out
12+
// RUN: %if cpu %{ %{run} %t.out %}
13+
14+
#include "bfloat16_example.hpp"
15+
16+
int main() {
17+
return runTest();
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
///
2+
/// Check if bfloat16 example works using fallback libraries AOT compiled for
3+
/// GPU.
4+
///
5+
6+
// REQUIRES: opencl-aot, ocloc, gpu-intel-gen12, any-device-is-gpu
7+
8+
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend "-device gen12lp" %s -o %t.out
9+
// RUN: %if gpu %{%{run} %t.out %}
10+
11+
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend "-device *" %s -o %t.out
12+
// RUN: %if gpu %{%{run} %t.out %}
13+
14+
#include "bfloat16_example.hpp"
15+
16+
int main() {
17+
return runTest();
18+
}

sycl/test-e2e/ESIMD/ext_math_ieee_sqrt_div.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8-
// REQUIRES: gpu-intel-gen9 || arch-intel_gpu_pvc
8+
// REQUIRES: arch-intel_gpu_pvc
99

1010
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
1111
// RUN: %{build} -fsycl-device-code-split=per_kernel %{mathflags} -o %t.out

0 commit comments

Comments
 (0)