-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new type-erased memory resources #2824
base: main
Are you sure you want to change the base?
Conversation
… an interface description
cedd671
to
a278c34
Compare
cudax/include/cuda/experimental/__memory_resource/any_resource2.cuh
Outdated
Show resolved
Hide resolved
cudax/include/cuda/experimental/__memory_resource/any_resource2.cuh
Outdated
Show resolved
Hide resolved
cudax/include/cuda/experimental/__memory_resource/any_resource2.cuh
Outdated
Show resolved
Hide resolved
🟨 CI finished in 51m 18s: Pass: 83%/54 | Total: 4h 04m | Avg: 4m 31s | Max: 17m 30s
|
Project | |
---|---|
CCCL Infrastructure | |
libcu++ | |
CUB | |
Thrust | |
+/- | CUDA Experimental |
python | |
CCCL C Parallel Library | |
Catch2Helper |
Modifications in project or dependencies?
Project | |
---|---|
CCCL Infrastructure | |
libcu++ | |
CUB | |
Thrust | |
+/- | CUDA Experimental |
python | |
CCCL C Parallel Library | |
Catch2Helper |
🏃 Runner counts (total jobs: 54)
# | Runner |
---|---|
43 | linux-amd64-cpu16 |
5 | linux-amd64-gpu-v100-latest-1 |
4 | linux-arm64-cpu16 |
2 | windows-amd64-cpu16 |
🟨 CI finished in 21m 24s: Pass: 92%/54 | Total: 4h 09m | Avg: 4m 36s | Max: 17m 09s
|
Project | |
---|---|
CCCL Infrastructure | |
libcu++ | |
CUB | |
Thrust | |
+/- | CUDA Experimental |
python | |
CCCL C Parallel Library | |
Catch2Helper |
Modifications in project or dependencies?
Project | |
---|---|
CCCL Infrastructure | |
libcu++ | |
CUB | |
Thrust | |
+/- | CUDA Experimental |
python | |
CCCL C Parallel Library | |
Catch2Helper |
🏃 Runner counts (total jobs: 54)
# | Runner |
---|---|
43 | linux-amd64-cpu16 |
5 | linux-amd64-gpu-v100-latest-1 |
4 | linux-arm64-cpu16 |
2 | windows-amd64-cpu16 |
cudax/include/cuda/experimental/__memory_resource/any_resource2.cuh
Outdated
Show resolved
Hide resolved
🟨 CI finished in 56m 46s: Pass: 92%/54 | Total: 3h 47m | Avg: 4m 12s | Max: 17m 50s | Hits: 87%/254
|
Project | |
---|---|
CCCL Infrastructure | |
libcu++ | |
CUB | |
Thrust | |
+/- | CUDA Experimental |
python | |
CCCL C Parallel Library | |
Catch2Helper |
Modifications in project or dependencies?
Project | |
---|---|
CCCL Infrastructure | |
libcu++ | |
CUB | |
Thrust | |
+/- | CUDA Experimental |
python | |
CCCL C Parallel Library | |
Catch2Helper |
🏃 Runner counts (total jobs: 54)
# | Runner |
---|---|
43 | linux-amd64-cpu16 |
5 | linux-amd64-gpu-v100-latest-1 |
4 | linux-arm64-cpu16 |
2 | windows-amd64-cpu16 |
🟨 CI finished in 2h 14m: Pass: 98%/396 | Total: 2d 05h | Avg: 8m 02s | Max: 57m 49s | Hits: 84%/22084
|
Project | |
---|---|
CCCL Infrastructure | |
+/- | libcu++ |
CUB | |
Thrust | |
+/- | CUDA Experimental |
python | |
CCCL C Parallel Library | |
Catch2Helper |
Modifications in project or dependencies?
Project | |
---|---|
CCCL Infrastructure | |
+/- | libcu++ |
+/- | CUB |
+/- | Thrust |
+/- | CUDA Experimental |
+/- | python |
+/- | CCCL C Parallel Library |
+/- | Catch2Helper |
🏃 Runner counts (total jobs: 396)
# | Runner |
---|---|
327 | linux-amd64-cpu16 |
28 | linux-arm64-cpu16 |
26 | linux-amd64-gpu-v100-latest-1 |
15 | windows-amd64-cpu16 |
🟩 CI finished in 3h 38m: Pass: 100%/396 | Total: 2d 05h | Avg: 8m 02s | Max: 57m 49s | Hits: 84%/22084
|
Project | |
---|---|
CCCL Infrastructure | |
+/- | libcu++ |
CUB | |
Thrust | |
+/- | CUDA Experimental |
python | |
CCCL C Parallel Library | |
Catch2Helper |
Modifications in project or dependencies?
Project | |
---|---|
CCCL Infrastructure | |
+/- | libcu++ |
+/- | CUB |
+/- | Thrust |
+/- | CUDA Experimental |
+/- | python |
+/- | CCCL C Parallel Library |
+/- | Catch2Helper |
🏃 Runner counts (total jobs: 396)
# | Runner |
---|---|
327 | linux-amd64-cpu16 |
28 | linux-arm64-cpu16 |
26 | linux-amd64-gpu-v100-latest-1 |
15 | windows-amd64-cpu16 |
🟩 CI finished in 2h 08m: Pass: 100%/396 | Total: 7d 14h | Avg: 27m 37s | Max: 1h 11m | Hits: 61%/22104
|
Project | |
---|---|
CCCL Infrastructure | |
+/- | libcu++ |
CUB | |
Thrust | |
+/- | CUDA Experimental |
python | |
CCCL C Parallel Library | |
Catch2Helper |
Modifications in project or dependencies?
Project | |
---|---|
CCCL Infrastructure | |
+/- | libcu++ |
+/- | CUB |
+/- | Thrust |
+/- | CUDA Experimental |
+/- | python |
+/- | CCCL C Parallel Library |
+/- | Catch2Helper |
🏃 Runner counts (total jobs: 396)
# | Runner |
---|---|
327 | linux-amd64-cpu16 |
28 | linux-arm64-cpu16 |
26 | linux-amd64-gpu-v100-latest-1 |
15 | windows-amd64-cpu16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The memory resource part looks good.
I will try to review the basic_any part in its PR too
@@ -8,27 +8,39 @@ | |||
// | |||
//===----------------------------------------------------------------------===// | |||
|
|||
#include <cuda/experimental/memory_resource.cuh> | |||
#ifndef __CUDA_ARCH__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the type-erased memory resources are host-only, no?
using any_async_resource::basic_any::basic_any; | ||
|
||
private: | ||
static_assert(_CUDA_VMR::__contains_execution_space_property<_Properties...>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering since the sliced off properties are now accessible with the try_get_property
if we could drop this requirement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No because we can slice of additional properties but those need to remain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i lean towards "no". @miscco?
🟨 CI finished in 4h 15m: Pass: 99%/396 | Total: 3d 01h | Avg: 11m 11s | Max: 1h 41m | Hits: 69%/21812
|
Project | |
---|---|
CCCL Infrastructure | |
+/- | libcu++ |
CUB | |
Thrust | |
+/- | CUDA Experimental |
python | |
CCCL C Parallel Library | |
Catch2Helper |
Modifications in project or dependencies?
Project | |
---|---|
CCCL Infrastructure | |
+/- | libcu++ |
+/- | CUB |
+/- | Thrust |
+/- | CUDA Experimental |
+/- | python |
+/- | CCCL C Parallel Library |
+/- | Catch2Helper |
🏃 Runner counts (total jobs: 396)
# | Runner |
---|---|
327 | linux-amd64-cpu16 |
28 | linux-arm64-cpu16 |
26 | linux-amd64-gpu-v100-latest-1 |
15 | windows-amd64-cpu16 |
// `any_resource` wraps any given resource that satisfies the required | ||
// properties. It owns the contained resource, taking care of construction / | ||
// destruction. This makes it especially suited for use in e.g. container types | ||
// that need to ensure that the lifetime of the container exceeds the lifetime | ||
// of the memory resource used to allocate the storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: Should this be a proper doxygen documentation?
using any_async_resource::basic_any::basic_any; | ||
|
||
private: | ||
static_assert(_CUDA_VMR::__contains_execution_space_property<_Properties...>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No because we can slice of additional properties but those need to remain
🟩 CI finished in 3h 02m: Pass: 100%/396 | Total: 2d 01h | Avg: 7m 31s | Max: 41m 58s | Hits: 91%/22136
|
Project | |
---|---|
CCCL Infrastructure | |
+/- | libcu++ |
CUB | |
Thrust | |
+/- | CUDA Experimental |
python | |
CCCL C Parallel Library | |
Catch2Helper |
Modifications in project or dependencies?
Project | |
---|---|
CCCL Infrastructure | |
+/- | libcu++ |
+/- | CUB |
+/- | Thrust |
+/- | CUDA Experimental |
+/- | python |
+/- | CCCL C Parallel Library |
+/- | Catch2Helper |
🏃 Runner counts (total jobs: 396)
# | Runner |
---|---|
327 | linux-amd64-cpu16 |
28 | linux-arm64-cpu16 |
26 | linux-amd64-gpu-v100-latest-1 |
15 | windows-amd64-cpu16 |
🟩 CI finished in 2h 41m: Pass: 100%/396 | Total: 1d 22h | Avg: 7m 02s | Max: 1h 26m | Hits: 98%/22136
|
Project | |
---|---|
CCCL Infrastructure | |
+/- | libcu++ |
CUB | |
Thrust | |
+/- | CUDA Experimental |
python | |
CCCL C Parallel Library | |
Catch2Helper |
Modifications in project or dependencies?
Project | |
---|---|
CCCL Infrastructure | |
+/- | libcu++ |
+/- | CUB |
+/- | Thrust |
+/- | CUDA Experimental |
+/- | python |
+/- | CCCL C Parallel Library |
+/- | Catch2Helper |
🏃 Runner counts (total jobs: 396)
# | Runner |
---|---|
327 | linux-amd64-cpu16 |
28 | linux-arm64-cpu16 |
26 | linux-amd64-gpu-v100-latest-1 |
15 | windows-amd64-cpu16 |
Description
this PR reimplements
cudax::mr::any_resource
and adds a newcudax::mr::resource_ref
. they both pass their existing regressions tests without modification. the new types also provide atry_get_property
function that can retrieve a property that was "sliced off" during an interface-narrowing conversion.neither
cudax::mr::any_resource
norcudax::mr::resource_ref
need to store the vtable entries for the properties in-situ, which results in a space savings proportional to the number of properties.there is extra code to make
cudax::mr::any_resource
efficiently convertible to the existingcuda::mr::resource_ref
.Checklist