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

algorithm,memory: Add *_n versions of algorithms and cleanup destroy #299

Closed stotko closed 2 years ago

stotko commented 2 years ago

The recently added algorithms cover most use cases to abstract over for_each_index. However, their signatures are not always consistent and the *_n versions are also missing. Clean up these inconsistencies and also port destroy away from thrust's for_each. Furthermore, use perfect forwarding and add the respective unit tests. This ensures that, although the algorithm module should be kept minimal, all relevant variants are provided.

Partially addresses #279

codecov[bot] commented 2 years ago

Codecov Report

Merging #299 (bcbc573) into master (33d2b53) will increase coverage by 0.01%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #299      +/-   ##
==========================================
+ Coverage   97.47%   97.49%   +0.01%     
==========================================
  Files          31       31              
  Lines        2300     2318      +18     
==========================================
+ Hits         2242     2260      +18     
  Misses         58       58              
Impacted Files Coverage Δ
src/stdgpu/impl/algorithm_detail.h 100.00% <100.00%> (ø)
src/stdgpu/impl/deque_detail.cuh 94.49% <100.00%> (+0.10%) :arrow_up:
src/stdgpu/impl/memory_detail.h 99.03% <100.00%> (+0.04%) :arrow_up:
src/stdgpu/impl/vector_detail.cuh 94.87% <100.00%> (+0.02%) :arrow_up:

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 33d2b53...bcbc573. Read the comment docs.