Skip to content

Fix recursive constraint satisfaction in resource_ref construction fr…#8039

Closed
Adityakk9031 wants to merge 1 commit intoNVIDIA:mainfrom
Adityakk9031:#8037
Closed

Fix recursive constraint satisfaction in resource_ref construction fr…#8039
Adityakk9031 wants to merge 1 commit intoNVIDIA:mainfrom
Adityakk9031:#8037

Conversation

@Adityakk9031
Copy link
Copy Markdown

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.

@Adityakk9031 Adityakk9031 requested a review from a team as a code owner March 16, 2026 02:38
@Adityakk9031 Adityakk9031 requested a review from wmaxey March 16, 2026 02:38
@github-project-automation github-project-automation bot moved this to Todo in CCCL Mar 16, 2026
@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot bot commented Mar 16, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Review in CCCL Mar 16, 2026
ericniebler added a commit to ericniebler/cccl that referenced this pull request Mar 20, 2026
Copy link
Copy Markdown
Contributor

@ericniebler ericniebler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the wrong fix. it doesn't address the root of the issue, which i describe (and fix) in #8121.

@github-project-automation github-project-automation bot moved this from In Review to In Progress in CCCL Mar 20, 2026
@github-project-automation github-project-automation bot moved this from In Progress to Done in CCCL Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Recursive constraint satisfaction when constructing resource_ref from shared_resource-derived type with resource_ref constructor

2 participants