Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable dimension item/id/range dimension checks for DPC++ #751

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
25 changes: 15 additions & 10 deletions tests/id/id.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,21 @@ 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]")({
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);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: The names given to the kernel in each instantiation of this test case would previously not be unique, hence the split here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting design information that should appear in a comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I've added a comment about it.

});

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