Skip to content
Merged
6 changes: 3 additions & 3 deletions sycl/source/detail/builtins_relational.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,13 @@ MAKE_1V_FUNC(IsNormal, __vIsNormal, s::cl_short, s::cl_half)

// (Ordered) // isordered
__SYCL_EXPORT s::cl_int Ordered(s::cl_float x, s::cl_float y) __NOEXC {
return __vOrdered(x, y);
return __sOrdered(x, y);
}
__SYCL_EXPORT s::cl_int Ordered(s::cl_double x, s::cl_double y) __NOEXC {
return __vOrdered(x, y);
return __sOrdered(x, y);
}
__SYCL_EXPORT s::cl_int Ordered(s::cl_half x, s::cl_half y) __NOEXC {
return __vOrdered(x, y);
return __sOrdered(x, y);
}
MAKE_1V_2V_FUNC(Ordered, __vOrdered, s::cl_int, s::cl_float, s::cl_float)
MAKE_1V_2V_FUNC(Ordered, __vOrdered, s::cl_long, s::cl_double, s::cl_double)
Expand Down
36 changes: 36 additions & 0 deletions sycl/test/regression/isordered.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// RUN: %clangxx -fsycl %s -o %t.out
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out

#include <CL/sycl.hpp>

int main() {
cl::sycl::range<1> ndRng(3);
int32_t kernelResult[3];
cl::sycl::queue testQueue;
{
cl::sycl::buffer<int32_t, 1> buffer(&kernelResult[0], ndRng);
testQueue.submit([&](cl::sycl::handler &h) {
auto resultPtr =
buffer.template get_access<cl::sycl::access::mode::write>(h);
h.single_task<class kernel>([=]() {
float inputData_0F(0.1);
float inputData_1F(0.5);
resultPtr[0] = cl::sycl::isordered(inputData_0F, inputData_1F);

double inputData_0D(0.2);
double inputData_1D(0.3);
resultPtr[1] = cl::sycl::isordered(inputData_0D, inputData_1D);

half inputData_0H(0.3);
half inputData_1H(0.9);
resultPtr[2] = cl::sycl::isordered(inputData_0H, inputData_1H);
});
});
}
// Should be 1 according to spec since it's a scalar type not a vector
assert(kernelResult[0] == 1 && "Incorrect result");
assert(kernelResult[1] == 1 && "Incorrect result");
assert(kernelResult[2] == 1 && "Incorrect result");

return 0;
}