Fix recursive constraint satisfaction in resource_ref construction fr…#8039
Closed
Adityakk9031 wants to merge 1 commit intoNVIDIA:mainfrom
Closed
Fix recursive constraint satisfaction in resource_ref construction fr…#8039Adityakk9031 wants to merge 1 commit intoNVIDIA:mainfrom
Adityakk9031 wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
…om shared_resource-derived types
Contributor
ericniebler
added a commit
to ericniebler/cccl
that referenced
this pull request
Mar 20, 2026
2 tasks
ericniebler
requested changes
Mar 20, 2026
Contributor
ericniebler
left a comment
There was a problem hiding this comment.
this is the wrong fix. it doesn't address the root of the issue, which i describe (and fix) in #8121.
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
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.
closes #8037
Fix a recursive constraint-satisfaction error that occurs in GCC 14+ (C++20) when constructing cuda::mr::resource_ref from a type that:
Publicly inherits from cuda::mr::shared_resource, and
Has a constructor accepting
resource_ref
Root Cause
resource_ref
was backed by __basic_any<__iasync_resource<Ps...>&>. The __iasync_resource interface includes __icopyable<>, which causes the compiler to evaluate copyable → is_constructible<T, T&> → overload resolution discovers
T(resource_ref)
→ checks if T& converts to
resource_ref
→ re-enters the original __satisfies<T, __iasync_resource<...>> check → cycle.
Fix
Introduced two new interface aliases that omit
__icopyable
:
cpp
template <class... _Properties>
using __iresource_ref = ::cuda::
__iset<__ibasic_resource<>, __iproperty_set<_Properties...>, ::cuda::__iequality_comparable<>>;
template <class... _Properties>
using __iasync_resource_ref = __iset<__iresource_ref<_Properties...>, __ibasic_async_resource<>>;
resource_ref
and synchronous_resource_ref now use these. The owning types (
any_resource
,
any_synchronous_resource
) are unchanged — they still include
__icopyable
because they own the resource by value.