stotko / stdgpu

stdgpu: Efficient STL-like Data Structures on the GPU
https://stotko.github.io/stdgpu/
Apache License 2.0
1.16k stars 83 forks source link

numeric: Add transform_reduce_index #301

Closed stotko closed 2 years ago

stotko commented 2 years ago

Another common pattern of the used algorithms is general reduction of set of value. These values could hypothetically be computed in a parallel manner using for_each_index over a range of indices [0, N). Therefore, add transform_reduce_index as the analogue of the indexed for loop which additionally reduces the computed values and port all away from thrust's transform_reduce.

Partially addresses https://github.com/stotko/stdgpu/issues/279

codecov[bot] commented 2 years ago

Codecov Report

Merging #301 (388c54a) into master (5ff0572) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #301   +/-   ##
=======================================
  Coverage   97.49%   97.50%           
=======================================
  Files          32       32           
  Lines        2318     2326    +8     
=======================================
+ Hits         2260     2268    +8     
  Misses         58       58           
Impacted Files Coverage Δ
src/stdgpu/impl/algorithm_detail.h 100.00% <ø> (ø)
src/stdgpu/impl/bitset_detail.cuh 100.00% <100.00%> (ø)
src/stdgpu/impl/numeric_detail.h 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5ff0572...388c54a. Read the comment docs.