Skip to content

Fix STF compilation with nvc++ as host compiler#8230

Merged
davebayer merged 4 commits intoNVIDIA:mainfrom
davebayer:fix_nvhpc_pt123123
Apr 1, 2026
Merged

Fix STF compilation with nvc++ as host compiler#8230
davebayer merged 4 commits intoNVIDIA:mainfrom
davebayer:fix_nvhpc_pt123123

Conversation

@davebayer
Copy link
Copy Markdown
Contributor

Using __NVCOMPILER caused some serious issues with extended lambdas in this case..

@davebayer davebayer requested a review from a team as a code owner March 31, 2026 10:29
@davebayer davebayer requested a review from andralex March 31, 2026 10:29
@github-project-automation github-project-automation bot moved this to Todo in CCCL Mar 31, 2026
@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Review in CCCL Mar 31, 2026
@caugonnet
Copy link
Copy Markdown
Contributor

@davebayer how can we trust the CI if nvhpc is not enabled ?

@caugonnet
Copy link
Copy Markdown
Contributor

/ok to test 4a37550

@davebayer
Copy link
Copy Markdown
Contributor Author

@davebayer how can we trust the CI if nvhpc is not enabled ?

I've tested it locally

@caugonnet caugonnet added the stf Sequential Task Flow programming model label Mar 31, 2026
Copy link
Copy Markdown
Contributor

@caugonnet caugonnet left a comment

Choose a reason for hiding this comment

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

This looks good, but it's untested in the current CI afaik ?

@davebayer
Copy link
Copy Markdown
Contributor Author

This looks good, but it's untested in the current CI afaik ?

I'm trying to finally get nvhpc back to the CI, so I need to patch these things 😅

@caugonnet
Copy link
Copy Markdown
Contributor

Sounds great, anyway at some point we must use faith :)

@davebayer davebayer enabled auto-merge (squash) March 31, 2026 13:50
void operator->*(Fun&& f)
{
# if __NVCOMPILER
# if _CCCL_CUDA_COMPILER(NVHPC)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe this is the wrong check as __NVCOMPILER checks only whether nvc++ is the host compiler

Suggested change
# if _CCCL_CUDA_COMPILER(NVHPC)
# if _CCCL_COMPILER(NVHPC)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

And that's the problem that I'm fixing 😅

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because the condition should only be true for NVC++ in CUDA mode

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this can be host code too, not just device, if we launch on the host

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

But then shouldnt the title say cuda compiler ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this can be host code too, not just device, if we launch on the host

But that's fine. The thing is that nvc++ doesn't implement any of the __nv_is_extended_meow_lambda_closure_type traits, because it doesn't need them.

But then shouldnt the title say cuda compiler?

No, because the problem occurs only when compiling CUDA source file with nvcc and nvc++ as the host compiler. Then __NVCOMPILER is defined and we suppose that all lambdas are host/device, which is not true.

@github-project-automation github-project-automation bot moved this from In Review to In Progress in CCCL Mar 31, 2026
@davebayer davebayer requested a review from miscco March 31, 2026 16:36
@github-actions
Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 45m 39s: Pass: 100%/48 | Total: 8h 29m | Max: 17m 18s | Hits: 98%/26291

See results here.

@davebayer davebayer merged commit f56459f into NVIDIA:main Apr 1, 2026
65 of 68 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in CCCL Apr 1, 2026
@davebayer davebayer deleted the fix_nvhpc_pt123123 branch April 1, 2026 06:54
gonidelis pushed a commit to gonidelis/cccl that referenced this pull request Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stf Sequential Task Flow programming model

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants