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

execution: Add is_execution_policy trait and conditionally enable policy-based functions #377

Closed stotko closed 1 year ago

stotko commented 1 year ago

All containers recently gained support for custom execution policies. However, a proper detection mechanism is still missing and also complicates proper overload resolution of member functions which may lead to confusing compilation errors. Add is_execution_policy traits to detect all policies defined by thrust and conditionally enable all policy-related member functions of the containers.

While this is a significant improvement, defining custom policies would now requires specializing is_execution_policy since the policy check does not properly detect them. However, only relying on the ones from thrust should be sufficient for now.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01 :warning:

Comparison is base (913e335) 97.37% compared to head (a1c294f) 97.36%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #377 +/- ## ========================================== - Coverage 97.37% 97.36% -0.01% ========================================== Files 31 31 Lines 2549 2547 -2 ========================================== - Hits 2482 2480 -2 Misses 67 67 ``` | [Impacted Files](https://app.codecov.io/gh/stotko/stdgpu/pull/377?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Patrick+Stotko) | Coverage Δ | | |---|---|---| | [src/stdgpu/bitset.cuh](https://app.codecov.io/gh/stotko/stdgpu/pull/377?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Patrick+Stotko#diff-c3JjL3N0ZGdwdS9iaXRzZXQuY3Vo) | `100.00% <ø> (ø)` | | | [src/stdgpu/deque.cuh](https://app.codecov.io/gh/stotko/stdgpu/pull/377?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Patrick+Stotko#diff-c3JjL3N0ZGdwdS9kZXF1ZS5jdWg=) | `100.00% <ø> (ø)` | | | [src/stdgpu/impl/atomic\_detail.cuh](https://app.codecov.io/gh/stotko/stdgpu/pull/377?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Patrick+Stotko#diff-c3JjL3N0ZGdwdS9pbXBsL2F0b21pY19kZXRhaWwuY3Vo) | `99.60% <ø> (ø)` | | | [src/stdgpu/impl/bitset\_detail.cuh](https://app.codecov.io/gh/stotko/stdgpu/pull/377?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Patrick+Stotko#diff-c3JjL3N0ZGdwdS9pbXBsL2JpdHNldF9kZXRhaWwuY3Vo) | `99.34% <ø> (ø)` | | | [src/stdgpu/impl/deque\_detail.cuh](https://app.codecov.io/gh/stotko/stdgpu/pull/377?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Patrick+Stotko#diff-c3JjL3N0ZGdwdS9pbXBsL2RlcXVlX2RldGFpbC5jdWg=) | `94.09% <ø> (ø)` | | | [src/stdgpu/impl/mutex\_detail.cuh](https://app.codecov.io/gh/stotko/stdgpu/pull/377?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Patrick+Stotko#diff-c3JjL3N0ZGdwdS9pbXBsL211dGV4X2RldGFpbC5jdWg=) | `100.00% <ø> (ø)` | | | [src/stdgpu/impl/unordered\_base.cuh](https://app.codecov.io/gh/stotko/stdgpu/pull/377?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Patrick+Stotko#diff-c3JjL3N0ZGdwdS9pbXBsL3Vub3JkZXJlZF9iYXNlLmN1aA==) | `100.00% <ø> (ø)` | | | [src/stdgpu/impl/unordered\_base\_detail.cuh](https://app.codecov.io/gh/stotko/stdgpu/pull/377?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Patrick+Stotko#diff-c3JjL3N0ZGdwdS9pbXBsL3Vub3JkZXJlZF9iYXNlX2RldGFpbC5jdWg=) | `96.27% <ø> (ø)` | | | [src/stdgpu/impl/unordered\_map\_detail.cuh](https://app.codecov.io/gh/stotko/stdgpu/pull/377?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Patrick+Stotko#diff-c3JjL3N0ZGdwdS9pbXBsL3Vub3JkZXJlZF9tYXBfZGV0YWlsLmN1aA==) | `100.00% <ø> (ø)` | | | [src/stdgpu/impl/unordered\_set\_detail.cuh](https://app.codecov.io/gh/stotko/stdgpu/pull/377?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Patrick+Stotko#diff-c3JjL3N0ZGdwdS9pbXBsL3Vub3JkZXJlZF9zZXRfZGV0YWlsLmN1aA==) | `100.00% <ø> (ø)` | | | ... and [6 more](https://app.codecov.io/gh/stotko/stdgpu/pull/377?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Patrick+Stotko) | |

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