-
Notifications
You must be signed in to change notification settings - Fork 217
[CUDAX] Add in_place_type argument to pass-through constructor of shared resource #4714
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
Merged
pciolkosz
merged 4 commits into
NVIDIA:main
from
pciolkosz:remove_direct_shared_resource_constructor
May 19, 2025
Merged
[CUDAX] Add in_place_type argument to pass-through constructor of shared resource #4714
pciolkosz
merged 4 commits into
NVIDIA:main
from
pciolkosz:remove_direct_shared_resource_constructor
May 19, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🟨 CI finished in 19m 04s: Pass: 88%/26 | Total: 2h 46m | Avg: 6m 24s | Max: 14m 46s | Hits: 94%/12884
|
Project | |
---|---|
CCCL Infrastructure | |
libcu++ | |
CUB | |
Thrust | |
+/- | CUDA Experimental |
stdpar | |
python | |
CCCL C Parallel Library | |
Catch2Helper |
Modifications in project or dependencies?
Project | |
---|---|
CCCL Infrastructure | |
libcu++ | |
CUB | |
Thrust | |
+/- | CUDA Experimental |
stdpar | |
python | |
CCCL C Parallel Library | |
Catch2Helper |
🏃 Runner counts (total jobs: 26)
# | Runner |
---|---|
17 | linux-amd64-cpu16 |
4 | linux-arm64-cpu16 |
2 | windows-amd64-cpu16 |
2 | linux-amd64-gpu-rtx2080-latest-1 |
1 | linux-amd64-gpu-h100-latest-1 |
🟩 CI finished in 20m 38s: Pass: 100%/26 | Total: 2h 28m | Avg: 5m 42s | Max: 13m 40s | Hits: 99%/14642
|
Project | |
---|---|
CCCL Infrastructure | |
libcu++ | |
CUB | |
Thrust | |
+/- | CUDA Experimental |
stdpar | |
python | |
CCCL C Parallel Library | |
Catch2Helper |
Modifications in project or dependencies?
Project | |
---|---|
CCCL Infrastructure | |
libcu++ | |
CUB | |
Thrust | |
+/- | CUDA Experimental |
stdpar | |
python | |
CCCL C Parallel Library | |
Catch2Helper |
🏃 Runner counts (total jobs: 26)
# | Runner |
---|---|
17 | linux-amd64-cpu16 |
4 | linux-arm64-cpu16 |
2 | windows-amd64-cpu16 |
2 | linux-amd64-gpu-rtx2080-latest-1 |
1 | linux-amd64-gpu-h100-latest-1 |
ericniebler
reviewed
May 15, 2025
template <class... _Args> | ||
explicit shared_resource(_Args&&... __args) | ||
: __control_block(new _Control_block{_Resource{_CUDA_VSTD::forward<_Args>(__args)...}, 1}) | ||
{} |
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 have a weak preference for keeping this constructor but making its first argument cuda::std::in_place_type_t<_Resource>
.
🟩 CI finished in 20m 54s: Pass: 100%/26 | Total: 2h 45m | Avg: 6m 20s | Max: 14m 42s | Hits: 95%/14642
|
Project | |
---|---|
CCCL Infrastructure | |
libcu++ | |
CUB | |
Thrust | |
+/- | CUDA Experimental |
stdpar | |
python | |
CCCL C Parallel Library | |
Catch2Helper |
Modifications in project or dependencies?
Project | |
---|---|
CCCL Infrastructure | |
libcu++ | |
CUB | |
Thrust | |
+/- | CUDA Experimental |
stdpar | |
python | |
CCCL C Parallel Library | |
Catch2Helper |
🏃 Runner counts (total jobs: 26)
# | Runner |
---|---|
17 | linux-amd64-cpu16 |
4 | linux-arm64-cpu16 |
2 | windows-amd64-cpu16 |
2 | linux-amd64-gpu-rtx2080-latest-1 |
1 | linux-amd64-gpu-h100-latest-1 |
miscco
approved these changes
May 16, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Copy constructor of
shared_resource
doesn't work correctly right now, because for non-const argument the constructor that passed-through the arguments to the resource constructor is picked by overload resolution instead.There might be a way to restrict that constructor to fix the overload resolution, but we already havemake_shared_resource
that does pretty much the same thing and avoids this issue. This PR proposes removal of the problematic pass-through constructor that will make the copy constructor work properly.This PR adds
in_place_type
argument to the pass-throughshared_resource
constructor to avoid issues with overload resolution and enable CTAD.