-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Extend blocked_nd_range CTAD with tests and explicit deduction guide #1525
base: master
Are you sure you want to change the base?
Extend blocked_nd_range CTAD with tests and explicit deduction guide #1525
Conversation
3fe65dc
to
64610c6
Compare
… into dev/kboyarinov/blocked_range_nd_deduction_guides_test
… into dev/kboyarinov/blocked_range_nd_deduction_guides_test
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.
In addition to the notes below: it would be great to comment the guides explaining which ctor calls are covered by which.
template <typename Value, unsigned int N> | ||
blocked_nd_range(blocked_nd_range<Value, N>, oneapi::tbb::split) | ||
-> blocked_nd_range<Value, N>; | ||
|
||
template <typename Value, unsigned int N> | ||
blocked_nd_range(blocked_nd_range<Value, N>, oneapi::tbb::proportional_split) | ||
-> blocked_nd_range<Value, N>; | ||
|
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.
Splitting constructors are not really for users but for algorithms. Do we need deduction guides for these?
template <typename Value, unsigned int N, | ||
typename = std::enable_if_t<(N != 2 && N != 3)>> | ||
blocked_nd_range(const Value (&)[N]) | ||
-> blocked_nd_range<Value, N>; | ||
|
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 if the argument is explicitly an array of 2 or 3 elements, not a braced init list? Seems there is no deduction guide for it.
#if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT | ||
//! Testing blocked_rangeNd deduction guides | ||
//! \brief \ref interface | ||
TEST_CASE("blocked_rangeNd deduction guides") { |
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.
The test misses any checks for constructing explicitly from an array. It needs to check construction from arrays of different sizes (incl. 2 and 3), with and without a grainsize argument.
oneapi::tbb::blocked_range<int> dim_range(0, 100); | ||
|
||
blocked_nd_range<int, 2> source_range(dim_range, dim_range); |
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.
Can we test with something more fancy than int for the value type?
Description
Add a comprehensive description of proposed changes
Fixes # - issue number(s) if exists
Type of change
Choose one or multiple, leave empty if none of the other choices apply
Add a respective label(s) to PR if you have permissions
Tests
Documentation
Breaks backward compatibility
Notify the following users
List users with
@
to send notificationsOther information