Fix CUDA 13.1 compile failure: use trailing return types for dependent name resolution#75
Draft
Fix CUDA 13.1 compile failure: use trailing return types for dependent name resolution#75
Conversation
…t name resolution In the 4 affected .inl files, the out-of-class operator= definitions used a leading return type that appears before the class scope qualifier. CUDA 13.1's cudafe++ has stricter dependent name resolution and doesn't match ComputeGraphVar<XxxView<T>>& against the declaration's ComputeGraphVar<VarType>& where VarType is a dependent type alias. The fix uses trailing return types (auto ... -> ComputeGraphVar<VarType>&) so that VarType is resolved within the class scope, matching the header declarations. Co-authored-by: MuGdxy <52098265+MuGdxy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix compile failure about dependent names resolve using CUDA 13.1
Fix CUDA 13.1 compile failure: use trailing return types for dependent name resolution
Mar 7, 2026
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.
CUDA 13.1's
cudafe++fails to match the leading return typeComputeGraphVar<XxxView<T>>&(written before the scope qualifier) against the declaration'sComputeGraphVar<VarType>&whereVarTypeis a dependent type alias. This affects all fourComputeGraphVarpartial specialization.inlfiles.VarTyperesolves within class scope:graph_var_view.inl,graph_buffer_view.inl,graph_buffer_2d_view.inl,graph_buffer_3d_view.inlOriginal prompt
This section details on the original issue you should resolve
<issue_title>Compile failure about the dependent names resolve using CUDA 13.1</issue_title>
<issue_description>## What happened
Environment:
Compiling muda with the tools above:
nvcc reports:
According to the test, the following files have the same problem:
graph_buffer_2d_view.inlgraph_buffer_3d_view.inlgraph_buffer_view.inlgraph_var_view.inlPossible reason
Here is a snippet that could make nvcc report the same error:
Compile the snippet with command