1717#include < thrust/device_vector.h>
1818#include < thrust/equal.h>
1919#include < thrust/execution_policy.h>
20- #include < thrust/fill.h>
2120#include < thrust/sequence.h>
2221
2322#include < cuda/cmath>
@@ -60,22 +59,22 @@ void test_copy_if(const Policy& policy, const thrust::device_vector<int>& input,
6059
6160 { // Same input output type
6261 { // With random_access iterator
63- thrust:: fill (output.begin (), output.end (), -1 );
62+ cuda::std:: fill (policy, output.begin (), output.end (), -1 );
6463 const auto res = cuda::std::copy_if (
6564 policy, cuda::counting_iterator{0 }, cuda::counting_iterator{size}, output.begin (), is_even{});
6665 CHECK (thrust::equal (output.begin (), output.end (), cuda::strided_iterator{cuda::counting_iterator{0 }, 2 }));
6766 CHECK (res == output.end ());
6867 }
6968
7069 { // With contiguous iterator
71- thrust:: fill (output.begin (), output.end (), -1 );
70+ cuda::std:: fill (policy, output.begin (), output.end (), -1 );
7271 const auto res = cuda::std::copy_if (policy, input.begin (), input.end (), output.begin (), is_even{});
7372 CHECK (thrust::equal (output.begin (), output.end (), cuda::strided_iterator{cuda::counting_iterator{0 }, 2 }));
7473 CHECK (res == output.end ());
7574 }
7675
7776 { // With pointer
78- thrust:: fill (output.begin (), output.end (), -1 );
77+ cuda::std:: fill (policy, output.begin (), output.end (), -1 );
7978 auto ptr = thrust::raw_pointer_cast (input.data ());
8079 const auto res = cuda::std::copy_if (policy, ptr, ptr + size, output.begin (), is_even{});
8180 CHECK (thrust::equal (output.begin (), output.end (), cuda::strided_iterator{cuda::counting_iterator{0 }, 2 }));
@@ -84,7 +83,7 @@ void test_copy_if(const Policy& policy, const thrust::device_vector<int>& input,
8483 }
8584
8685 { // Different input type
87- thrust:: fill (output.begin (), output.end (), -1 );
86+ cuda::std:: fill (policy, output.begin (), output.end (), -1 );
8887 const auto res = cuda::std::copy_if (
8988 policy, cuda::counting_iterator{short {0 }}, cuda::counting_iterator{short {size}}, output.begin (), is_even{});
9089 CHECK (thrust::equal (output.begin (), output.end (), cuda::strided_iterator{cuda::counting_iterator{0 }, 2 }));
0 commit comments