2#define BOOST_TEST_DYN_LINK
3#include <boost/test/unit_test.hpp>
5#include "NN/CellList/cuda/CellDecomposer_gpu_ker.cuh"
6#include "Space/Shape/Point.hpp"
7#include "Vector/map_vector.hpp"
10template<
typename vector_type,
typename celldec>
13 vd.template get<0>(
id) = cd.getCell(p);
16BOOST_AUTO_TEST_SUITE( CellDecomposer_gpu_test_suite )
19BOOST_AUTO_TEST_CASE( CellDecomposer_gpu_test_use )
38 CUDA_LAUNCH_DIM3(check,1,1,output.toKernel(),clk,0,
Point<3,float>({0.2,0.2,0.2}));
39 CUDA_LAUNCH_DIM3(check,1,1,output.toKernel(),clk,1,
Point<3,float>({0.1,0.2,0.3}));
40 CUDA_LAUNCH_DIM3(check,1,1,output.toKernel(),clk,2,
Point<3,float>({0.25,0.55,0.45}));
41 CUDA_LAUNCH_DIM3(check,1,1,output.toKernel(),clk,3,
Point<3,float>({0.15,0.15,0.95}));
42 CUDA_LAUNCH_DIM3(check,1,1,output.toKernel(),clk,4,
Point<3,float>({1.05,1.05,1.05}));
43 CUDA_LAUNCH_DIM3(check,1,1,output.toKernel(),clk,5,
Point<3,float>({1.15,1.15,1.15}));
44 CUDA_LAUNCH_DIM3(check,1,1,output.toKernel(),clk,6,
Point<3,float>({-0.05,-0.05,-0.05}));
45 CUDA_LAUNCH_DIM3(check,1,1,output.toKernel(),clk,7,
Point<3,float>({-0.15,-0.15,-0.15}));
47 output.template deviceToHost<0>();
50 BOOST_REQUIRE_EQUAL(k.get(0),4);
51 BOOST_REQUIRE_EQUAL(k.get(1),4);
52 BOOST_REQUIRE_EQUAL(k.get(2),4);
53 k = output.template get<0>(1);
54 BOOST_REQUIRE_EQUAL(k.get(0),3);
55 BOOST_REQUIRE_EQUAL(k.get(1),4);
56 BOOST_REQUIRE_EQUAL(k.get(2),5);
57 k = output.template get<0>(2);
58 BOOST_REQUIRE_EQUAL(k.get(0),4);
59 BOOST_REQUIRE_EQUAL(k.get(1),7);
60 BOOST_REQUIRE_EQUAL(k.get(2),6);
61 k = output.template get<0>(3);
62 BOOST_REQUIRE_EQUAL(k.get(0),3);
63 BOOST_REQUIRE_EQUAL(k.get(1),3);
64 BOOST_REQUIRE_EQUAL(k.get(2),11);
65 k = output.template get<0>(4);
66 BOOST_REQUIRE_EQUAL(k.get(0),12);
67 BOOST_REQUIRE_EQUAL(k.get(1),12);
68 BOOST_REQUIRE_EQUAL(k.get(2),12);
69 k = output.template get<0>(5);
70 BOOST_REQUIRE_EQUAL(k.get(0),13);
71 BOOST_REQUIRE_EQUAL(k.get(1),13);
72 BOOST_REQUIRE_EQUAL(k.get(2),13);
73 k = output.template get<0>(6);
74 BOOST_REQUIRE_EQUAL(k.get(0),1);
75 BOOST_REQUIRE_EQUAL(k.get(1),1);
76 BOOST_REQUIRE_EQUAL(k.get(2),1);
77 k = output.template get<0>(7);
78 BOOST_REQUIRE_EQUAL(k.get(0),0);
79 BOOST_REQUIRE_EQUAL(k.get(1),0);
80 BOOST_REQUIRE_EQUAL(k.get(2),0);
83BOOST_AUTO_TEST_SUITE_END()
This class implement an NxN (dense) matrix.
This class implement the point shape in an N-dimensional space.
grid_key_dx is the key to access any element in the grid
Implementation of 1-D std::vector like structure.