diff --git a/sycl/test-e2e/Basic/built-ins/marray_relational.cpp b/sycl/test-e2e/Basic/built-ins/marray_relational.cpp index 3e874e8ac10dc..3b2f7ccaf990d 100644 --- a/sycl/test-e2e/Basic/built-ins/marray_relational.cpp +++ b/sycl/test-e2e/Basic/built-ins/marray_relational.cpp @@ -47,20 +47,52 @@ #define EXPECTED(TYPE, ...) ((TYPE[]){__VA_ARGS__}) int main() { - sycl::queue deviceQueue; + sycl::device Dev; + sycl::queue deviceQueue(Dev); - sycl::marray ma1{1.0, 2.0}; - sycl::marray ma2{1.0, 2.0}; - sycl::marray ma3{2.0, 1.0}; - sycl::marray ma4{2.0, 2.0}; - sycl::marray ma5{2.0, 2.0, 1.0}; - sycl::marray ma6{1.0, 5.0, 8.0}; + sycl::marray ma1_f16{1.f, 2.f}; + sycl::marray ma2_f16{1.f, 2.f}; + sycl::marray ma3_f16{2.f, 1.f}; + sycl::marray ma4_f16{2.f, 2.f}; + sycl::marray ma5_f16{2.f, 2.f, 1.f}; + sycl::marray ma6_f16{1.f, 5.f, 8.f}; + sycl::marray ma8_f16{1.f, 1.f}; + sycl::marray ma9_f16{0.5f, 0.5f}; + sycl::marray ma10_f16{2.f, 2.f}; + + sycl::marray ma1{1.f, 2.f}; + sycl::marray ma2{1.f, 2.f}; + sycl::marray ma3{2.f, 1.f}; + sycl::marray ma4{2.f, 2.f}; + sycl::marray ma5{2.f, 2.f, 1.f}; + sycl::marray ma6{1.f, 5.f, 8.f}; sycl::marray ma7{50, 2, 31}; - sycl::marray ma8{1.0, 1.0}; - sycl::marray ma9{0.5, 0.5}; - sycl::marray ma10{2.0, 2.0}; + sycl::marray ma8{1.f, 1.f}; + sycl::marray ma9{0.5f, 0.5f}; + sycl::marray ma10{2.f, 2.f}; sycl::marray c(1, 0, 1); + if (Dev.has(sycl::aspect::fp16)) { + TEST(sycl::isequal, bool, EXPECTED(bool, 1, 1), 2, ma1_f16, ma2_f16); + TEST(sycl::isnotequal, bool, EXPECTED(bool, 0, 0), 2, ma1_f16, ma2_f16); + TEST(sycl::isgreater, bool, EXPECTED(bool, 0, 1), 2, ma1_f16, ma3_f16); + TEST(sycl::isgreaterequal, bool, EXPECTED(bool, 0, 1), 2, ma1_f16, ma4_f16); + TEST(sycl::isless, bool, EXPECTED(bool, 0, 1), 2, ma3_f16, ma1_f16); + TEST(sycl::islessequal, bool, EXPECTED(bool, 0, 1), 2, ma4_f16, ma1_f16); + TEST(sycl::islessgreater, bool, EXPECTED(bool, 0, 0), 2, ma1_f16, ma2_f16); + TEST(sycl::isfinite, bool, EXPECTED(bool, 1, 1), 2, ma1_f16); + TEST(sycl::isinf, bool, EXPECTED(bool, 0, 0), 2, ma1_f16); + TEST(sycl::isnan, bool, EXPECTED(bool, 0, 0), 2, ma1_f16); + TEST(sycl::isnormal, bool, EXPECTED(bool, 1, 1), 2, ma1_f16); + TEST(sycl::isordered, bool, EXPECTED(bool, 1, 1), 2, ma1_f16, ma2_f16); + TEST(sycl::isunordered, bool, EXPECTED(bool, 0, 0), 2, ma1_f16, ma2_f16); + TEST(sycl::signbit, bool, EXPECTED(bool, 0, 0), 2, ma1_f16); + TEST(sycl::bitselect, sycl::half, EXPECTED(float, 1.0, 1.0), 2, ma8_f16, + ma9_f16, ma10_f16); + TEST(sycl::select, sycl::half, EXPECTED(float, 1.0, 2.0, 8.0), 3, ma5_f16, + ma6_f16, c); + } + TEST(sycl::isequal, bool, EXPECTED(bool, 1, 1), 2, ma1, ma2); TEST(sycl::isnotequal, bool, EXPECTED(bool, 0, 0), 2, ma1, ma2); TEST(sycl::isgreater, bool, EXPECTED(bool, 0, 1), 2, ma1, ma3);