Skip to content

Commit 430f68d

Browse files
committed
[SYCL]Tests for double and half were added
Signed-off-by: mdimakov <[email protected]>
1 parent 8d44dfd commit 430f68d

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

sycl/test/regression/isordered.cpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,33 @@
44
#include <CL/sycl.hpp>
55

66
int main() {
7-
cl::sycl::range<1> ndRng(1);
8-
int32_t kernelResult;
7+
cl::sycl::range<1> ndRng(3);
8+
int32_t kernelResult[3];
99
cl::sycl::queue testQueue;
1010
{
11-
cl::sycl::buffer<int32_t, 1> buffer(&kernelResult, ndRng);
11+
cl::sycl::buffer<int32_t, 1> buffer(&kernelResult[0], ndRng);
1212
testQueue.submit([&](cl::sycl::handler &h) {
1313
auto resultPtr =
1414
buffer.template get_access<cl::sycl::access::mode::write>(h);
1515
h.single_task<class kernel>([=]() {
16-
float inputData_0(0.1);
17-
float inputData_1(0.5);
18-
resultPtr[0] = cl::sycl::isordered(inputData_0, inputData_1);
16+
float inputData_0F(0.1);
17+
float inputData_1F(0.5);
18+
resultPtr[0] = cl::sycl::isordered(inputData_0F, inputData_1F);
19+
20+
double inputData_0D(0.2);
21+
double inputData_1D(0.3);
22+
resultPtr[1] = cl::sycl::isordered(inputData_0D, inputData_1D);
23+
24+
half inputData_0H(0.3);
25+
half inputData_1H(0.9);
26+
resultPtr[2] = cl::sycl::isordered(inputData_0H, inputData_1H);
1927
});
2028
});
2129
}
2230
// Should be 1 according to spec since it's a scalar type not a vector
23-
std::cout << "Kernel result: " << std::to_string(kernelResult) << std::endl;
24-
assert(kernelResult == 1 && "Incorrect result");
31+
assert(kernelResult[0] == 1 && "Incorrect result");
32+
assert(kernelResult[1] == 1 && "Incorrect result");
33+
assert(kernelResult[2] == 1 && "Incorrect result");
2534

2635
return 0;
2736
}

0 commit comments

Comments
 (0)