Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL] Add tests for span reductions #1009

Merged
merged 4 commits into from
May 5, 2022

Conversation

Pennycook
Copy link

Tests the following:

  • Only spans with static extents are available
  • Kernels with a single reduction span work
  • Kernels with a reduction pack containing a span work

Tests intel/llvm#6019

Signed-off-by: John Pennycook john.pennycook@intel.com

Tests the following:
- Only spans with static extents are available
- Kernels with a single reduction span work
- Kernels with a reduction pack containing a span work

Signed-off-by: John Pennycook <john.pennycook@intel.com>
Q.parallel_for(range<1>{N}, [=](id<1> I) { Output[I] = Identity; }).wait();

// Perform generalized "histogram" with N bins
// TODO: Test Q.parallel_for when code_location is fixed

Choose a reason for hiding this comment

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

The q.parallel_for issue is already resolved: intel/llvm#4352

Copy link
Author

Choose a reason for hiding this comment

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

Ah, thanks. I've updated the test to run with both handler and queue in 1c63fab.

// `Group algorithms are not supported on host device.` on Nvidia.
// XFAIL: hip_nvidia

// TODO: test disabled due to sporadic fails in level_zero:gpu RT.

Choose a reason for hiding this comment

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

Maybe try turning it on initially? I see many fixes and attempts to fix/address those sporadic fails are done, but I did not see tests to be enabled after that.
We can disable the test when/if it starts failing.

Copy link
Author

Choose a reason for hiding this comment

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

Ok. I've reenabled these tests for now; see a7eb1e1.

@v-klochkov
Copy link

The tests are good.
They need to be re-based to re-start the testing with new compiler that has reduction+span support.

Comment on lines +204 to +223
test<16, int, std::plus<int>, sycl::nd_range<1>, submission_mode::handler>(
Q, {24, 8}, 0, 1);
test<16, float, std::plus<float>, sycl::nd_range<1>,
submission_mode::handler>(Q, {24, 8}, 0, 1);
test<16, int, std::multiplies<int>, sycl::nd_range<1>,
submission_mode::handler>(Q, {24, 8}, 1, 2);
test<16, int, std::bit_or<int>, sycl::nd_range<1>, submission_mode::handler>(
Q, {24, 8}, 0, 1);
test<16, CustomType, CustomBinaryOperation, sycl::nd_range<1>,
submission_mode::handler>(Q, {24, 8}, CustomType{0}, CustomType{1});
test<16, int, std::plus<int>, sycl::nd_range<1>, submission_mode::queue>(
Q, {24, 8}, 0, 1);
test<16, float, std::plus<float>, sycl::nd_range<1>, submission_mode::queue>(
Q, {24, 8}, 0, 1);
test<16, int, std::multiplies<int>, sycl::nd_range<1>,
submission_mode::queue>(Q, {24, 8}, 1, 2);
test<16, int, std::bit_or<int>, sycl::nd_range<1>, submission_mode::queue>(
Q, {24, 8}, 0, 1);
test<16, CustomType, CustomBinaryOperation, sycl::nd_range<1>,
submission_mode::queue>(Q, {24, 8}, CustomType{0}, CustomType{1});

Choose a reason for hiding this comment

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

Minor comment:
It seems like the lines 204-213 and 214-223 have only 1 difference - the submission_mode.
If so, it could be easier/shorter to add 2 lines near the line 182, i.e.

template <size_t N, typename T, typename BinaryOperation, typename Range>
void test(queue Q, Range Rng, T Identity, T Value) {
  test1<N, T, BinaryOperation, Range, submission_mode::handler>(Q, Rng, Identity, Value);
  test2<N, T, BinaryOperation, Range, , submission_mode::handler>(Q, Rng, Identity, Value);
  test1<N, T, BinaryOperation, Range, , submission_mode::queue>(Q, Rng, Identity, Value);
  test2<N, T, BinaryOperation, Range, submission_mode::queue>(Q, Rng, Identity, Value);
}

@v-klochkov v-klochkov merged commit 9cf8258 into intel:intel May 5, 2022
myler pushed a commit to myler/llvm-test-suite that referenced this pull request Jun 17, 2022
* [SYCL] Add tests for span reductions

Tests the following:
- Only spans with static extents are available
- Kernels with a single reduction span work
- Kernels with a reduction pack containing a span work

* [SYCL] Reenable sporadically failing tests
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Mar 27, 2023
* [SYCL] Add tests for span reductions

Tests the following:
- Only spans with static extents are available
- Kernels with a single reduction span work
- Kernels with a reduction pack containing a span work

* [SYCL] Reenable sporadically failing tests
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants