Skip to content

Commit 7fc3ac2

Browse files
[SYCL][E2E] Enable and fix UNSUPPORTED:windows tests (#15297)
This commit enables and fixes a number of tests that have previously been marked as UNSUPPORTED on Windows. --------- Signed-off-by: Larsen, Steffen <[email protected]>
1 parent cf2e781 commit 7fc3ac2

File tree

9 files changed

+90
-212
lines changed

9 files changed

+90
-212
lines changed

sycl/test-e2e/DeviceLib/built-ins/vector_relational.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// FIXME unsupported on windows (opencl and level-zero) until fix of libdevice
2-
// UNSUPPORTED: windows && (opencl || level_zero)
31
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
42
// RUN: %{build} -o %t.out %{mathflags}
53
// RUN: %{run} %t.out

sycl/test-e2e/DeviceLib/math_fp64_windows_test.cpp

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
// UNSUPPORTED: windows
2-
// Disabled on windows due to bug VS 2019 missing math builtins
1+
// REQUIRES: aspect-fp64, windows
32

4-
// REQUIRES: aspect-fp64
5-
// REQUIRES: (cpu || accelerator) && windows
6-
// RUN: %{build} -c -o %t.o
7-
// RUN: %clangxx -fsycl %t.o %sycl_libs_dir/../bin/libsycl-cmath-fp64.o -o %t.out
3+
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
4+
5+
// RUN: %{build} %{mathflags} -o %t.out
86
// RUN: %{run} %t.out
7+
8+
// RUN: %clangxx -fsycl -fsycl-device-lib-jit-link %{mathflags} %s -o %t.out
9+
// RUN: %if !gpu %{ %{run} %t.out %}
10+
911
#include "math_utils.hpp"
1012
#include <iostream>
1113
#include <math.h>
@@ -15,11 +17,11 @@ namespace s = sycl;
1517
constexpr s::access::mode sycl_read = s::access::mode::read;
1618
constexpr s::access::mode sycl_write = s::access::mode::write;
1719

18-
#define TEST_NUM 41
20+
#define TEST_NUM 38
1921

20-
double ref_val[TEST_NUM] = {1, 0, 0, 0, 0, 0, 0, 1, 1, 0.5, 0, 2, 0, 0,
21-
1, 0, 2, 0, 0, 0, 0, 0, 1, 0, 1, 2, 0, 1,
22-
2, 5, 0, 0, 0, 0, 0.5, 0.5, NAN, NAN, 1, 2, 0};
22+
double ref_val[TEST_NUM] = {1, 0, 0, 0, 0, 0, 0, 1, 1, 0.5, 0, 2, 0,
23+
0, 1, 0, 2, 0, 0, 0, 0, 0, 1, 0, 1, 2,
24+
0, 1, 2, 5, 0, 0, 0, 0, 0.5, 0.5, NAN, NAN};
2325

2426
double refIptr = 1;
2527

@@ -38,13 +40,13 @@ void device_math_test(s::queue &deviceQueue) {
3840
int quo = -1;
3941

4042
// Varaible enm stores the enum value retured by MSVC function
41-
short enm[2] = {10, 10};
43+
short enm = 10;
4244
{
4345
s::buffer<double, 1> buffer1(result, numOfItems);
4446
s::buffer<int, 1> buffer2(&exponent, s::range<1>{1});
4547
s::buffer<double, 1> buffer3(&iptr, s::range<1>{1});
4648
s::buffer<int, 1> buffer4(&quo, s::range<1>{1});
47-
s::buffer<short, 1> buffer5(enm, s::range<1>{2});
49+
s::buffer<short, 1> buffer5(&enm, s::range<1>{1});
4850
deviceQueue.submit([&](sycl::handler &cgh) {
4951
auto res_access = buffer1.template get_access<sycl_write>(cgh);
5052
auto exp_access = buffer2.template get_access<sycl_write>(cgh);
@@ -92,12 +94,7 @@ void device_math_test(s::queue &deviceQueue) {
9294
double a = NAN;
9395
res_access[i++] = tgamma(a);
9496
res_access[i++] = lgamma(a);
95-
enm_access[0] = _Dtest(&a);
96-
a = 0.0;
97-
enm_access[1] = _Exp(&a, 1.0, 0);
98-
res_access[i++] = a;
99-
res_access[i++] = _Cosh(0.0, 2.0);
100-
res_access[i++] = _Sinh(0.0, 1.0);
97+
enm_access[0] = _dtest(&a);
10198
});
10299
});
103100
}
@@ -117,10 +114,7 @@ void device_math_test(s::queue &deviceQueue) {
117114
assert(quo == 0);
118115

119116
// Test enum value returned by _Dtest
120-
assert(enm[0] == _NANCODE);
121-
122-
// Test enum value returned by _Exp
123-
assert(enm[1] == _FINITE);
117+
assert(enm == _NANCODE);
124118
}
125119

126120
int main() {

sycl/test-e2e/DeviceLib/math_override_test.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// UNSUPPORTED: windows
2-
// RUN: %clangxx -fsycl %s -Wno-error=unused-command-line-argument -o %t.out -fno-builtin
1+
// RUN: %clangxx -fsycl %s -Wno-error=unused-command-line-argument -Wno-error=inconsistent-dllimport -o %t.out -fno-builtin
32
#include <iostream>
43
#include <math.h>
54
#include <sycl/detail/core.hpp>

sycl/test-e2e/DeviceLib/math_test_marray_vec.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
22

3-
// TODO fix windows failures
4-
// UNSUPPORTED: windows && (level_zero || opencl)
53
// RUN: %{build} %{mathflags} -o %t.out
64
// RUN: %{run} %t.out
75

sycl/test-e2e/DeviceLib/math_windows_test.cpp

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
// UNSUPPORTED: windows
2-
// Disabled on windows due to bug VS 2019 missing math builtins
1+
// REQUIRES: windows
32

4-
// REQUIRES: (accelerator || cpu) && windows
5-
// RUN: %{build} -c -o %t.o
6-
// RUN: %clangxx -fsycl %t.o %sycl_libs_dir/../bin/libsycl-cmath.o -o %t.out
3+
// TODO: Add hypotf case back when the missing symbol is fixed.
4+
5+
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
6+
7+
// RUN: %{build} %{mathflags} -o %t.out
78
// RUN: %{run} %t.out
9+
10+
// RUN: %clangxx -fsycl -fsycl-device-lib-jit-link %{mathflags} %s -o %t.out
11+
// RUN: %if !gpu %{ %{run} %t.out %}
12+
813
#include "math_utils.hpp"
914
#include <iostream>
1015
#include <math.h>
@@ -14,11 +19,11 @@ namespace s = sycl;
1419
constexpr s::access::mode sycl_read = s::access::mode::read;
1520
constexpr s::access::mode sycl_write = s::access::mode::write;
1621

17-
#define TEST_NUM 39
22+
#define TEST_NUM 35
1823

19-
float ref_val[TEST_NUM] = {1, 0, 0, 0, 0, 0, 0, 1, 1, 0.5, 0, 0, 1,
20-
0, 2, 0, 0, 0, 0, 0, 1, 0, 1, 2, 0, 1,
21-
2, 5, 0, 0, 0, 0, 0.5, 0.5, NAN, NAN, 1, 2, 0};
24+
float ref_val[TEST_NUM] = {1, 0, 0, 0, 0, 0, 0, 1, 1, 0.5, 0, 0,
25+
1, 0, 2, 0, 0, 0, 0, 0, 1, 0, 1, 2,
26+
0, 1, 2, 0, 0, 0, 0, 0.5, 0.5, NAN, NAN};
2227

2328
float refIptr = 1;
2429

@@ -33,13 +38,13 @@ void device_math_test(s::queue &deviceQueue) {
3338
int quo = -1;
3439

3540
// Varaible enm stores the enum value retured by MSVC function
36-
short enm[2] = {10, 10};
41+
short enm = 10;
3742

3843
{
3944
s::buffer<float, 1> buffer1(result, numOfItems);
4045
s::buffer<float, 1> buffer2(&iptr, s::range<1>{1});
4146
s::buffer<int, 1> buffer3(&quo, s::range<1>{1});
42-
s::buffer<short, 1> buffer4(enm, s::range<1>{2});
47+
s::buffer<short, 1> buffer4(&enm, s::range<1>{1});
4348
deviceQueue.submit([&](sycl::handler &cgh) {
4449
auto res_access = buffer1.template get_access<sycl_write>(cgh);
4550
auto iptr_access = buffer2.template get_access<sycl_write>(cgh);
@@ -74,7 +79,6 @@ void device_math_test(s::queue &deviceQueue) {
7479
res_access[i++] = expm1f(0.0f);
7580
res_access[i++] = fdimf(1.0f, 0.0f);
7681
res_access[i++] = fmaf(1.0f, 1.0f, 1.0f);
77-
res_access[i++] = hypotf(3.0f, 4.0f);
7882
res_access[i++] = ilogbf(1.0f);
7983
res_access[i++] = log1pf(0.0f);
8084
res_access[i++] = log2f(1.0f);
@@ -84,12 +88,7 @@ void device_math_test(s::queue &deviceQueue) {
8488
float a = NAN;
8589
res_access[i++] = tgammaf(a);
8690
res_access[i++] = lgammaf(a);
87-
enm_access[0] = _FDtest(&a);
88-
a = 0.0f;
89-
enm_access[1] = _FExp(&a, 1.0f, 0);
90-
res_access[i++] = a;
91-
res_access[i++] = _FCosh(0.0f, 2.0f);
92-
res_access[i++] = _FSinh(0.0f, 1.0f);
91+
enm_access[0] = _fdtest(&a);
9392
});
9493
});
9594
}
@@ -106,10 +105,7 @@ void device_math_test(s::queue &deviceQueue) {
106105
assert(quo == 0);
107106

108107
// Test enum value returned by _FDtest
109-
assert(enm[0] == _NANCODE);
110-
111-
// Test enum value returned by _FExp
112-
assert(enm[1] == _FINITE);
108+
assert(enm == _NANCODE);
113109
}
114110

115111
int main() {

sycl/test-e2e/Printf/double.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
// [1]: https://en.cppreference.com/w/cpp/io/c/fprintf
66
//
77
// REQUIRES: aspect-fp64
8-
// Temporarily disable test on Windows due to regressions in GPU driver.
9-
// UNSUPPORTED: hip_amd, windows
8+
// UNSUPPORTED: hip_amd
109
//
1110
// RUN: %{build} -o %t.out
1211
// RUN: %{run} %t.out | FileCheck %s

0 commit comments

Comments
 (0)