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 (de)allocatate_filled functions to allocator_traits #362

Closed stotko closed 1 year ago

stotko commented 1 year ago

Although the memory module already supports custom allocators making it quite generic, the more advanced API related to automatically filled arrays still uses the default execution policies. Extend allocator_traits by allocate_filled and deallocate_filled functions that additionally take an execution policy as well as an initialization value as their arguments. This consolidates all required allocation functions in the traits and follows the recommended usage from the C++ standard.

Issue: #351

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01 :tada:

Comparison is base (bc3adae) 97.23% compared to head (914894e) 97.24%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #362 +/- ## ========================================== + Coverage 97.23% 97.24% +0.01% ========================================== Files 31 31 Lines 2421 2430 +9 ========================================== + Hits 2354 2363 +9 Misses 67 67 ``` | [Impacted Files](https://app.codecov.io/gh/stotko/stdgpu/pull/362?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Patrick+Stotko) | Coverage Δ | | |---|---|---| | [src/stdgpu/impl/memory\_detail.h](https://app.codecov.io/gh/stotko/stdgpu/pull/362?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Patrick+Stotko#diff-c3JjL3N0ZGdwdS9pbXBsL21lbW9yeV9kZXRhaWwuaA==) | `99.19% <100.00%> (+0.03%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.