From a8520778d005fb0ef288b18e058276e0235344e7 Mon Sep 17 00:00:00 2001 From: "Larsen, Steffen" Date: Tue, 18 Jul 2023 04:48:31 -0700 Subject: [PATCH 1/3] Enable dimension item/id/range dimension checks for DPC++ This commit enables a number of test cases previously disabled for DPC++ due to missing `dimensions` member in `id`, `range`, `nd_range`, `h_item`, `item`, and `nd_item`. Signed-off-by: Larsen, Steffen --- tests/h_item/h_item_members.cpp | 4 +--- tests/id/id.cpp | 4 +--- tests/item/item_members.cpp | 4 +--- tests/nd_item/nd_item_members.cpp | 7 ++----- tests/nd_range/nd_range_members.cpp | 4 +--- tests/range/range_members.cpp | 4 +--- 6 files changed, 7 insertions(+), 20 deletions(-) diff --git a/tests/h_item/h_item_members.cpp b/tests/h_item/h_item_members.cpp index 00160628c..6ab1774ef 100644 --- a/tests/h_item/h_item_members.cpp +++ b/tests/h_item/h_item_members.cpp @@ -34,9 +34,7 @@ void run_test() { range_index_space_id::check_members_test, Dim>(type_name); } -// FIXME: re-enable when sycl::h_item<>::dimensions is implemented -// Issue link https://github.com/intel/llvm/issues/9786 -DISABLED_FOR_TEST_CASE(DPCPP, ComputeCpp) +DISABLED_FOR_TEST_CASE(ComputeCpp) ("sycl::h_item members", "[h_item]")({ run_test<1>(); run_test<2>(); diff --git a/tests/id/id.cpp b/tests/id/id.cpp index e1cd75e2e..2e15a7b03 100644 --- a/tests/id/id.cpp +++ b/tests/id/id.cpp @@ -284,9 +284,7 @@ TEMPLATE_TEST_CASE_SIG("id supports get() and operator[]", "[id]", ((int D), D), } } -// FIXME: re-enable when sycl::id<>::dimensions is implemented -// Issue link https://github.com/intel/llvm/issues/9786 -DISABLED_FOR_TEMPLATE_TEST_CASE_SIG(DPCPP, hipSYCL) +DISABLED_FOR_TEMPLATE_TEST_CASE_SIG(hipSYCL) ("id provides static constexpr member 'dimensions'", "[id]", ((int D), D), 1, 2, 3)({ CHECK(std::is_same_v::dimensions), const int>); diff --git a/tests/item/item_members.cpp b/tests/item/item_members.cpp index d6231d33c..8b7ff0743 100644 --- a/tests/item/item_members.cpp +++ b/tests/item/item_members.cpp @@ -34,9 +34,7 @@ void run_test() { range_index_space_id::check_members_test, Dim>(type_name); } -// FIXME: re-enable when sycl::item<>::dimensions is implemented -// Issue link https://github.com/intel/llvm/issues/9786 -DISABLED_FOR_TEST_CASE(DPCPP, ComputeCpp) +DISABLED_FOR_TEST_CASE(ComputeCpp) ("sycl::item members", "[item]")({ run_test<1>(); run_test<2>(); diff --git a/tests/nd_item/nd_item_members.cpp b/tests/nd_item/nd_item_members.cpp index 352f3cec3..f2ce461de 100644 --- a/tests/nd_item/nd_item_members.cpp +++ b/tests/nd_item/nd_item_members.cpp @@ -34,13 +34,10 @@ void run_test() { range_index_space_id::check_members_test, Dim>(type_name); } -// FIXME: re-enable when sycl::nd_item<>::dimensions is implemented -// Issue link https://github.com/intel/llvm/issues/9786 -DISABLED_FOR_TEST_CASE(DPCPP) -("sycl::nd_item members", "[nd_item]")({ +TEST_CASE("sycl::nd_item members", "[nd_item]") { run_test<1>(); run_test<2>(); run_test<3>(); -}); +} } // namespace nd_item_members diff --git a/tests/nd_range/nd_range_members.cpp b/tests/nd_range/nd_range_members.cpp index d48e492a9..a86d73068 100644 --- a/tests/nd_range/nd_range_members.cpp +++ b/tests/nd_range/nd_range_members.cpp @@ -34,9 +34,7 @@ void run_test() { range_index_space_id::check_members_test, Dim>(type_name); } -// FIXME: re-enable when sycl::nd_range<>::dimensions is implemented -// Issue link https://github.com/intel/llvm/issues/9786 -DISABLED_FOR_TEST_CASE(DPCPP, ComputeCpp) +DISABLED_FOR_TEST_CASE(ComputeCpp) ("sycl::nd_range members", "[nd_range]")({ run_test<1>(); run_test<2>(); diff --git a/tests/range/range_members.cpp b/tests/range/range_members.cpp index 4df371d43..1ac28296a 100644 --- a/tests/range/range_members.cpp +++ b/tests/range/range_members.cpp @@ -34,9 +34,7 @@ void run_test() { range_index_space_id::check_members_test, Dim>(type_name); } -// FIXME: re-enable when sycl::range<>::dimensions is implemented -// Issue link https://github.com/intel/llvm/issues/9786 -DISABLED_FOR_TEST_CASE(DPCPP, ComputeCpp) +DISABLED_FOR_TEST_CASE(ComputeCpp) ("sycl::range members", "[range]")({ run_test<1>(); run_test<2>(); From d9cb0b273201468c3566d6a57b51c7a0188b721e Mon Sep 17 00:00:00 2001 From: "Larsen, Steffen" Date: Wed, 19 Jul 2023 08:32:48 -0700 Subject: [PATCH 2/3] Split id dimension checks to avoid kernel redefinitions Signed-off-by: Larsen, Steffen --- tests/id/id.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/tests/id/id.cpp b/tests/id/id.cpp index 2e15a7b03..70fa798f8 100644 --- a/tests/id/id.cpp +++ b/tests/id/id.cpp @@ -284,14 +284,21 @@ TEMPLATE_TEST_CASE_SIG("id supports get() and operator[]", "[id]", ((int D), D), } } -DISABLED_FOR_TEMPLATE_TEST_CASE_SIG(hipSYCL) -("id provides static constexpr member 'dimensions'", "[id]", ((int D), D), 1, 2, - 3)({ - CHECK(std::is_same_v::dimensions), const int>); - KCHECK(EVAL((std::is_same_v::dimensions), const int>))); - - CHECK(sycl::id::dimensions == D); - KCHECK(EVAL(sycl::id::dimensions) == D); +DISABLED_FOR_TEST_CASE(hipSYCL) +("id provides static constexpr member 'dimensions'", "[id]")({ + CHECK(std::is_same_v::dimensions), const int>); + CHECK(std::is_same_v::dimensions), const int>); + CHECK(std::is_same_v::dimensions), const int>); + KCHECK(EVAL((std::is_same_v::dimensions), const int>))); + KCHECK(EVAL((std::is_same_v::dimensions), const int>))); + KCHECK(EVAL((std::is_same_v::dimensions), const int>))); + + CHECK(sycl::id<1>::dimensions == 1); + CHECK(sycl::id<2>::dimensions == 2); + CHECK(sycl::id<3>::dimensions == 3); + KCHECK(EVAL(sycl::id<1>::dimensions) == 1); + KCHECK(EVAL(sycl::id<2>::dimensions) == 2); + KCHECK(EVAL(sycl::id<3>::dimensions) == 3); }); TEST_CASE("id can be converted to size_t if Dimensions == 1", "[id]") { From fdadb32057caa460661ab7273f6844bb554608dc Mon Sep 17 00:00:00 2001 From: "Larsen, Steffen" Date: Tue, 25 Jul 2023 01:13:11 -0700 Subject: [PATCH 3/3] Add comment Signed-off-by: Larsen, Steffen --- tests/id/id.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/id/id.cpp b/tests/id/id.cpp index 70fa798f8..5e6a573ba 100644 --- a/tests/id/id.cpp +++ b/tests/id/id.cpp @@ -286,6 +286,8 @@ TEMPLATE_TEST_CASE_SIG("id supports get() and operator[]", "[id]", ((int D), D), DISABLED_FOR_TEST_CASE(hipSYCL) ("id provides static constexpr member 'dimensions'", "[id]")({ + // Dimension arguments in this test case are expanded to avoid conflicting + // kernel names for different instantiations of sycl::id. CHECK(std::is_same_v::dimensions), const int>); CHECK(std::is_same_v::dimensions), const int>); CHECK(std::is_same_v::dimensions), const int>);