I’m facing an issue with a CUDA project that was previously compiling and running successfully. After pulling the latest code from GitLab, I’m now encountering a static_assert
error from the Thrust library. I’m at a loss as to what might have changed, as the environment and codebase were working fine before.
Environment:
- Operating System: Windows 10
- Compiler: Visual Studio 2022
- CUDA Toolkit Version: 11.7
The project consists of both .cpp
and .cu
files. It was previously configured and confirmed to compile and run without issues. After pulling the latest code from GitLab, I’m now getting the following error during compilation:
C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.7includethrustsystemdetailgenericsort.inl(190,3): error C2338: static_assert failed: 'unimplemented for this system'
The error points to a THRUST_STATIC_ASSERT_MSG
within the stable_sort
function template in Thrust.
template<typename DerivedPolicy,
typename RandomAccessIterator,
typename StrictWeakOrdering>
__host__ __device__
void stable_sort(thrust::execution_policy<DerivedPolicy> &,
RandomAccessIterator,
RandomAccessIterator,
StrictWeakOrdering)
{
THRUST_STATIC_ASSERT_MSG(
(thrust::detail::depend_on_instantiation<RandomAccessIterator, false>::value)
, "unimplemented for this system"
);
} // end stable_sort()
I’ve confirmed that the code was working before the Git pull. I reviewed the project settings and properties but found no apparent changes.
Could this error be due to a change in the project configuration or the environment? Is there something specific in the Visual Studio 2022 project properties that I should check or reset? Alternatively, is there a modification I can make to the code to resolve this static_assert
error?
4