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

memory: Add uninitialized_copy and uninitialized_fill #298

Closed stotko closed 2 years ago

stotko commented 2 years ago

One remaining non-trivial use case of thrust::for_each is the unit test of unordered_map and unordered_set where the range function is checked. Since the value type of unordered_map is not assignable, the recently introduced copy in #297 cannot be used. Add uninitialized_copy and uninitialized_fill as the corresponding versions that use the copy constructor rather than copy assignment and port this use case to the new functions. This also exposes the so-far hidden uninitialized_fill function and adds respective unit tests for it.

Partially addresses #279

codecov[bot] commented 2 years ago

Codecov Report

Merging #298 (3347ae4) into master (fb64a4f) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #298   +/-   ##
=======================================
  Coverage   97.46%   97.47%           
=======================================
  Files          31       31           
  Lines        2292     2300    +8     
=======================================
+ Hits         2234     2242    +8     
  Misses         58       58           
Impacted Files Coverage Δ
src/stdgpu/impl/memory_detail.h 98.98% <100.00%> (+0.04%) :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 fb64a4f...3347ae4. Read the comment docs.