From bc939bd83466c6cb0c7ac2ba2095c127327e44a7 Mon Sep 17 00:00:00 2001 From: Lorenc Bushi Date: Thu, 16 May 2024 07:36:56 -0700 Subject: [PATCH 01/27] Fix bug in forward_progress extension --- sycl/source/detail/device_impl.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/sycl/source/detail/device_impl.cpp b/sycl/source/detail/device_impl.cpp index 6d2a8d08736f7..9b2a756f4074f 100644 --- a/sycl/source/detail/device_impl.cpp +++ b/sycl/source/detail/device_impl.cpp @@ -868,8 +868,10 @@ bool device_impl::extOneapiCanCompile( // coordinationScope sycl::ext::oneapi::experimental::forward_progress_guarantee device_impl::getHostProgressGuarantee( - ext::oneapi::experimental::execution_scope, - ext::oneapi::experimental::execution_scope) { + ext::oneapi::experimental::execution_scope threadScope, + ext::oneapi::experimental::execution_scope coordinationScope) { + std::ignore = threadScope; + std::ignore = coordinationScope; return sycl::ext::oneapi::experimental::forward_progress_guarantee:: weakly_parallel; } @@ -884,17 +886,16 @@ device_impl::getProgressGuarantee( using forward_progress_guarantee = ext::oneapi::experimental::forward_progress_guarantee; using execution_scope = ext::oneapi::experimental::execution_scope; - const int executionScopeSize = 4; - (void)coordinationScope; int threadScopeNum = static_cast(threadScope); // we get the immediate progress guarantee that is provided by each scope - // between root_group and threadScope and then return the weakest of these. - // Counterintuitively, this corresponds to taking the max of the enum values - // because of how the forward_progress_guarantee enum values are declared. - int guaranteeNum = static_cast( - getImmediateProgressGuarantee(execution_scope::root_group)); - for (int currentScope = executionScopeSize - 2; currentScope > threadScopeNum; - --currentScope) { + // between coordinationScope and threadScope and return the weakest of + // these. Counterintuitively, this corresponds to taking the max of the enum + // values because of how the forward_progress_guarantee enum values are + // declared. + int guaranteeNum = + static_cast(getImmediateProgressGuarantee(coordinationScope)); + for (int currentScope = static_cast(coordinationScope) - 1; + currentScope > threadScopeNum; --currentScope) { guaranteeNum = std::max(guaranteeNum, static_cast(getImmediateProgressGuarantee( static_cast(currentScope)))); From 1c21400c4149acbcee0c563801e0ed3fdc78442a Mon Sep 17 00:00:00 2001 From: Lorenc Bushi Date: Fri, 24 May 2024 14:25:04 -0700 Subject: [PATCH 02/27] Empty --- sycl/unittests/Extensions/OneAPIProd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/unittests/Extensions/OneAPIProd.cpp b/sycl/unittests/Extensions/OneAPIProd.cpp index 732c71dc86f8b..e8d9a0f9ca06a 100644 --- a/sycl/unittests/Extensions/OneAPIProd.cpp +++ b/sycl/unittests/Extensions/OneAPIProd.cpp @@ -28,7 +28,7 @@ TEST(OneAPIProdTest, PiQueueFlush) { context Ctx{Plt}; queue Queue{Ctx, default_selector_v}; Queue.ext_oneapi_prod(); - EXPECT_TRUE(QueueFlushed); + EXPECT_TRUE(!QueueFlushed); sycl::ext::oneapi::experimental::command_graph Graph(Ctx, Queue.get_device()); Graph.begin_recording(Queue); try { From 6d42c93cdb6f1dbec6e11f029ef95b83cbeea118 Mon Sep 17 00:00:00 2001 From: Lorenc Bushi Date: Wed, 19 Jun 2024 23:08:20 -0700 Subject: [PATCH 03/27] Fix buffer consistency bug in built in marray test --- sycl/test-e2e/Basic/built-ins/helpers.hpp | 31 ++++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/sycl/test-e2e/Basic/built-ins/helpers.hpp b/sycl/test-e2e/Basic/built-ins/helpers.hpp index 03a7c720e9afd..8ad594986dc06 100644 --- a/sycl/test-e2e/Basic/built-ins/helpers.hpp +++ b/sycl/test-e2e/Basic/built-ins/helpers.hpp @@ -30,29 +30,30 @@ void test(bool CheckDevice, double delta, FuncTy F, ExpectedTy Expected, if (!CheckDevice) return; + bool result; + { + sycl::buffer SuccessBuf{&result, sycl::range<1>{}}; - sycl::buffer SuccessBuf{1}; - - // Make sure we don't use fp64 on devices that don't support it. - sycl::detail::get_elem_type_t d(delta); - - sycl::queue{}.submit([&](sycl::handler &cgh) { - sycl::accessor Success{SuccessBuf, cgh}; - cgh.single_task([=]() { - auto R = F(Args...); - static_assert(std::is_same_v); - Success[0] = equal(R, Expected, d); + // Make sure we don't use fp64 on devices that don't support it. + sycl::detail::get_elem_type_t d(delta); + sycl::queue q; + q.submit([&](sycl::handler &cgh) { + sycl::accessor Success{SuccessBuf, cgh}; + cgh.single_task([=]() { + auto R = F(Args...); + static_assert(std::is_same_v); + Success[0] = equal(R, Expected, d); + }); }); - }); - assert(sycl::host_accessor{SuccessBuf}[0]); + } // SuccessBuf writes back data to host pointer on destruction + assert(result); } template void test(FuncTy F, ExpectedTy Expected, ArgTys... Args) { test(true /*CheckDevice*/, 0.0 /*delta*/, F, Expected, Args...); } -template +template void test(bool CheckDevice, FuncTy F, ExpectedTy Expected, ArgTys... Args) { test(CheckDevice, 0.0 /*delta*/, F, Expected, Args...); } From aa8772d6b4a31b6eb18754e26385c35bac11b710 Mon Sep 17 00:00:00 2001 From: Lorenc Bushi Date: Wed, 19 Jun 2024 23:24:00 -0700 Subject: [PATCH 04/27] Remove rogue changes --- sycl/source/detail/device_impl.cpp | 31 +++++++++--------------- sycl/unittests/Extensions/OneAPIProd.cpp | 2 +- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/sycl/source/detail/device_impl.cpp b/sycl/source/detail/device_impl.cpp index 9b2a756f4074f..532cffe22500f 100644 --- a/sycl/source/detail/device_impl.cpp +++ b/sycl/source/detail/device_impl.cpp @@ -741,14 +741,6 @@ bool device_impl::has(aspect Aspect) const { return be == sycl::backend::ext_oneapi_level_zero || be == sycl::backend::opencl; } - case aspect::ext_oneapi_queue_profiling_tag: { - pi_bool support = PI_FALSE; - bool call_successful = - getPlugin()->call_nocheck( - MDevice, PI_EXT_ONEAPI_DEVICE_INFO_TIMESTAMP_RECORDING_SUPPORT, - sizeof(pi_bool), &support, nullptr) == PI_SUCCESS; - return call_successful && support; - } } throw runtime_error("This device aspect has not been implemented yet.", PI_ERROR_INVALID_DEVICE); @@ -868,10 +860,8 @@ bool device_impl::extOneapiCanCompile( // coordinationScope sycl::ext::oneapi::experimental::forward_progress_guarantee device_impl::getHostProgressGuarantee( - ext::oneapi::experimental::execution_scope threadScope, - ext::oneapi::experimental::execution_scope coordinationScope) { - std::ignore = threadScope; - std::ignore = coordinationScope; + ext::oneapi::experimental::execution_scope, + ext::oneapi::experimental::execution_scope) { return sycl::ext::oneapi::experimental::forward_progress_guarantee:: weakly_parallel; } @@ -886,16 +876,17 @@ device_impl::getProgressGuarantee( using forward_progress_guarantee = ext::oneapi::experimental::forward_progress_guarantee; using execution_scope = ext::oneapi::experimental::execution_scope; + const int executionScopeSize = 4; + (void)coordinationScope; int threadScopeNum = static_cast(threadScope); // we get the immediate progress guarantee that is provided by each scope - // between coordinationScope and threadScope and return the weakest of - // these. Counterintuitively, this corresponds to taking the max of the enum - // values because of how the forward_progress_guarantee enum values are - // declared. - int guaranteeNum = - static_cast(getImmediateProgressGuarantee(coordinationScope)); - for (int currentScope = static_cast(coordinationScope) - 1; - currentScope > threadScopeNum; --currentScope) { + // between root_group and threadScope and then return the weakest of these. + // Counterintuitively, this corresponds to taking the max of the enum values + // because of how the forward_progress_guarantee enum values are declared. + int guaranteeNum = static_cast( + getImmediateProgressGuarantee(execution_scope::root_group)); + for (int currentScope = executionScopeSize - 2; currentScope > threadScopeNum; + --currentScope) { guaranteeNum = std::max(guaranteeNum, static_cast(getImmediateProgressGuarantee( static_cast(currentScope)))); diff --git a/sycl/unittests/Extensions/OneAPIProd.cpp b/sycl/unittests/Extensions/OneAPIProd.cpp index e8d9a0f9ca06a..732c71dc86f8b 100644 --- a/sycl/unittests/Extensions/OneAPIProd.cpp +++ b/sycl/unittests/Extensions/OneAPIProd.cpp @@ -28,7 +28,7 @@ TEST(OneAPIProdTest, PiQueueFlush) { context Ctx{Plt}; queue Queue{Ctx, default_selector_v}; Queue.ext_oneapi_prod(); - EXPECT_TRUE(!QueueFlushed); + EXPECT_TRUE(QueueFlushed); sycl::ext::oneapi::experimental::command_graph Graph(Ctx, Queue.get_device()); Graph.begin_recording(Queue); try { From 5d9f6e1582350175ab87e230dc2524115c73a073 Mon Sep 17 00:00:00 2001 From: Lorenc Bushi Date: Wed, 19 Jun 2024 23:25:14 -0700 Subject: [PATCH 05/27] Remove rogue changes --- sycl/source/detail/device_impl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sycl/source/detail/device_impl.cpp b/sycl/source/detail/device_impl.cpp index 532cffe22500f..6d2a8d08736f7 100644 --- a/sycl/source/detail/device_impl.cpp +++ b/sycl/source/detail/device_impl.cpp @@ -741,6 +741,14 @@ bool device_impl::has(aspect Aspect) const { return be == sycl::backend::ext_oneapi_level_zero || be == sycl::backend::opencl; } + case aspect::ext_oneapi_queue_profiling_tag: { + pi_bool support = PI_FALSE; + bool call_successful = + getPlugin()->call_nocheck( + MDevice, PI_EXT_ONEAPI_DEVICE_INFO_TIMESTAMP_RECORDING_SUPPORT, + sizeof(pi_bool), &support, nullptr) == PI_SUCCESS; + return call_successful && support; + } } throw runtime_error("This device aspect has not been implemented yet.", PI_ERROR_INVALID_DEVICE); From 75133ad213592fa325900904b22364db8be22a7a Mon Sep 17 00:00:00 2001 From: Lorenc Bushi <113361374+lbushi25@users.noreply.github.com> Date: Thu, 20 Jun 2024 02:52:45 -0400 Subject: [PATCH 06/27] Update helpers.hpp --- sycl/test-e2e/Basic/built-ins/helpers.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/Basic/built-ins/helpers.hpp b/sycl/test-e2e/Basic/built-ins/helpers.hpp index 8ad594986dc06..f2e965dd27987 100644 --- a/sycl/test-e2e/Basic/built-ins/helpers.hpp +++ b/sycl/test-e2e/Basic/built-ins/helpers.hpp @@ -32,7 +32,7 @@ void test(bool CheckDevice, double delta, FuncTy F, ExpectedTy Expected, return; bool result; { - sycl::buffer SuccessBuf{&result, sycl::range<1>{}}; + sycl::buffer SuccessBuf{&result, sycl::range<1>{1}}; // Make sure we don't use fp64 on devices that don't support it. sycl::detail::get_elem_type_t d(delta); From b9374d86bee6da2a44cbafa3fd7ee1760ca9e3f0 Mon Sep 17 00:00:00 2001 From: Lorenc Bushi Date: Wed, 26 Jun 2024 09:21:13 -0700 Subject: [PATCH 07/27] Upscale error tolerance to double in marray tests helper file --- sycl/test-e2e/Basic/built-ins/helpers.hpp | 30 +++++++++++------------ 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/sycl/test-e2e/Basic/built-ins/helpers.hpp b/sycl/test-e2e/Basic/built-ins/helpers.hpp index f2e965dd27987..71a03ae358446 100644 --- a/sycl/test-e2e/Basic/built-ins/helpers.hpp +++ b/sycl/test-e2e/Basic/built-ins/helpers.hpp @@ -30,30 +30,28 @@ void test(bool CheckDevice, double delta, FuncTy F, ExpectedTy Expected, if (!CheckDevice) return; - bool result; - { - sycl::buffer SuccessBuf{&result, sycl::range<1>{1}}; + sycl::buffer SuccessBuf{1}; - // Make sure we don't use fp64 on devices that don't support it. - sycl::detail::get_elem_type_t d(delta); - sycl::queue q; - q.submit([&](sycl::handler &cgh) { - sycl::accessor Success{SuccessBuf, cgh}; - cgh.single_task([=]() { - auto R = F(Args...); - static_assert(std::is_same_v); - Success[0] = equal(R, Expected, d); - }); + // Make sure we don't use fp64 on devices that don't support it. + sycl::context ctx; + sycl::queue q{ ctx, ctx.get_devices()[0] }; + q.submit([&](sycl::handler &cgh) { + sycl::accessor Success{SuccessBuf, cgh}; + cgh.single_task([=]() { + auto R = F(Args...); + static_assert(std::is_same_v); + Success[0] = equal(R, Expected, delta); }); - } // SuccessBuf writes back data to host pointer on destruction - assert(result); + }); + assert(sycl::host_accessor{SuccessBuf}[0]); } template void test(FuncTy F, ExpectedTy Expected, ArgTys... Args) { test(true /*CheckDevice*/, 0.0 /*delta*/, F, Expected, Args...); } -template +template void test(bool CheckDevice, FuncTy F, ExpectedTy Expected, ArgTys... Args) { test(CheckDevice, 0.0 /*delta*/, F, Expected, Args...); } From fd699f4425e81024998c9fa4dff5b63ff8c328a9 Mon Sep 17 00:00:00 2001 From: Lorenc Bushi Date: Wed, 26 Jun 2024 09:26:07 -0700 Subject: [PATCH 08/27] Apply formatter --- sycl/test-e2e/Basic/built-ins/helpers.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sycl/test-e2e/Basic/built-ins/helpers.hpp b/sycl/test-e2e/Basic/built-ins/helpers.hpp index 71a03ae358446..678192224599d 100644 --- a/sycl/test-e2e/Basic/built-ins/helpers.hpp +++ b/sycl/test-e2e/Basic/built-ins/helpers.hpp @@ -30,11 +30,12 @@ void test(bool CheckDevice, double delta, FuncTy F, ExpectedTy Expected, if (!CheckDevice) return; + sycl::buffer SuccessBuf{1}; // Make sure we don't use fp64 on devices that don't support it. sycl::context ctx; - sycl::queue q{ ctx, ctx.get_devices()[0] }; + sycl::queue q{ctx, ctx.get_devices()[0]}; q.submit([&](sycl::handler &cgh) { sycl::accessor Success{SuccessBuf, cgh}; cgh.single_task([=]() { @@ -50,8 +51,7 @@ template void test(FuncTy F, ExpectedTy Expected, ArgTys... Args) { test(true /*CheckDevice*/, 0.0 /*delta*/, F, Expected, Args...); } -template +template void test(bool CheckDevice, FuncTy F, ExpectedTy Expected, ArgTys... Args) { test(CheckDevice, 0.0 /*delta*/, F, Expected, Args...); } From 29ad244648df7fae4c5c511e5c4ce9c8cfab482f Mon Sep 17 00:00:00 2001 From: Lorenc Bushi <113361374+lbushi25@users.noreply.github.com> Date: Wed, 26 Jun 2024 15:33:34 -0400 Subject: [PATCH 09/27] Update helpers.hpp --- sycl/test-e2e/Basic/built-ins/helpers.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sycl/test-e2e/Basic/built-ins/helpers.hpp b/sycl/test-e2e/Basic/built-ins/helpers.hpp index 678192224599d..ad0b8180ef909 100644 --- a/sycl/test-e2e/Basic/built-ins/helpers.hpp +++ b/sycl/test-e2e/Basic/built-ins/helpers.hpp @@ -34,8 +34,7 @@ void test(bool CheckDevice, double delta, FuncTy F, ExpectedTy Expected, sycl::buffer SuccessBuf{1}; // Make sure we don't use fp64 on devices that don't support it. - sycl::context ctx; - sycl::queue q{ctx, ctx.get_devices()[0]}; + sycl::queue q; q.submit([&](sycl::handler &cgh) { sycl::accessor Success{SuccessBuf, cgh}; cgh.single_task([=]() { From 3661d3ba940071f8cb58d9549289ab420cb2177c Mon Sep 17 00:00:00 2001 From: Lorenc Bushi <113361374+lbushi25@users.noreply.github.com> Date: Wed, 26 Jun 2024 16:15:55 -0400 Subject: [PATCH 10/27] Update helpers.hpp --- sycl/test-e2e/Basic/built-ins/helpers.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sycl/test-e2e/Basic/built-ins/helpers.hpp b/sycl/test-e2e/Basic/built-ins/helpers.hpp index ad0b8180ef909..da773ad5a04f7 100644 --- a/sycl/test-e2e/Basic/built-ins/helpers.hpp +++ b/sycl/test-e2e/Basic/built-ins/helpers.hpp @@ -50,7 +50,8 @@ template void test(FuncTy F, ExpectedTy Expected, ArgTys... Args) { test(true /*CheckDevice*/, 0.0 /*delta*/, F, Expected, Args...); } -template +template void test(bool CheckDevice, FuncTy F, ExpectedTy Expected, ArgTys... Args) { test(CheckDevice, 0.0 /*delta*/, F, Expected, Args...); } From 6fa0fa6c5278ee101c07b140b5e613786b107a51 Mon Sep 17 00:00:00 2001 From: Lorenc Bushi <113361374+lbushi25@users.noreply.github.com> Date: Wed, 26 Jun 2024 16:16:54 -0400 Subject: [PATCH 11/27] Update helpers.hpp --- sycl/test-e2e/Basic/built-ins/helpers.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/Basic/built-ins/helpers.hpp b/sycl/test-e2e/Basic/built-ins/helpers.hpp index da773ad5a04f7..c9871538ad480 100644 --- a/sycl/test-e2e/Basic/built-ins/helpers.hpp +++ b/sycl/test-e2e/Basic/built-ins/helpers.hpp @@ -50,7 +50,7 @@ template void test(FuncTy F, ExpectedTy Expected, ArgTys... Args) { test(true /*CheckDevice*/, 0.0 /*delta*/, F, Expected, Args...); } -template void test(bool CheckDevice, FuncTy F, ExpectedTy Expected, ArgTys... Args) { test(CheckDevice, 0.0 /*delta*/, F, Expected, Args...); From d6b8a5a8b0afae41ad058fa2df6d46608bb37169 Mon Sep 17 00:00:00 2001 From: Lorenc Bushi <113361374+lbushi25@users.noreply.github.com> Date: Wed, 26 Jun 2024 17:34:41 -0400 Subject: [PATCH 12/27] Update helpers.hpp --- sycl/test-e2e/Basic/built-ins/helpers.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sycl/test-e2e/Basic/built-ins/helpers.hpp b/sycl/test-e2e/Basic/built-ins/helpers.hpp index c9871538ad480..23c4f4156af57 100644 --- a/sycl/test-e2e/Basic/built-ins/helpers.hpp +++ b/sycl/test-e2e/Basic/built-ins/helpers.hpp @@ -34,8 +34,7 @@ void test(bool CheckDevice, double delta, FuncTy F, ExpectedTy Expected, sycl::buffer SuccessBuf{1}; // Make sure we don't use fp64 on devices that don't support it. - sycl::queue q; - q.submit([&](sycl::handler &cgh) { + sycl::queue{}.submit([&](sycl::handler &cgh) { sycl::accessor Success{SuccessBuf, cgh}; cgh.single_task([=]() { auto R = F(Args...); From 6f3e1ad90580ce209c04ee2d8957971e512fa8ea Mon Sep 17 00:00:00 2001 From: Lorenc Bushi Date: Wed, 26 Jun 2024 21:34:04 -0700 Subject: [PATCH 13/27] Verify device supports fp64 before upscaling to double precision --- sycl/test-e2e/Basic/built-ins/helpers.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sycl/test-e2e/Basic/built-ins/helpers.hpp b/sycl/test-e2e/Basic/built-ins/helpers.hpp index 23c4f4156af57..55b5c9afaf55a 100644 --- a/sycl/test-e2e/Basic/built-ins/helpers.hpp +++ b/sycl/test-e2e/Basic/built-ins/helpers.hpp @@ -33,8 +33,12 @@ void test(bool CheckDevice, double delta, FuncTy F, ExpectedTy Expected, sycl::buffer SuccessBuf{1}; + sycl::queue q; + sycl::device dev = q.get_device(); // Make sure we don't use fp64 on devices that don't support it. - sycl::queue{}.submit([&](sycl::handler &cgh) { + if (!dev.has(sycl::aspect::fp64)) + delta = static_cast>(delta); + q.submit([&](sycl::handler &cgh) { sycl::accessor Success{SuccessBuf, cgh}; cgh.single_task([=]() { auto R = F(Args...); From 41c4641ffe4995c665b606bd7334a37fe6f46f4d Mon Sep 17 00:00:00 2001 From: Lorenc Bushi <113361374+lbushi25@users.noreply.github.com> Date: Thu, 27 Jun 2024 10:26:53 -0400 Subject: [PATCH 14/27] Update helpers.hpp --- sycl/test-e2e/Basic/built-ins/helpers.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sycl/test-e2e/Basic/built-ins/helpers.hpp b/sycl/test-e2e/Basic/built-ins/helpers.hpp index 55b5c9afaf55a..1d09b354209fa 100644 --- a/sycl/test-e2e/Basic/built-ins/helpers.hpp +++ b/sycl/test-e2e/Basic/built-ins/helpers.hpp @@ -36,14 +36,14 @@ void test(bool CheckDevice, double delta, FuncTy F, ExpectedTy Expected, sycl::queue q; sycl::device dev = q.get_device(); // Make sure we don't use fp64 on devices that don't support it. - if (!dev.has(sycl::aspect::fp64)) - delta = static_cast>(delta); + const bool fp64 = dev.has(sycl::aspect::fp64); + sycl::detail::get_elem_type_t d(delta); q.submit([&](sycl::handler &cgh) { sycl::accessor Success{SuccessBuf, cgh}; cgh.single_task([=]() { auto R = F(Args...); static_assert(std::is_same_v); - Success[0] = equal(R, Expected, delta); + Success[0] = equal(R, Expected, fp64 ? delta : d); }); }); assert(sycl::host_accessor{SuccessBuf}[0]); From 7593a2c0b968d2138c1261f01bd52ec8f07a5065 Mon Sep 17 00:00:00 2001 From: Lorenc Bushi <113361374+lbushi25@users.noreply.github.com> Date: Thu, 27 Jun 2024 13:33:48 -0400 Subject: [PATCH 15/27] Update helpers.hpp --- sycl/test-e2e/Basic/built-ins/helpers.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/Basic/built-ins/helpers.hpp b/sycl/test-e2e/Basic/built-ins/helpers.hpp index 1d09b354209fa..baaca9f53463c 100644 --- a/sycl/test-e2e/Basic/built-ins/helpers.hpp +++ b/sycl/test-e2e/Basic/built-ins/helpers.hpp @@ -43,7 +43,7 @@ void test(bool CheckDevice, double delta, FuncTy F, ExpectedTy Expected, cgh.single_task([=]() { auto R = F(Args...); static_assert(std::is_same_v); - Success[0] = equal(R, Expected, fp64 ? delta : d); + Success[0] = fp64 ? equal(R, Expected, delta) : equal(R, Expected, d); }); }); assert(sycl::host_accessor{SuccessBuf}[0]); From 2c5f35ab8978ec98647338157661c80257e3d350 Mon Sep 17 00:00:00 2001 From: Lorenc Bushi Date: Thu, 27 Jun 2024 14:20:41 -0700 Subject: [PATCH 16/27] Add link to bug for hardware_dispatch test --- sycl/test-e2e/ESIMD/hardware_dispatch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/ESIMD/hardware_dispatch.cpp b/sycl/test-e2e/ESIMD/hardware_dispatch.cpp index b69229f91b576..32390236190c5 100644 --- a/sycl/test-e2e/ESIMD/hardware_dispatch.cpp +++ b/sycl/test-e2e/ESIMD/hardware_dispatch.cpp @@ -9,7 +9,7 @@ // RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_bdw %s -Xs "-options -vc-codegen" -o %t.out // RUN: %t.out // TODO: remove XFAIL when the fix in GPU RT for Windows is updated on CI -// machines +// machines. See https://github.com/intel/llvm/issues/14336 // XFAIL: windows // This is basic test to test hardware dispatch functionality with ESIMD. From 85ed5c6a60c609fb39b1bfb23c47beabf60bf986 Mon Sep 17 00:00:00 2001 From: Lorenc Bushi Date: Thu, 27 Jun 2024 19:36:45 -0700 Subject: [PATCH 17/27] Update helpers.hpp --- sycl/test-e2e/Basic/built-ins/helpers.hpp | 27 ++++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/sycl/test-e2e/Basic/built-ins/helpers.hpp b/sycl/test-e2e/Basic/built-ins/helpers.hpp index baaca9f53463c..71bd0429928d3 100644 --- a/sycl/test-e2e/Basic/built-ins/helpers.hpp +++ b/sycl/test-e2e/Basic/built-ins/helpers.hpp @@ -37,14 +37,26 @@ void test(bool CheckDevice, double delta, FuncTy F, ExpectedTy Expected, sycl::device dev = q.get_device(); // Make sure we don't use fp64 on devices that don't support it. const bool fp64 = dev.has(sycl::aspect::fp64); - sycl::detail::get_elem_type_t d(delta); q.submit([&](sycl::handler &cgh) { sycl::accessor Success{SuccessBuf, cgh}; - cgh.single_task([=]() { - auto R = F(Args...); - static_assert(std::is_same_v); - Success[0] = fp64 ? equal(R, Expected, delta) : equal(R, Expected, d); - }); + if (fp64) { + cgh.single_task([=]() { + auto R = F(Args...); + static_assert(std::is_same_v); + Success[0] = equal( + R, Expected, + delta); // use double precision error tolerance when fp64 supported + }); + } else { + sycl::detail::get_elem_type_t d( + delta); // downscale the error tolerance when fp64 is not supported + cgh.single_task([=]() { + auto R = F(Args...); + static_assert(std::is_same_v); + Success[0] = equal(R, Expected, d); + }); + } +>>>>>>> b5278f4223c7 (Update helpers.hpp) }); assert(sycl::host_accessor{SuccessBuf}[0]); } @@ -53,8 +65,7 @@ template void test(FuncTy F, ExpectedTy Expected, ArgTys... Args) { test(true /*CheckDevice*/, 0.0 /*delta*/, F, Expected, Args...); } -template +template void test(bool CheckDevice, FuncTy F, ExpectedTy Expected, ArgTys... Args) { test(CheckDevice, 0.0 /*delta*/, F, Expected, Args...); } From 131ba3e090714eb025dd5ccc0a5ec0d2cbc5527e Mon Sep 17 00:00:00 2001 From: Lorenc Bushi Date: Thu, 27 Jun 2024 19:38:35 -0700 Subject: [PATCH 18/27] Update helpers.hpp --- sycl/test-e2e/Basic/built-ins/helpers.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/sycl/test-e2e/Basic/built-ins/helpers.hpp b/sycl/test-e2e/Basic/built-ins/helpers.hpp index 71bd0429928d3..8e55daa30d6ce 100644 --- a/sycl/test-e2e/Basic/built-ins/helpers.hpp +++ b/sycl/test-e2e/Basic/built-ins/helpers.hpp @@ -56,7 +56,6 @@ void test(bool CheckDevice, double delta, FuncTy F, ExpectedTy Expected, Success[0] = equal(R, Expected, d); }); } ->>>>>>> b5278f4223c7 (Update helpers.hpp) }); assert(sycl::host_accessor{SuccessBuf}[0]); } From 8f05214a0781e1d4b3a31121b12a2a70887b58a7 Mon Sep 17 00:00:00 2001 From: Lorenc Bushi <113361374+lbushi25@users.noreply.github.com> Date: Thu, 27 Jun 2024 22:39:58 -0400 Subject: [PATCH 19/27] Update hardware_dispatch.cpp --- sycl/test-e2e/ESIMD/hardware_dispatch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/ESIMD/hardware_dispatch.cpp b/sycl/test-e2e/ESIMD/hardware_dispatch.cpp index 32390236190c5..2bef1ab9f954d 100644 --- a/sycl/test-e2e/ESIMD/hardware_dispatch.cpp +++ b/sycl/test-e2e/ESIMD/hardware_dispatch.cpp @@ -9,7 +9,7 @@ // RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_bdw %s -Xs "-options -vc-codegen" -o %t.out // RUN: %t.out // TODO: remove XFAIL when the fix in GPU RT for Windows is updated on CI -// machines. See https://github.com/intel/llvm/issues/14336 +// machines. // XFAIL: windows // This is basic test to test hardware dispatch functionality with ESIMD. From d46d0cadce3b1e6f7bbcc2fd8eb404eb37bce64f Mon Sep 17 00:00:00 2001 From: Lorenc Bushi <113361374+lbushi25@users.noreply.github.com> Date: Thu, 27 Jun 2024 22:40:21 -0400 Subject: [PATCH 20/27] Update hardware_dispatch.cpp --- sycl/test-e2e/ESIMD/hardware_dispatch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/ESIMD/hardware_dispatch.cpp b/sycl/test-e2e/ESIMD/hardware_dispatch.cpp index 2bef1ab9f954d..b69229f91b576 100644 --- a/sycl/test-e2e/ESIMD/hardware_dispatch.cpp +++ b/sycl/test-e2e/ESIMD/hardware_dispatch.cpp @@ -9,7 +9,7 @@ // RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_bdw %s -Xs "-options -vc-codegen" -o %t.out // RUN: %t.out // TODO: remove XFAIL when the fix in GPU RT for Windows is updated on CI -// machines. +// machines // XFAIL: windows // This is basic test to test hardware dispatch functionality with ESIMD. From 587f713b550a33ae31a3c467fc872a1d2e0ef545 Mon Sep 17 00:00:00 2001 From: Lorenc Bushi <113361374+lbushi25@users.noreply.github.com> Date: Thu, 27 Jun 2024 22:41:07 -0400 Subject: [PATCH 21/27] Update helpers.hpp --- sycl/test-e2e/Basic/built-ins/helpers.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sycl/test-e2e/Basic/built-ins/helpers.hpp b/sycl/test-e2e/Basic/built-ins/helpers.hpp index 8e55daa30d6ce..dc2e2ed2d0241 100644 --- a/sycl/test-e2e/Basic/built-ins/helpers.hpp +++ b/sycl/test-e2e/Basic/built-ins/helpers.hpp @@ -60,7 +60,8 @@ void test(bool CheckDevice, double delta, FuncTy F, ExpectedTy Expected, assert(sycl::host_accessor{SuccessBuf}[0]); } -template +template void test(FuncTy F, ExpectedTy Expected, ArgTys... Args) { test(true /*CheckDevice*/, 0.0 /*delta*/, F, Expected, Args...); } From 070dec62068d5de153970d09d78948df8d51fc41 Mon Sep 17 00:00:00 2001 From: Lorenc Bushi <113361374+lbushi25@users.noreply.github.com> Date: Thu, 27 Jun 2024 22:41:50 -0400 Subject: [PATCH 22/27] Update helpers.hpp --- sycl/test-e2e/Basic/built-ins/helpers.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sycl/test-e2e/Basic/built-ins/helpers.hpp b/sycl/test-e2e/Basic/built-ins/helpers.hpp index dc2e2ed2d0241..d1f03d2ad594a 100644 --- a/sycl/test-e2e/Basic/built-ins/helpers.hpp +++ b/sycl/test-e2e/Basic/built-ins/helpers.hpp @@ -60,12 +60,12 @@ void test(bool CheckDevice, double delta, FuncTy F, ExpectedTy Expected, assert(sycl::host_accessor{SuccessBuf}[0]); } -template +template void test(FuncTy F, ExpectedTy Expected, ArgTys... Args) { test(true /*CheckDevice*/, 0.0 /*delta*/, F, Expected, Args...); } -template +template void test(bool CheckDevice, FuncTy F, ExpectedTy Expected, ArgTys... Args) { test(CheckDevice, 0.0 /*delta*/, F, Expected, Args...); } From 53383fb8bb25af55ddd155cc9b314716b0a2377d Mon Sep 17 00:00:00 2001 From: Lorenc Bushi <113361374+lbushi25@users.noreply.github.com> Date: Thu, 27 Jun 2024 22:42:08 -0400 Subject: [PATCH 23/27] Update helpers.hpp --- sycl/test-e2e/Basic/built-ins/helpers.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/Basic/built-ins/helpers.hpp b/sycl/test-e2e/Basic/built-ins/helpers.hpp index d1f03d2ad594a..09981a5c79c6e 100644 --- a/sycl/test-e2e/Basic/built-ins/helpers.hpp +++ b/sycl/test-e2e/Basic/built-ins/helpers.hpp @@ -64,7 +64,7 @@ template void test(FuncTy F, ExpectedTy Expected, ArgTys... Args) { test(true /*CheckDevice*/, 0.0 /*delta*/, F, Expected, Args...); } -template void test(bool CheckDevice, FuncTy F, ExpectedTy Expected, ArgTys... Args) { test(CheckDevice, 0.0 /*delta*/, F, Expected, Args...); From 891fc0d387ea11c90f98ca47ff838d11db812553 Mon Sep 17 00:00:00 2001 From: Lorenc Bushi <113361374+lbushi25@users.noreply.github.com> Date: Thu, 27 Jun 2024 22:43:08 -0400 Subject: [PATCH 24/27] Update helpers.hpp --- sycl/test-e2e/Basic/built-ins/helpers.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sycl/test-e2e/Basic/built-ins/helpers.hpp b/sycl/test-e2e/Basic/built-ins/helpers.hpp index 09981a5c79c6e..60acc8e9570df 100644 --- a/sycl/test-e2e/Basic/built-ins/helpers.hpp +++ b/sycl/test-e2e/Basic/built-ins/helpers.hpp @@ -43,13 +43,12 @@ void test(bool CheckDevice, double delta, FuncTy F, ExpectedTy Expected, cgh.single_task([=]() { auto R = F(Args...); static_assert(std::is_same_v); - Success[0] = equal( - R, Expected, - delta); // use double precision error tolerance when fp64 supported + // use double precision error tolerance when fp64 supported + Success[0] = equal(R, Expected,delta); }); } else { - sycl::detail::get_elem_type_t d( - delta); // downscale the error tolerance when fp64 is not supported + // downscale the error tolerance when fp64 is not supported + sycl::detail::get_elem_type_t d(delta); cgh.single_task([=]() { auto R = F(Args...); static_assert(std::is_same_v); From c98df778dbe5893d8901a007d5b8d3c73ad65bdb Mon Sep 17 00:00:00 2001 From: Lorenc Bushi <113361374+lbushi25@users.noreply.github.com> Date: Thu, 27 Jun 2024 22:43:30 -0400 Subject: [PATCH 25/27] Update helpers.hpp --- sycl/test-e2e/Basic/built-ins/helpers.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/Basic/built-ins/helpers.hpp b/sycl/test-e2e/Basic/built-ins/helpers.hpp index 60acc8e9570df..5cf6d77ea1118 100644 --- a/sycl/test-e2e/Basic/built-ins/helpers.hpp +++ b/sycl/test-e2e/Basic/built-ins/helpers.hpp @@ -44,7 +44,7 @@ void test(bool CheckDevice, double delta, FuncTy F, ExpectedTy Expected, auto R = F(Args...); static_assert(std::is_same_v); // use double precision error tolerance when fp64 supported - Success[0] = equal(R, Expected,delta); + Success[0] = equal(R, Expected, delta); }); } else { // downscale the error tolerance when fp64 is not supported From 8d47e918213dd7530635355c8258c60610c49811 Mon Sep 17 00:00:00 2001 From: Lorenc Bushi <113361374+lbushi25@users.noreply.github.com> Date: Thu, 27 Jun 2024 22:58:01 -0400 Subject: [PATCH 26/27] Update helpers.hpp --- sycl/test-e2e/Basic/built-ins/helpers.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/Basic/built-ins/helpers.hpp b/sycl/test-e2e/Basic/built-ins/helpers.hpp index 5cf6d77ea1118..cb86c75a9e6ca 100644 --- a/sycl/test-e2e/Basic/built-ins/helpers.hpp +++ b/sycl/test-e2e/Basic/built-ins/helpers.hpp @@ -44,7 +44,7 @@ void test(bool CheckDevice, double delta, FuncTy F, ExpectedTy Expected, auto R = F(Args...); static_assert(std::is_same_v); // use double precision error tolerance when fp64 supported - Success[0] = equal(R, Expected, delta); + Success[0] = equal(R, Expected, d); }); } else { // downscale the error tolerance when fp64 is not supported From ca899a6338450ab66332b0fd42d9bbf5e13e41d8 Mon Sep 17 00:00:00 2001 From: Lorenc Bushi <113361374+lbushi25@users.noreply.github.com> Date: Thu, 27 Jun 2024 23:52:32 -0400 Subject: [PATCH 27/27] Update helpers.hpp --- sycl/test-e2e/Basic/built-ins/helpers.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/Basic/built-ins/helpers.hpp b/sycl/test-e2e/Basic/built-ins/helpers.hpp index cb86c75a9e6ca..724e417c4d6e0 100644 --- a/sycl/test-e2e/Basic/built-ins/helpers.hpp +++ b/sycl/test-e2e/Basic/built-ins/helpers.hpp @@ -44,7 +44,7 @@ void test(bool CheckDevice, double delta, FuncTy F, ExpectedTy Expected, auto R = F(Args...); static_assert(std::is_same_v); // use double precision error tolerance when fp64 supported - Success[0] = equal(R, Expected, d); + Success[0] = equal(R, Expected, delta); }); } else { // downscale the error tolerance when fp64 is not supported