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

Port cub::DeviceReduce tests to catch2 #267

Merged
merged 5 commits into from
Jul 26, 2023

Conversation

elstehle
Copy link
Collaborator

Description

This PR partially addresses #85. It migrates tests for DeviceReduce, i.e., single-problem reduction algorithms, to Catch2.

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@elstehle elstehle requested review from a team as code owners July 26, 2023 08:03
@elstehle elstehle requested review from gevtushenko and miscco and removed request for a team July 26, 2023 08:03
@elstehle elstehle added cub For all items related to CUB infrastructure Shared CMake, github, etc infrastructure labels Jul 26, 2023
@elstehle elstehle changed the title Migrates device reduce tests to Catch2 Port cub::DeviceReduce tests to catch2 Jul 26, 2023
/**
* Vector1 overloads
*/
#define CUB_VEC_1_TRAITS_OVERLOAD(T, BaseT) \
Copy link
Collaborator Author

@elstehle elstehle Jul 26, 2023

Choose a reason for hiding this comment

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

I've migrated these from test_util.h to avoid having to rely on test_util.h. My ultimate goal is that, since test_util.h contains a lot of other old boilerplate testing code that were needed by old tests, to drop test_util.h altogether once the Catch2 migration is completed.

Copy link
Collaborator

@gevtushenko gevtushenko left a comment

Choose a reason for hiding this comment

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

A few minor comments below.

cub/test/catch2_test_device_reduce.cuh Show resolved Hide resolved
cub/test/catch2_test_device_reduce.cu Outdated Show resolved Hide resolved
cub/test/catch2_test_device_reduce.cu Outdated Show resolved Hide resolved
cub/test/catch2_test_device_reduce.cu Outdated Show resolved Hide resolved
cub/test/catch2_test_device_reduce.cu Outdated Show resolved Hide resolved
}

// TEST_TYPES == 5
#elif TEST_TYPES == 5
Copy link
Collaborator

Choose a reason for hiding this comment

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

This approach is not very development-friendly. If you need different tests in different TUs, can we consider putting them into different source files?

Copy link
Collaborator Author

@elstehle elstehle Jul 26, 2023

Choose a reason for hiding this comment

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

Agreed! Thanks for the suggestion. Moved the two test sections into their own translation unit:

  • device_reduce_iterators.cu: 64-bit indices and fancy iterators
  • device_reduce_fp_inf.cu: Arg{Min,Max} with inf
    Would be great if I could have your eyes do another pass over this refactor quickly 🙏

@elstehle elstehle merged commit 025364c into NVIDIA:main Jul 26, 2023
368 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cub For all items related to CUB infrastructure Shared CMake, github, etc infrastructure
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants