OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
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
8extern void print_test_v(std::string test, size_t sz);
9
10BOOST_AUTO_TEST_SUITE( grid_dist_id_test )
11
12
13BOOST_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 void * ptr = (double*)g_dist.get_loc_grid(0).toKernel().getPointer<0>();*/
40
41/* Box<3,size_t> box({1,1,1},{30,30,30});
42 auto it = g_dist.getGridIterator(box.getKP1(),box.getKP2());
43
44 float c = 5.0;
45
46 typedef typename GetSetBlockType<decltype(g_dist)>::type BlockT;
47
48 g_dist.setPoints(box.getKP1(),box.getKP2(),
49 [c] __device__ (BlockT & data, int i, int j, int k)
50 {
51 data.template get<0>() = c + i*i + j*j + k*k;
52 }
53 );
54 */
55
56}
57
58
59BOOST_AUTO_TEST_SUITE_END()