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

Test for [[sycl::reqd_work_group_size]] exception when mismatched nd_range was given #285

Conversation

andreyromanof
Copy link
Contributor

@andreyromanof andreyromanof commented Feb 16, 2022

This PR provides test for optional kernel features.
Test decorates kernel with attribute [[sycl::reqd_work_group_size(N)]] where N is supported size and pass nd_range instance with unsupported size to parallel_for invocation and expect exception sycl::errc::nd_range.

Depend on:

@bader bader requested a review from psalz February 16, 2022 07:17
Copy link
Contributor

@ProGTX ProGTX left a comment

Choose a reason for hiding this comment

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

Some concerns about disabling the test for implementations that don't support these features.

@@ -28,3 +28,4 @@ usm
vector_api
vector_constructors
vector_swizzles
optional_kernel_features
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you maybe have output from a run of ComputeCpp or is this just to play it safe and not risk breaking CI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here output from a run of ComputeCpp before I apply filter. On line 2791 warning messages about unknown attributes, which is why I decided to put test in the filter.

But right now I also noticed other errors like no known conversion from 'cl::sycl::nd_item<1>' to 'sycl::item<1>' on line 2814. Am I wrong with the lambda argument? Do I have to use nd_item<1> instead of item<1> on line 41 in kernel_features_mismatched_nd_range_exception.cpp?

@@ -37,3 +37,4 @@ vector_load_store
vector_operators
vector_swizzle_assignment
vector_swizzles
optional_kernel_features
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's better to maintain an alphabetical ordering, the same for other filters. Also, should we maybe name it kernel_optional_features?

Copy link
Contributor Author

@andreyromanof andreyromanof Feb 17, 2022

Choose a reason for hiding this comment

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

Sorted lines in this commit: a02a67f.

We can rename it but in other PR when all tests will be implemented, because some of the tests in other PR, some of the tests in development and it will be unhandy to rename these tests now.

IMHO, I think we can keep the current name.

}

const bool is_exception_expected = true;
sycl::errc errc_expected = sycl::errc::nd_range;
Copy link
Contributor

Choose a reason for hiding this comment

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

From the spec:

In order to guarantee source code portability of SYCL applications that use optional kernel features, all SYCL implementations must be able to compile device code that uses these optional features regardless of whether the implementation supports the features on any of its devices.

You've marked two implementations in the CI as not passing (adding the test to the filter), but I believe they should be able to pass the test even if they don't implement the features, otherwise they wouldn't be able to pass conformance in the current CTS design.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I understand CI doesn't run tests, it's just built it. Here you can find output from the building of tests on CI. ComputeCpp and hipsycl failed building due to some errors.

From hipsycl logs, line 1970: error: ‘errc’ is not a member of ‘sycl’. Looks like enum with error codes is not implemented yet and attributes too (line 1966).

Similar situation for computecpp.

But maybe I was wrong when I put these two implementations in the filter because both of them give the error message: no known conversion from 'cl::sycl::nd_item<1>' to 'sycl::item<1>' error, so it can be bug of tests itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was my mistake. I changed to nd_item but now getting another error. Right now investigating it.

@andreyromanof
Copy link
Contributor Author

I tried to fix the code for the computecpp CI but looks like this implementation has a few specific issues:

  • It's doesn't support implementation-defined kernel names according to paragraph 4.9.4.2. Link to the error
  • I changed const auto max_wg_size to const size_t max_wg_size, because otherwise compilation was failed. This variable is used in the constructor of nd_range Link to error
  • Problem with linkage I was unable to solve, but my guess that its kind of stringify function for the sycl::errc that cause an error.

Changed `testing_wg_size` to 1 that supports by all devices
Changed `INFO` to `SECTION`
@bader bader requested a review from psalz February 22, 2022 10:08
Copy link
Member

@keryell keryell left a comment

Choose a reason for hiding this comment

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

Thanks.

Romanov AndreyX added 4 commits February 28, 2022 09:44
…into optional_kernel_features/missmatched_nd_range_exception
Removed optional_kernel_features from ci filter
Removed section due to issue in CI build
@andreyromanof
Copy link
Contributor Author

Build error on ComputeCpp points to SECTION invocation and use of undeclared identifier INTERNAL_CTS_ENABLED_TEST_CASE_BODY. Don't have any more ideas on how to fix it and seems like it is not a compiler bug, so we can't just add the test to filter.

@psalz
Copy link
Contributor

psalz commented Feb 28, 2022

Build error on ComputeCpp points to SECTION invocation and use of undeclared identifier INTERNAL_CTS_ENABLED_TEST_CASE_BODY. Don't have any more ideas on how to fix it and seems like it is not a compiler bug, so we can't just add the test to filter.

Actually the root cause is the error before that: error: _Pragma takes a parenthesized string literal. I've actually seen this before (it's a bug in Clang 8) and already have a fix for it. I'll open a PR shortly. This will however not really solve the problem at hand, as ComputeCpp then still fails during linking with undefined reference to cl::sycl::detail::errc_to_str[abi:cxx11](cl::sycl::detail::errc) (cc @ProGTX).

@psalz
Copy link
Contributor

psalz commented Feb 28, 2022

The aforementioned bug should be fixed by #296.

…into optional_kernel_features/missmatched_nd_range_exception
@bader
Copy link
Contributor

bader commented Mar 10, 2022

@andreyromanof, please, fix the build with computecpp.

Romanov AndreyX added 2 commits March 10, 2022 14:54
@bader
Copy link
Contributor

bader commented Mar 10, 2022

@ProGTX, please, check if your concerns are addressed.

@bader bader merged commit e7ff3a1 into KhronosGroup:SYCL-2020 Mar 10, 2022
@andreyromanof andreyromanof deleted the optional_kernel_features/missmatched_nd_range_exception branch April 7, 2022 08:02
steffenlarsen pushed a commit to steffenlarsen/SYCL-CTS that referenced this pull request Dec 6, 2022
Update compile-time properties tests after spec update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants