Repository navigation
Final env-passthrough 2/4 - #8979
Conversation
* add in docs that memory_resource can also be passed in env * add enable_ifs to beat existing ambiguities with non-env APIs * match 1-1 the non-env APIs to the env APIs identities (defaults, arguments order)
* its purpose is to guard against ambiguities introduced with env algorithms * it also extends as a ground for placing the literalinclude examples as we extract them from the hardcoded snippets in the docs
📝 WalkthroughSummary by CodeRabbit
Walkthroughimportant: Five device algorithm headers replace iterator-based SFINAE on environment overloads with integral ChangesDeviceAdjacentDifference SFINAE refactor & docs
DeviceCopy documentation adjustments
DeviceFind documentation clarification
DevicePartition SFINAE removal & docs
DeviceRunLengthEncode SFINAE removal & param docs
Legacy API overload-resolution tests
Environment test call-site refactor (stream_ref)
Suggested reviewers
Comment |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| C2H_TEST("DeviceAdjacentDifference::SubtractLeftCopy legacy size-query is unambiguous", "[adjacent_difference][device]") | ||
| { | ||
| int* d_in = nullptr; | ||
| int* d_out = nullptr; | ||
| size_t bytes = 0; | ||
| int n = 0; | ||
|
|
||
| REQUIRE(cudaSuccess == cub::DeviceAdjacentDifference::SubtractLeftCopy(nullptr, bytes, d_in, d_out, n)); | ||
| } |
There was a problem hiding this comment.
Important: Those tests don't look like API examples. So they should go into the files cub/test/catch2_test_device_adjacent_difference_subtract_*.cu
There was a problem hiding this comment.
-
doesn't have to be an example to go under the
_api.cutest. It's literally what the name suggest, an API test, not an example (which the file name doesn't even suggest). -
it's a good starting point to have for moving old docs examples into literalincludes
please let's keep it as is
There was a problem hiding this comment.
- doesn't have to be an example to go under the
_api.cutest. It's literally what the name suggest, an API test, not an example (which the file name doesn't even suggest).
This is contrary to my understanding. _api.cu contain only API examples which are referenced from the documentation. They do not contain any functional tests.
Functional tests are always in files like catch2_test_device_algorithmname.cu (with some variations). You also added tests named catch2_test_device_algorithmname_env.cu, which test whether the handling of the execution environment works correctly, with little or no focus on algorithmic correctness.
Please elaborate why we need to break the convention now, or where it has been broken before.
| C2H_TEST("DeviceCopy::Batched legacy size-query is unambiguous", "[copy][device]") | ||
| { | ||
| // DeviceCopy::Batched takes iterator-of-iterators for input/output ranges. | ||
| int** in = nullptr; | ||
| int** out = nullptr; | ||
| size_t* sizes = nullptr; | ||
| size_t bytes = 0; | ||
| ::cuda::std::int64_t num_ranges = 0; | ||
|
|
||
| REQUIRE(cudaSuccess == cub::DeviceCopy::Batched(nullptr, bytes, in, out, sizes, num_ranges)); | ||
| } |
There was a problem hiding this comment.
Same here, this is not an API example test.
Applies a few more times below.
|
critical ambiguity resolved in last commit |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cub/cub/device/device_partition.cuh (1)
991-992: important: This overload-resolution change touches a Device* API path; please attach pre/post SASS diff and CUB benchmark results forDevicePartitionbefore merge to confirm no codegen or performance regressions.As per coding guidelines
**/cub/**/device*.{cu,cuh,h}: “Verify no SASS code generation changes occur for Device* algorithms in CUB by comparing generated SASS output before and after changes” and “Run benchmark tests using the CUB Benchmarks framework when modifying Device* algorithms to verify no performance regressions occur”.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: d3a48de4-f621-495a-8986-a9832267e915
📒 Files selected for processing (2)
cub/cub/device/device_partition.cuhcub/test/catch2_test_device_partition_api.cu
🥳 CI Workflow Results🟩 Finished in 1h 57m: Pass: 100%/283 | Total: 7d 11h | Max: 1h 55m | Hits: 45%/450454See results here. |
|
Successfully created backport PR for |
Handles #8175 for
the most serious issues have to do with defaults in adjacentdifference and ambiguities they were created.
I chose to start introducing non-env api file tests to check that the non-env APIs work in their minimal form. That is when default args are not explicitly passed. These files will facilitate as ground for extracting the example snippets from non env overloads from doxygen to literalincludes later on.