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

Extend blocked_nd_range CTAD with tests and explicit deduction guide #1525

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

kboyarinov
Copy link
Contributor

@kboyarinov kboyarinov commented Oct 8, 2024

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

  • bug fix - change that fixes an issue
  • new feature - change that adds functionality
  • tests - change in tests
  • infrastructure - change in infrastructure and CI
  • documentation - documentation update

Tests

  • added - required for new features and some bug fixes
  • not needed

Documentation

  • updated in # - add PR number
  • needs to be updated
  • not needed

Breaks backward compatibility

  • Yes
  • No
  • Unknown

Notify the following users

List users with @ to send notifications

Other information

@kboyarinov kboyarinov force-pushed the rarutyun/blocked_range_nd_class branch from 3fe65dc to 64610c6 Compare December 20, 2024 12:22
@kboyarinov kboyarinov changed the title Extend blocked_rangeNd CTAD PR with tests and explicit deduction guide Extend blocked_nd_range CTAD with tests and explicit deduction guide Dec 20, 2024
Base automatically changed from rarutyun/blocked_range_nd_class to master January 14, 2025 11:50
Copy link
Contributor

@akukanov akukanov left a 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.

Comment on lines +170 to +177
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>;

Copy link
Contributor

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?

Comment on lines +161 to +165
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>;

Copy link
Contributor

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") {
Copy link
Contributor

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.

Comment on lines +304 to +306
oneapi::tbb::blocked_range<int> dim_range(0, 100);

blocked_nd_range<int, 2> source_range(dim_range, dim_range);
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants