File size: 548 Bytes
be11144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <unittest/unittest.h>
#include <thrust/system/cuda/experimental/pinned_allocator.h>
#include <thrust/host_vector.h>
#include <thrust/copy.h>

template <typename T>
void TestPinnedAllocatorSimple(const size_t n)
{
  typedef thrust::host_vector<T, thrust::cuda::experimental::pinned_allocator<T> > Vector;

  Vector h_input = unittest::random_integers<T>(n);
  Vector h_output(n);

  thrust::copy(h_input.begin(), h_input.end(), h_output.begin());

  ASSERT_EQUAL(h_input, h_output);
}
DECLARE_VARIABLE_UNITTEST(TestPinnedAllocatorSimple);