Skip to content

Commit 13789eb

Browse files
committed
[SYCL]Regression test for isordered function was added
Signed-off-by: mdimakov <[email protected]>
1 parent df07886 commit 13789eb

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

sycl/test/regression/isordered.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <CL/sycl.hpp>
2+
3+
int main() {
4+
cl::sycl::range<1> ndRng(1);
5+
int32_t kernelResult;
6+
cl::sycl::queue testQueue;
7+
{
8+
cl::sycl::buffer<int32_t, 1> buffer(&kernelResult, ndRng);
9+
testQueue.submit([&](cl::sycl::handler &h) {
10+
auto resultPtr = buffer.template get_access<cl::sycl::access::mode::write>(h);
11+
h.single_task<class kernel>([=]() {
12+
float inputData_0(0.1);
13+
float inputData_1(0.5);
14+
resultPtr[0] = cl::sycl::isordered(inputData_0,inputData_1);
15+
});
16+
});
17+
}
18+
// Should be 1 according to spec since it's a scalar type not a vector
19+
std::cout << "Kernel result: " << std::to_string(kernelResult) << std::endl;
20+
assert(kernelResult == 1 && "Incorrect result");
21+
22+
return 0;
23+
}

0 commit comments

Comments
 (0)