Skip to content

[Backport branch/3.2.x] Ensure that we properly warn about device lambdas that need to query the return type - #6782

Merged
bernhardmgruber merged 2 commits into
branch/3.2.xfrom
backport-6765-to-branch/3.2.x
Nov 26, 2025
Merged

bernhardmgruber merged 2 commits into
branch/3.2.xfrom
backport-6765-to-branch/3.2.x

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Description

Backport of #6765 to branch/3.2.x.

…the return type (#6765)

* Ensure that we properly check if a device lambda is wrapped

We were checking `__nv_is_extended_device_lambda_closure_type(_Fp)` and so on, but that does not work if the device lambda is cvref-qualified

Fix this by checking `remove_cvref_t`

Fixes #6762

* Ensure that `thrust::transform_iterator` properly checks for device lambdas

Fixes [BUG]: `thrust::transform_iterator` no longer emits diagnostic when used with __device__ lambda
Fixes #6763

(cherry picked from commit 8588acb)
@copy-pr-bot

copy-pr-bot Bot commented Nov 25, 2025

Copy link
Copy Markdown
Contributor

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.

@bernhardmgruber

Copy link
Copy Markdown
Contributor

/ok to test 457f0c9

@github-actions

This comment has been minimized.

@github-project-automation github-project-automation Bot moved this from Todo to In Review in CCCL Nov 25, 2025
@bernhardmgruber
bernhardmgruber enabled auto-merge (squash) November 25, 2025 18:43
@github-actions

This comment has been minimized.

@bernhardmgruber

Copy link
Copy Markdown
Contributor

/ok to test dd16725

@github-actions

Copy link
Copy Markdown
Contributor Author

🥳 CI Workflow Results

🟩 Finished in 1h 08m: Pass: 100%/131 | Total: 18h 29m | Max: 1h 03m | Hits: 99%/307809

See results here.

@bernhardmgruber
bernhardmgruber merged commit 2f529ed into branch/3.2.x Nov 26, 2025
143 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in CCCL Nov 26, 2025
@miscco
miscco deleted the backport-6765-to-branch/3.2.x branch July 23, 2026 12:22
Naraenda pushed a commit to ROCm/rocm-libraries that referenced this pull request Oct 26, 2026
… about device lambdas that need to query the return type (NVIDIA/cccl#6765) (NVIDIA/cccl#6782)

Upstream: NVIDIA/cccl@2f529ed

HIP counterpart (system/hip): none. transform_iterator_reference now uses _THRUST_STD::invoke_result_t<UnaryFunc&, ...> (also for functional::actor) so the device-lambda return-type diagnostic fires; kept local include block (type_traits umbrella provides invoke_result_t; upstream's granular __functional/__type_traits includes not added). libcudacxx invoke.h part not applicable. test/ counterpart: none. Not compiled, tests not run (per human)

Co-Authored-By: Claude <noreply@anthropic.com>
amd-jmahovsky added a commit to ROCm/rocm-libraries that referenced this pull request Oct 28, 2026
…ludes

Related upstream commit: 2f529edf653 Ensure that we properly warn about device lambdas that need to query the return type (#6765) (NVIDIA/cccl#6782)
Related local port commit: 99ecdb9

The port kept the local include block (type_traits umbrella plus
!_THRUST_HAS_DEVICE_SYSTEM_STD fallbacks) instead of upstream's granular
includes. libhipcxx is now mandatory, so transform_iterator.h now:
- includes the upstream __functional/{identity,invoke}.h,
  __memory/construct_at.h and __type_traits/{is_copy_assignable,
  is_copy_constructible,remove_cvref,remove_reference}.h headers, dropping
  the dead fallback includes and the libcxx_wrapper construct_at.h;
- spells ::internal::remove_cvref / __destroy_at / __construct_at as
  _THRUST_STD:: like upstream's ::cuda::std::.

Not compiled, tests not run (per human)

Co-Authored-By: Claude <noreply@anthropic.com>
Naraenda pushed a commit to ROCm/rocm-libraries that referenced this pull request Oct 29, 2026
… about device lambdas that need to query the return type (NVIDIA/cccl#6765) (NVIDIA/cccl#6782)

Upstream: NVIDIA/cccl@2f529ed

HIP counterpart (system/hip): none. transform_iterator_reference now uses _THRUST_STD::invoke_result_t<UnaryFunc&, ...> (also for functional::actor) so the device-lambda return-type diagnostic fires; kept local include block (type_traits umbrella provides invoke_result_t; upstream's granular __functional/__type_traits includes not added). libcudacxx invoke.h part not applicable. test/ counterpart: none. Not compiled, tests not run (per human)

Co-Authored-By: Claude <noreply@anthropic.com>
Naraenda pushed a commit to ROCm/rocm-libraries that referenced this pull request Oct 29, 2026
… about device lambdas that need to query the return type (NVIDIA/cccl#6765) (NVIDIA/cccl#6782)

Upstream: NVIDIA/cccl@2f529ed

HIP counterpart (system/hip): none. transform_iterator_reference now uses _THRUST_STD::invoke_result_t<UnaryFunc&, ...> (also for functional::actor) so the device-lambda return-type diagnostic fires; kept local include block (type_traits umbrella provides invoke_result_t; upstream's granular __functional/__type_traits includes not added). libcudacxx invoke.h part not applicable. test/ counterpart: none. Not compiled, tests not run (per human)

Co-Authored-By: Claude <noreply@anthropic.com>
Naraenda pushed a commit to ROCm/rocm-libraries that referenced this pull request Oct 29, 2026
…ludes

Related upstream commit: 2f529edf653 Ensure that we properly warn about device lambdas that need to query the return type (#6765) (NVIDIA/cccl#6782)
Related local port commit: 99ecdb9

The port kept the local include block (type_traits umbrella plus
!_THRUST_HAS_DEVICE_SYSTEM_STD fallbacks) instead of upstream's granular
includes. libhipcxx is now mandatory, so transform_iterator.h now:
- includes the upstream __functional/{identity,invoke}.h,
  __memory/construct_at.h and __type_traits/{is_copy_assignable,
  is_copy_constructible,remove_cvref,remove_reference}.h headers, dropping
  the dead fallback includes and the libcxx_wrapper construct_at.h;
- spells ::internal::remove_cvref / __destroy_at / __construct_at as
  _THRUST_STD:: like upstream's ::cuda::std::.

Not compiled, tests not run (per human)

Co-Authored-By: Claude <noreply@anthropic.com>
Naraenda pushed a commit to ROCm/rocm-libraries that referenced this pull request Oct 30, 2026
… about device lambdas that need to query the return type (NVIDIA/cccl#6765) (NVIDIA/cccl#6782)

Upstream: NVIDIA/cccl@2f529ed

HIP counterpart (system/hip): none. transform_iterator_reference now uses _THRUST_STD::invoke_result_t<UnaryFunc&, ...> (also for functional::actor) so the device-lambda return-type diagnostic fires; kept local include block (type_traits umbrella provides invoke_result_t; upstream's granular __functional/__type_traits includes not added). libcudacxx invoke.h part not applicable. test/ counterpart: none. Not compiled, tests not run (per human)

Co-Authored-By: Claude <noreply@anthropic.com>
Beanavil pushed a commit to ROCm/rocm-libraries that referenced this pull request Oct 30, 2026
… about device lambdas that need to query the return type (NVIDIA/cccl#6765) (NVIDIA/cccl#6782)

Upstream: NVIDIA/cccl@2f529ed

HIP counterpart (system/hip): none. transform_iterator_reference now uses _THRUST_STD::invoke_result_t<UnaryFunc&, ...> (also for functional::actor) so the device-lambda return-type diagnostic fires; kept local include block (type_traits umbrella provides invoke_result_t; upstream's granular __functional/__type_traits includes not added). libcudacxx invoke.h part not applicable. test/ counterpart: none. Not compiled, tests not run (per human)

Co-Authored-By: Claude <noreply@anthropic.com>
amd-jmahovsky added a commit to ROCm/rocm-libraries that referenced this pull request Oct 30, 2026
…ludes

Related upstream commit: 2f529edf653 Ensure that we properly warn about device lambdas that need to query the return type (#6765) (NVIDIA/cccl#6782)
Related local port commit: 99ecdb9

The port kept the local include block (type_traits umbrella plus
!_THRUST_HAS_DEVICE_SYSTEM_STD fallbacks) instead of upstream's granular
includes. libhipcxx is now mandatory, so transform_iterator.h now:
- includes the upstream __functional/{identity,invoke}.h,
  __memory/construct_at.h and __type_traits/{is_copy_assignable,
  is_copy_constructible,remove_cvref,remove_reference}.h headers, dropping
  the dead fallback includes and the libcxx_wrapper construct_at.h;
- spells ::internal::remove_cvref / __destroy_at / __construct_at as
  _THRUST_STD:: like upstream's ::cuda::std::.

Not compiled, tests not run (per human)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

3 participants