[FEA] Unify square_t functors across benchmarks and tests#9635
[FEA] Unify square_t functors across benchmarks and tests#9635rkothari3 wants to merge 1 commit into
Conversation
|
The mypy pre-commit failure seems to be a pre-existing infrastructure issue ( numpy/init.pyi incompatibility with Python 3.14). Changes here are limited to .cu/.cuh files and contain no python. Happy to answer any questions! |
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds a shared Unify square functors
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes found. The Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: c1f1546c-e270-4be2-8a02-9665d1175149
📒 Files selected for processing (8)
cub/benchmarks/bench/transform_reduce/sum.cucub/test/catch2_test_device_transform_reduce.culibcudacxx/benchmarks/bench/for_each/basic.culibcudacxx/benchmarks/bench/for_each_n/basic.cunvbench_helper/nvbench_helper/nvbench_helper.cuhthrust/benchmarks/bench/for_each/basic.cuthrust/benchmarks/bench/for_each_n/basic.cuthrust/benchmarks/bench/transform_reduce/sum.cu
bernhardmgruber
left a comment
There was a problem hiding this comment.
Great work, thanks!
Description
closes #9619
Replaces locally-defined
square_tstructs withthrust::square<T>where semantically equivalent (value-returning
T operator()(const T& x)),and consolidates the in-place variant into a shared
square_inplace_tin
nvbench_helper.cuh.Value-returning
square_ttothrust::square<T>:cub/benchmarks/bench/transform_reduce/sum.cuthrust/benchmarks/bench/transform_reduce/sum.cucub/test/catch2_test_device_transform_reduce.cuIn-place
square_t<T>tosquare_inplace_t<T>(added tonvbench_helper.cuh):thrust/benchmarks/bench/for_each/basic.cuthrust/benchmarks/bench/for_each_n/basic.culibcudacxx/benchmarks/bench/for_each/basic.culibcudacxx/benchmarks/bench/for_each_n/basic.cuIntentionally not changed:
catch2_test_device_for_api.cu/for_env_api.cu:square_tis inside// example-begindocumentation tagscatch2_test_device_reduce_deterministic.cu: takesintinput, different signature fromthrust::square<T>catch2_test_device_reduce_nondeterministic.cu: already wrapsthrust::square<T>{}internallyChecklist