Skip to content

Fix non-nvcc Thrust compilation#108

Open
pdziekan wants to merge 10 commits into
boostorg:developfrom
pdziekan:Thrust_2
Open

Fix non-nvcc Thrust compilation#108
pdziekan wants to merge 10 commits into
boostorg:developfrom
pdziekan:Thrust_2

Conversation

@pdziekan
Copy link
Copy Markdown

@pdziekan pdziekan commented May 29, 2026

Fixes #109

Copilot AI review requested due to automatic review settings May 29, 2026 07:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Replaces CUDA-specific __host__ __device__ annotations with the CCCL portable macro _CCCL_HOST_DEVICE across the thrust integration code, examples, and documentation.

Changes:

  • Swap __host__ __device__ for _CCCL_HOST_DEVICE in thrust algebra/operations headers.
  • Update thrust example .cu files to use the new macro.
  • Update tutorial documentation accordingly.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
include/boost/numeric/odeint/external/thrust/thrust_operations.hpp Replace CUDA annotations with _CCCL_HOST_DEVICE macro in all operation functors.
include/boost/numeric/odeint/external/thrust/thrust_algebra.hpp Replace CUDA annotations in maximum functor.
examples/thrust/relaxation.cu Use _CCCL_HOST_DEVICE in the relaxation functor.
examples/thrust/phase_oscillator_ensemble.cu Use _CCCL_HOST_DEVICE in sin/cos/sys functors.
examples/thrust/phase_oscillator_chain.cu Use _CCCL_HOST_DEVICE in sys_functor.
examples/thrust/lorenz_parameters.cu Use _CCCL_HOST_DEVICE in Lorenz functors.
doc/tutorial_thrust_cuda.qbk Update tutorial to reflect new macro usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


template< class Tuple >
__host__ __device__
_CCCL_HOST_DEVICE
[thrust_phase_ensemble_mean_field_calculator]

Inside this class two member structures `sin_functor` and `cos_functor` are defined. They compute the sine and the cosine of a value and they are used within a transform iterator to calculate the sum of ['sin(__phi[subl k])] and ['cos(__phi[subl k])]. The classifiers `__host__` and `__device__` are CUDA specific and define a function or operator which can be executed on the GPU as well as on the CPU. The line
Inside this class two member structures `sin_functor` and `cos_functor` are defined. They compute the sine and the cosine of a value and they are used within a transform iterator to calculate the sum of ['sin(__phi[subl k])] and ['cos(__phi[subl k])]. The macro '_CCCL_HOST_DEVICE' defines a function or operator which can be executed on the GPU as well as on the CPU if compiled with nvcc. The line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Thrust compilation fails for non-nvcc compilers

4 participants