Skip to content

Commit

Permalink
Fix nvcc 11.1 ICE
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Jan 27, 2025
1 parent 7a89fda commit ac8d2da
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions cub/test/catch2_test_iterator.cu
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@

#include <cuda/__cccl_config>

// with NVHPC we get deprecation warnings originating from instantiations from cudafe1.stub.c, so we have to bulk
// suppress all deprecation warnings in this file (without a matching pop)
#if _CCCL_COMPILER(NVHPC)
// we get deprecation warnings from all kinds of places (including cudafe1.stub.c)), so just bulk suppress them
_CCCL_SUPPRESS_DEPRECATED_PUSH
#endif

#include <cub/iterator/arg_index_input_iterator.cuh>
#include <cub/iterator/cache_modified_input_iterator.cuh>
Expand Down Expand Up @@ -99,10 +96,8 @@ __global__ void test_iterator_kernel(InputIteratorT d_in, T* d_out, InputIterato
d_itrs[1] = d_in; // Iterator at offset 0
}

_CCCL_SUPPRESS_DEPRECATED_PUSH
template <typename InputIteratorT, typename T>
void test_iterator(InputIteratorT d_in, const c2h::host_vector<T>& h_reference) //
_CCCL_SUPPRESS_DEPRECATED_POP
void test_iterator(InputIteratorT d_in, const c2h::host_vector<T>& h_reference)
{
c2h::device_vector<T> d_out(h_reference.size());
c2h::device_vector<InputIteratorT> d_itrs(2, d_in); // TODO(bgruber): using a raw allocation halves the compile time
Expand All @@ -123,9 +118,7 @@ C2H_TEST("Test constant iterator", "[iterator]", scalar_types)
using T = c2h::get<0, TestType>;
const T base = static_cast<T>(GENERATE(0, 99));
const auto h_reference = c2h::host_vector<T>{base, base, base, base, base, base, base, base};
_CCCL_SUPPRESS_DEPRECATED_PUSH
test_iterator(cub::ConstantInputIterator<T>(base), h_reference);
_CCCL_SUPPRESS_DEPRECATED_POP
}

C2H_TEST("Test counting iterator", "[iterator]", scalar_types)
Expand All @@ -141,9 +134,7 @@ C2H_TEST("Test counting iterator", "[iterator]", scalar_types)
static_cast<T>(base + 21),
static_cast<T>(base + 11),
static_cast<T>(base + 0)};
_CCCL_SUPPRESS_DEPRECATED_PUSH
test_iterator(cub::CountingInputIterator<T>(base), h_reference);
_CCCL_SUPPRESS_DEPRECATED_POP
}

using cache_modifiers =
Expand Down Expand Up @@ -201,11 +192,9 @@ C2H_TEST("Test transform iterator", "[iterator]", types)
op(h_data[21]),
op(h_data[11]),
op(h_data[0])};
_CCCL_SUPPRESS_DEPRECATED_PUSH
test_iterator(cub::TransformInputIterator<T, transform_op_t<T>, const T*>(
const_cast<const T*>(const_cast<const T*>(thrust::raw_pointer_cast(d_data.data()))), op),
h_reference);
_CCCL_SUPPRESS_DEPRECATED_POP
}

C2H_TEST("Test tex-obj texture iterator", "[iterator]", types)
Expand Down Expand Up @@ -249,9 +238,7 @@ C2H_TEST("Test texture transform iterator", "[iterator]", types)
TextureIterator d_tex_itr;
CubDebugExit(
d_tex_itr.BindTexture(const_cast<const T*>(thrust::raw_pointer_cast(d_data.data())), sizeof(T) * TEST_VALUES));
_CCCL_SUPPRESS_DEPRECATED_PUSH
cub::TransformInputIterator<T, transform_op_t<T>, TextureIterator> xform_itr(d_tex_itr, op);
_CCCL_SUPPRESS_DEPRECATED_POP
test_iterator(xform_itr, h_reference);
CubDebugExit(d_tex_itr.UnbindTexture());
}

0 comments on commit ac8d2da

Please sign in to comment.