OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
grid_dist_id_unit_test.cu
1 #define BOOST_TEST_DYN_LINK
2 #include <boost/test/unit_test.hpp>
3 
4 #include "Point_test.hpp"
5 #include "Grid/grid_dist_id.hpp"
6 #include "data_type/aggregate.hpp"
7 
8 extern void print_test_v(std::string test, size_t sz);
9 
10 BOOST_AUTO_TEST_SUITE( grid_dist_id_test )
11 
12 
13 BOOST_AUTO_TEST_CASE( grid_dist_id_gpu_test )
14 {
15  // Test grid periodic
16 
17 /* Box<3,float> domain({-1.0,-1.0,-1.0},{1.0,1.0,1.0});
18 
19  Vcluster<> & v_cl = create_vcluster();
20 
21  if ( v_cl.getProcessingUnits() > 32 )
22  {return;}
23 
24  // grid size
25  size_t sz[3];
26  sz[0] = 32;
27  sz[1] = 32;
28  sz[2] = 32;
29 
30  // Ghost
31  Ghost<3,long int> g(1);
32 
33  // periodicity
34  periodicity<3> pr = {{PERIODIC,PERIODIC,PERIODIC}};
35 
36  // Distributed grid with id decomposition
37  grid_dist_id_gpu<3, float, aggregate<float, float>> g_dist(sz,domain,g,pr);
38 
39  Box<3,size_t> box({1,1,1},{30,30,30});
40  auto it = g_dist.getGridIterator(box.getKP1(),box.getKP2());
41 
42  float c = 5.0;
43 
44  typedef typename GetSetBlockType<decltype(g_dist)>::type BlockT;
45 
46  g_dist.setPoints(box.getKP1(),box.getKP2(),
47  [c] __device__ (BlockT & data, int i, int j, int k)
48  {
49  data.template get<0>() = c + i*i + j*j + k*k;
50  }
51  );
52  */
53 
54 }
55 
56 
57 BOOST_AUTO_TEST_SUITE_END()