Skip to content

Commit

Permalink
fix for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Jan 28, 2025
1 parent 7662818 commit a009a7c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions thrust/testing/cuda/transform_iterator.cu
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
#include <thrust/device_vector.h>
#include <thrust/host_vector.h>
#include <thrust/iterator/transform_iterator.h>
#include <thrust/logical.h>

#include <unittest/unittest.h>

// see also: https://github.com/NVIDIA/cccl/issues/3541
template <class Vector>
void TestTransformWithLambda()
{
using T = typename Vector::value_type;
Vector A{1, 2, 3, 4, 5, 6, 7};
const auto result = thrust::any_of(A.begin(), A.end(), [] __host__ __device__(T v) {
return v < 4;
});
ASSERT_EQUAL(result, true);
auto l = [] __host__ __device__(int v) { return v < 4; };
thrust::host_vector<int> A{1, 2, 3, 4, 5, 6, 7};
ASSERT_EQUAL(thrust::any_of(A.begin(), A.end(), l), true);

thrust::device_vector<int> B{1, 2, 3, 4, 5, 6, 7};
ASSERT_EQUAL(thrust::any_of(B.begin(), B.end(), l), true);
}

DECLARE_INTEGRAL_VECTOR_UNITTEST(TestTransformWithLambda);
DECLARE_UNITTEST(TestTransformWithLambda);

0 comments on commit a009a7c

Please sign in to comment.