Skip to content
Snippets Groups Projects
Commit 6cf4d534 authored by Pietro Incardona's avatar Pietro Incardona
Browse files

Adding missing files

parent 0be85990
No related branches found
No related tags found
No related merge requests found
Pipeline #3195 failed
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include "Point_test.hpp"
#include "Grid/grid_dist_id.hpp"
#include "data_type/aggregate.hpp"
extern void print_test_v(std::string test, size_t sz);
BOOST_AUTO_TEST_SUITE( grid_dist_id_test )
BOOST_AUTO_TEST_CASE( grid_dist_id_gpu_test )
{
// Test grid periodic
Box<3,float> domain({-1.0,-1.0,-1.0},{1.0,1.0,1.0});
Vcluster<> & v_cl = create_vcluster();
if ( v_cl.getProcessingUnits() > 32 )
{return;}
// grid size
size_t sz[3];
sz[0] = 32;
sz[1] = 32;
sz[2] = 32;
// Ghost
Ghost<3,long int> g(1);
// periodicity
periodicity<3> pr = {{PERIODIC,PERIODIC,PERIODIC}};
// Distributed grid with id decomposition
grid_dist_id_gpu<3, float, aggregate<float, float>> g_dist(sz,domain,g,pr);
Box<3,size_t> box({1,1,1},{30,30,30});
auto it = g_dist.getGridIterator(box.getKP1(),box.getKP2());
float c = 5.0;
typedef typename GetSetBlockType<decltype(g_dist)>::type BlockT;
g_dist.setPoints(box.getKP1(),box.getKP2(),
[c] __device__ (BlockT & data, int i, int j, int k)
{
data.template get<0>() = c + i*i + j*j + k*k;
}
);
}
BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment