-
Notifications
You must be signed in to change notification settings - Fork 83
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
Test marray on device #854
Conversation
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]>
// default constructor | ||
{ | ||
marray_t ma; | ||
CHECK(value_operations::are_equal(ma, DataT{})); | ||
*(results++) = value_operations::are_equal(ma, DataT{}); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 marray
s 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.
There was a problem hiding this comment.
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. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
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