Skip to content

Commit

Permalink
Merge pull request #751 from steffenlarsen/steffen/enable_dpcpp_dim_t…
Browse files Browse the repository at this point in the history
…ests

Enable dimension item/id/range dimension checks for DPC++
  • Loading branch information
bader committed Jul 25, 2023
2 parents d6c817c + 071103a commit 73ab2fa
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 27 deletions.
4 changes: 1 addition & 3 deletions tests/h_item/h_item_members.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ void run_test() {
range_index_space_id::check_members_test<sycl::h_item<Dim>, 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>();
Expand Down
27 changes: 17 additions & 10 deletions tests/id/id.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,23 @@ 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)
("id provides static constexpr member 'dimensions'", "[id]", ((int D), D), 1, 2,
3)({
CHECK(std::is_same_v<decltype(sycl::id<D>::dimensions), const int>);
KCHECK(EVAL((std::is_same_v<decltype(sycl::id<D>::dimensions), const int>)));

CHECK(sycl::id<D>::dimensions == D);
KCHECK(EVAL(sycl::id<D>::dimensions) == 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<decltype(sycl::id<1>::dimensions), const int>);
CHECK(std::is_same_v<decltype(sycl::id<2>::dimensions), const int>);
CHECK(std::is_same_v<decltype(sycl::id<3>::dimensions), const int>);
KCHECK(EVAL((std::is_same_v<decltype(sycl::id<1>::dimensions), const int>)));
KCHECK(EVAL((std::is_same_v<decltype(sycl::id<2>::dimensions), const int>)));
KCHECK(EVAL((std::is_same_v<decltype(sycl::id<3>::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]") {
Expand Down
4 changes: 1 addition & 3 deletions tests/item/item_members.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ void run_test() {
range_index_space_id::check_members_test<sycl::item<Dim>, 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>();
Expand Down
7 changes: 2 additions & 5 deletions tests/nd_item/nd_item_members.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,10 @@ void run_test() {
range_index_space_id::check_members_test<sycl::nd_item<Dim>, 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
4 changes: 1 addition & 3 deletions tests/nd_range/nd_range_members.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ void run_test() {
range_index_space_id::check_members_test<sycl::nd_range<Dim>, 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>();
Expand Down
4 changes: 1 addition & 3 deletions tests/range/range_members.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ void run_test() {
range_index_space_id::check_members_test<sycl::range<Dim>, 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>();
Expand Down

0 comments on commit 73ab2fa

Please sign in to comment.