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 marray on device #854

Merged

Conversation

steffenlarsen
Copy link
Contributor

@steffenlarsen steffenlarsen commented Jan 12, 2024

This commit makes marray tests run checks on both device and host, where they would only run on host previously. Additionally it splits operator tests up in separate categories to reduce compilation overhead.

Fixes #821

This commit makes marray tests run checks on both device and host, where
they would only run on host previously.

Signed-off-by: Larsen, Steffen <[email protected]>
@steffenlarsen steffenlarsen requested a review from a team as a code owner January 12, 2024 15:49
@bader bader added the help wanted Extra attention is needed label Jan 12, 2024
// default constructor
{
marray_t ma;
CHECK(value_operations::are_equal(ma, DataT{}));
*(results++) = value_operations::are_equal(ma, DataT{});
Copy link
Member

Choose a reason for hiding this comment

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

() are redundant but it might be clearer too. So no problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are absolutely right, but since they are unary operators on each side of the expression I think it's one of those cases where the precedence rules get hard to remember, so I personally prefer the parenthesis. 😄


// only compiled when NumElements != 1
check_constexpr_single_element();
if constexpr (NumElements != 1) {
Copy link
Member

Choose a reason for hiding this comment

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

What is the problem with 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These test cases try to construct an marray using a scalar and an marray of size NumElements - 1. If NumElements is 1, then the smaller marray would have to be of size 0. 0-sized marrays are not allowed by the specification based on the following:

The number of elements parameter, NumElements, is a positive value of the std::size_t type.

Copy link
Member

Choose a reason for hiding this comment

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

Oh I see, by looking at the called function.
You just implement the comment, actually. :-)

@bader bader requested a review from keryell January 25, 2024 16:12
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!

@bader bader merged commit f982375 into KhronosGroup:SYCL-2020 Jan 25, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

marray test does not test everything (or anything?) on device
3 participants