Skip to content

Commit

Permalink
NVHPC workarounds
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Feb 5, 2025
1 parent 28fd6ca commit 0162945
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions thrust/testing/transform_iterator.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#include <cuda/__cccl_config>

#if _CCCL_COMPILER(NVHPC)
// suppress warnings on thrust::identity
_CCCL_SUPPRESS_DEPRECATED_PUSH
#endif // _CCCL_COMPILER(NVHPC)

#include <thrust/copy.h>
#include <thrust/functional.h>
#include <thrust/iterator/counting_iterator.h>
Expand All @@ -11,6 +18,10 @@

#include <unittest/unittest.h>

#if _CCCL_COMPILER(NVHPC)
_CCCL_SUPPRESS_DEPRECATED_POP
#endif // _CCCL_COMPILER(NVHPC)

template <class Vector>
void TestTransformIterator()
{
Expand Down
5 changes: 5 additions & 0 deletions thrust/testing/type_traits.cu
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <thrust/tuple.h>
#include <thrust/type_traits/is_contiguous_iterator.h>

#include <cuda/__cccl_config>

#if _CCCL_COMPILER(GCC, >=, 7)
// This header pulls in an unsuppressable warning on GCC 6
# include <cuda/std/complex>
Expand Down Expand Up @@ -46,9 +48,12 @@ void TestIsContiguousIterator()

ASSERT_EQUAL((bool) thrust::is_contiguous_iterator<ConstantIterator>::value, false);
ASSERT_EQUAL((bool) thrust::is_contiguous_iterator<CountingIterator>::value, false);
#if !_CCCL_COMPILER(NVHPC)
// thrust::identity creates a deprecated warning that could not be worked around
_CCCL_SUPPRESS_DEPRECATED_PUSH
ASSERT_EQUAL((bool) thrust::is_contiguous_iterator<TransformIterator1>::value, false);
_CCCL_SUPPRESS_DEPRECATED_POP
#endif // !_CCCL_COMPILER(NVHPC)
ASSERT_EQUAL((bool) thrust::is_contiguous_iterator<TransformIterator2>::value, false);
ASSERT_EQUAL((bool) thrust::is_contiguous_iterator<ZipIterator>::value, false);
}
Expand Down

0 comments on commit 0162945

Please sign in to comment.