diff --git a/sycl/source/detail/builtins_relational.cpp b/sycl/source/detail/builtins_relational.cpp index e3abfef3caa96..8ae7ca1990689 100644 --- a/sycl/source/detail/builtins_relational.cpp +++ b/sycl/source/detail/builtins_relational.cpp @@ -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) diff --git a/sycl/test/regression/isordered.cpp b/sycl/test/regression/isordered.cpp new file mode 100644 index 0000000000000..0d34d3503ef1a --- /dev/null +++ b/sycl/test/regression/isordered.cpp @@ -0,0 +1,36 @@ +// RUN: %clangxx -fsycl %s -o %t.out +// RUN: env SYCL_DEVICE_TYPE=HOST %t.out + +#include + +int main() { + cl::sycl::range<1> ndRng(3); + int32_t kernelResult[3]; + cl::sycl::queue testQueue; + { + cl::sycl::buffer buffer(&kernelResult[0], ndRng); + testQueue.submit([&](cl::sycl::handler &h) { + auto resultPtr = + buffer.template get_access(h); + h.single_task([=]() { + 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; +} \ No newline at end of file