4
4
#include < CL/sycl.hpp>
5
5
6
6
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 ] ;
9
9
cl::sycl::queue testQueue;
10
10
{
11
- cl::sycl::buffer<int32_t , 1 > buffer (&kernelResult, ndRng);
11
+ cl::sycl::buffer<int32_t , 1 > buffer (&kernelResult[ 0 ] , ndRng);
12
12
testQueue.submit ([&](cl::sycl::handler &h) {
13
13
auto resultPtr =
14
14
buffer.template get_access <cl::sycl::access::mode::write>(h);
15
15
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);
19
27
});
20
28
});
21
29
}
22
30
// 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" );
25
34
26
35
return 0 ;
27
36
}
0 commit comments