stotko / stdgpu

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

memory: Add constructor for empty device_unique_object #402

Closed stotko closed 1 year ago

stotko commented 1 year ago

In #391, a new wrapper class for automatically managing device objects has been introduced. However, empty managed object can not be constructed which prohibits use cases where, e.g., such a managed object is moved. Add a respective constructor that accepts a null_object as well as an overload of operator bool() to enable testing for empty objects.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (50530de) 97.40% compared to head (ae6ead0) 97.40%.

:exclamation: Current head ae6ead0 differs from pull request most recent head 99589ee. Consider uploading reports for the commit 99589ee to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #402 +/- ## ======================================= Coverage 97.40% 97.40% ======================================= Files 31 31 Lines 2581 2586 +5 ======================================= + Hits 2514 2519 +5 Misses 67 67 ``` | [Files Changed](https://app.codecov.io/gh/stotko/stdgpu/pull/402?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/402?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Patrick+Stotko#diff-c3JjL3N0ZGdwdS9pbXBsL21lbW9yeV9kZXRhaWwuaA==) | `99.11% <100.00%> (+0.02%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.