Commit f982d0ac authored by incardon's avatar incardon

Fixing general merge

parent 643f553d
......@@ -23,7 +23,8 @@ add_executable(mem_map ../../openfpm_devices/src/Memleak_check.cpp
Vector/map_vector_sparse_unit_tests.cpp
util/multi_array_openfpm/multi_array_ref_openfpm_unit_test.cpp
memory_ly/memory_conf_unit_tests.cpp
Space/tests/SpaceBox_unit_tests.cpp
Space/tests/SpaceBox_unit_tests.cpp
SparseGrid/SparseGrid_unit_tests.cpp
Grid/copy_grid_unit_test.cpp NN/Mem_type/Mem_type_unit_tests.cpp
../../openfpm_devices/src/memory/HeapMemory.cpp
../../openfpm_devices/src/memory/PtrMemory.cpp)
......
......@@ -12,12 +12,6 @@
#include "map_graph.hpp"
#include "Point_test.hpp"
#ifdef TEST_COVERAGE_MODE
#define GS_SIZE 8
#else
#define GS_SIZE 128
#endif
BOOST_AUTO_TEST_SUITE( graph_test )
BOOST_AUTO_TEST_CASE( graph_use)
......
This diff is collapsed.
......@@ -13,6 +13,7 @@
#include "Grid/grid_util_test.hpp"
#include "cuda_grid_unit_tests_func.cuh"
#include "util/cuda/cuda_launch.hpp"
#include "Grid/grid_test_utils.hpp"
BOOST_AUTO_TEST_SUITE( grid_gpu_func_test )
......@@ -682,4 +683,31 @@ BOOST_AUTO_TEST_CASE (gpu_grid_test_se_class1)
#endif
}
BOOST_AUTO_TEST_CASE(grid_test_copy_to_gpu_2d)
{
size_t sz_dst[] = {5,5};
size_t sz_src[] = {3,2};
grid_gpu<2,aggregate<float,float[3],float[3][3]>> g_dst(sz_dst);
grid_gpu<2,aggregate<float,float[3],float[3][3]>> g_src(sz_src);
Box<2,size_t> box_dst({1,2},{2,3});
Box<2,size_t> box_src({1,0},{2,1});
copy_test(g_src,g_dst,box_src,box_dst);
}
BOOST_AUTO_TEST_CASE(grid_test_copy_to_gpu_3d)
{
size_t sz_dst[] = {5,5,5};
size_t sz_src[] = {3,2,2};
grid_gpu<3,aggregate<float,float[3],float[3][3]>> g_dst(sz_dst);
grid_gpu<3,aggregate<float,float[3],float[3][3]>> g_src(sz_src);
Box<3,size_t> box_dst({1,2,2},{2,3,3});
Box<3,size_t> box_src({1,0,0},{2,1,1});
copy_test(g_src,g_dst,box_src,box_dst);
}
BOOST_AUTO_TEST_SUITE_END()
......@@ -101,43 +101,33 @@ struct mem_get
return boost::fusion::at_c<p>(data_.mem_r.operator[](lin_id));
}
/*! \brief Return a reference to the selected element
*
* \param data object from where to take the element
* \param g1 grid information
* \param v1 element id
*
* \return a reference to the object selected
*
*/
__host__ __device__ static inline auto get_c(const data_type & data_, const g1_type & g1, const key_type & v1) -> decltype(boost::fusion::at_c<p>(data_.mem_r.operator[](g1.LinId(v1)))) &
{
return boost::fusion::at_c<p>(data_.mem_r.operator[](g1.LinId(v1)));
}
/*! \brief Return a reference to the selected element
*
* \param data object from where to take the element
* \param g1 grid information
* \param v1 element id
*
* \return a reference to the object selected
*
*/
__host__ __device__ static inline auto get_lin_c(const data_type & data_, const g1_type & g1, const size_t lin_id) -> decltype(boost::fusion::at_c<p>(data_.mem_r.operator[](lin_id))) &
{
return boost::fusion::at_c<p>(data_.mem_r.operator[](lin_id));
}
/*! \brief Return a reference to the selected element
*
* \param data object from where to take the element
* \param g1 grid information
* \param v1 element id
*
* \return a reference to the object selected
*
*/
static inline auto get_const(const data_type & data_, const g1_type & g1, const key_type & v1) -> decltype(openfpm::as_const(boost::fusion::at_c<p>(data_.mem_r->operator[](g1.LinId(v1))) ) ) &
{
return boost::fusion::at_c<p>(data_.mem_r->operator[](g1.LinId(v1)));
}
/*! \brief Return a reference to the selected element
*
* \param data object from where to take the element
* \param g1 grid information
* \param v1 element id
*
* \return a reference to the object selected
*
*/
static inline auto get_lin_const(const data_type & data_, const g1_type & g1, const size_t lin_id) -> decltype(openfpm::as_const(boost::fusion::at_c<p>(data_.mem_r->operator[](lin_id)))) &
{
return boost::fusion::at_c<p>(data_.mem_r->operator[](lin_id));
}
};
//! Case memory_traits_inte
......@@ -172,43 +162,33 @@ struct mem_get<p,layout,data_type,g1_type,key_type,1>
return boost::fusion::at_c<p>(data_).mem_r.operator[](lin_id);
}
/*! \brief Return a reference to the selected element
*
* \param data object from where to take the element
* \param g1 grid information
* \param v1 element id
*
* \return a const reference to the object selected
*
*/
__host__ __device__ static inline auto get_c(const data_type & data_, const g1_type & g1, const key_type & v1) -> decltype(boost::fusion::at_c<p>(data_).mem_r.operator[](g1.LinId(v1)))
{
return boost::fusion::at_c<p>(data_).mem_r.operator[](g1.LinId(v1));
}
/*! \brief Return a reference to the selected element
*
* \param data object from where to take the element
* \param g1 grid information
* \param v1 element id
*
* \return a const reference to the object selected
*
*/
__host__ __device__ static inline auto get_lin_c(const data_type & data_, const g1_type & g1, size_t lin_id) -> decltype(boost::fusion::at_c<p>(data_).mem_r.operator[](lin_id))
{
return boost::fusion::at_c<p>(data_).mem_r.operator[](lin_id);
}
/*! \brief Return a reference to the selected element
*
* \param data object from where to take the element
* \param g1 grid information
* \param v1 element id
*
* \return a const reference to the object selected
*
*/
static inline auto get_const(const data_type & data_, const g1_type & g1, const key_type & v1) -> decltype(openfpm::as_const(boost::fusion::at_c<p>(data_).mem_r)->operator[](g1.LinId(v1)))
{
return boost::fusion::at_c<p>(data_).mem_r->operator[](g1.LinId(v1));
}
/*! \brief Return a reference to the selected element
*
* \param data object from where to take the element
* \param g1 grid information
* \param v1 element id
*
* \return a const reference to the object selected
*
*/
static inline auto get_lin_const(const data_type & data_, const g1_type & g1, size_t lin_id) -> decltype(openfpm::as_const(boost::fusion::at_c<p>(data_).mem_r)->operator[](lin_id))
{
return boost::fusion::at_c<p>(data_).mem_r->operator[](lin_id);
}
};
......
......@@ -11,6 +11,7 @@
#include "grid_base_impl_layout.hpp"
#include "util/cuda_util.hpp"
#include "cuda/cuda_grid_gpu_funcs.cuh"
#include "util/create_vmpl_sequence.hpp"
#define DATA_ON_HOST 32
#define DATA_ON_DEVICE 64
......@@ -199,6 +200,40 @@ bool has_work_gpu(ite_gpu<dim> & ite)
#include "copy_grid_fast.hpp"
template<typename T>
struct copy_grid_fast_caller
{
template<typename grid_type>
static void call(grid_type & gd, const grid_type & gs, const Box<grid_type::dims,size_t> & box_src, const Box<grid_type::dims,size_t> & box_dst)
{
std::cout << "Error: " << __FILE__ << ":" << __LINE__ << " copy_grid_fast_caller failure" << std::endl;
}
};
template<int ... prp>
struct copy_grid_fast_caller<index_tuple_sq<prp ...>>
{
template<typename grid_type>
static void call(grid_type & gd, const grid_type & gs, const Box<grid_type::dims,size_t> & box_src, const Box<grid_type::dims,size_t> & box_dst)
{
grid_key_dx<grid_type::dims> cnt[1];
cnt[0].zero();
typedef typename std::remove_reference<decltype(gd)>::type grid_cp;
typedef typename std::remove_reference<decltype(gd.getGrid())>::type grid_info_cp;
typedef typename to_int_sequence<0,grid_type::value_type::max_prop>::type result;
copy_grid_fast<!is_contiguos<prp...>::type::value || has_pack_gen<typename grid_type::value_type>::value,
grid_type::dims,
grid_cp,
grid_info_cp>::copy(gs.getGrid(),
gd.getGrid(),
box_src,
box_dst,
gs,gd,cnt);
}
};
/*! \brief
*
......@@ -769,50 +804,64 @@ public:
return mem_getpointer<decltype(data_),layout_base_>::template getPointer<p>(data_);
}
/*! \brief Get the address of the selected element
/*! \brief In this case insert is equivalent to get
*
* \param v1 grid_key that identify the element in the grid
*
* \return the reference of the element
*
*/
template <unsigned int p, typename r_type=decltype(&mem_get<p,layout_base<T>,layout,grid_sm<dim,T>,grid_key_dx<dim>>::get(data_,g1,grid_key_dx<dim>()))>
__device__ __host__ inline r_type get_address(const grid_key_dx<dim> & v1)
template <unsigned int p, typename r_type=decltype(mem_get<p,layout_base<T>,layout,grid_sm<dim,T>,grid_key_dx<dim>>::get(data_,g1,grid_key_dx<dim>()))>
inline r_type insert(const grid_key_dx<dim> & v1)
{
return &mem_get<p,layout_base<T>,decltype(this->data_),decltype(this->g1),decltype(v1)>::get(data_,g1,v1);
#ifdef SE_CLASS2
check_valid(this,8);
#endif
#ifdef SE_CLASS1
check_init();
check_bound(v1);
#endif
return this->get<p>(v1);
}
/*! \brief Get the address of the selected element
/*! \brief Get the reference of the selected element
*
* \param v1 grid_key that identify the element in the grid
*
* \return the reference of the element
*
*/
template <unsigned int p, typename r_type=decltype(&mem_get<p,layout_base<T>,layout,grid_sm<dim,T>,grid_key_dx<dim>>::get_c(data_,g1,grid_key_dx<dim>()))>
__device__ __host__ inline r_type get_address(const grid_key_dx<dim> & v1) const
template <unsigned int p, typename r_type=decltype(mem_get<p,layout_base<T>,layout,grid_sm<dim,T>,grid_key_dx<dim>>::get(data_,g1,grid_key_dx<dim>()))>
__device__ __host__ inline r_type get_usafe(const grid_key_dx<dim> & v1)
{
return &mem_get<p,layout_base<T>,decltype(this->data_),decltype(this->g1),decltype(v1)>::get_c(data_,g1,v1);
#ifdef SE_CLASS2
check_valid(this,8);
#endif
#ifdef SE_CLASS1
check_init();
#endif
return mem_get<p,layout_base<T>,decltype(this->data_),decltype(this->g1),decltype(v1)>::get(data_,g1,v1);
}
/*! \brief In this case insert is equivalent to get
/*! \brief Get the const reference of the selected element
*
* \param v1 grid_key that identify the element in the grid
*
* \return the reference of the element
* \return the const reference of the element
*
*/
template <unsigned int p, typename r_type=decltype(mem_get<p,layout_base<T>,layout,grid_sm<dim,T>,grid_key_dx<dim>>::get(data_,g1,grid_key_dx<dim>()))>
inline r_type insert(const grid_key_dx<dim> & v1)
template <unsigned int p, typename r_type=decltype(mem_get<p,layout_base<T>,layout,grid_sm<dim,T>,grid_key_dx<dim>>::get_c(data_,g1,grid_key_dx<dim>()))>
__device__ __host__ inline r_type get_unsafe(const grid_key_dx<dim> & v1) const
{
#ifdef SE_CLASS2
check_valid(this,8);
#endif
#ifdef SE_CLASS1
check_init();
check_bound(v1);
#endif
return this->get<p>(v1);
return mem_get<p,layout_base<T>,decltype(this->data_),decltype(this->g1),decltype(v1)>::get_c(data_,g1,v1);
}
/*! \brief Get the reference of the selected element
......@@ -1027,17 +1076,21 @@ public:
* It copy the area indicated by the box_src from grid_src into this grid
* at the place box_dst. The volume of box_src and box_dst
*
* box_dst and box_src are adjusted if box_dst overflow the destination grid
*
* \param grid_src source grid
* \param box_src source box
* \param box_dst destination box
*
*/
void copy_to(const grid_base_impl<dim,T,S,layout_,layout_base> & grid_src,
const Box<dim,size_t> & box_src,
const Box<dim,size_t> & box_dst)
const Box<dim,long int> & box_src,
const Box<dim,long int> & box_dst)
{
// sub-grid where to unpack
grid_key_dx_iterator_sub<dim> src(grid_src.getGrid(),box_src.getKP1(),box_src.getKP2());
/* grid_key_dx_iterator_sub<dim> src(grid_src.getGrid(),box_src.getKP1(),box_src.getKP2());
grid_key_dx_iterator_sub<dim> dst(getGrid(),box_dst.getKP1(),box_dst.getKP2());
while (src.isNext())
......@@ -1049,7 +1102,90 @@ public:
++src;
++dst;
}*/
///////////////////////////////////////
// typedef typename std::remove_reference<decltype(grid_src)>::type grid_cp;
// typedef typename std::remove_reference<decltype(grid_src.getGrid())>::type grid_info_cp;
// fix box_dst
Box<dim,size_t> box_src_;
Box<dim,size_t> box_dst_;
for (size_t i = 0 ; i < dim ; i++)
{
if (box_dst.getHigh(i) >= g1.size(i))
{
long int shift = box_dst.getHigh(i) - g1.size(i) + 1;
box_dst_.setHigh(i,box_dst.getHigh(i) - shift);
box_src_.setHigh(i,box_src.getHigh(i) - shift);
}
else
{
box_dst_.setHigh(i,box_dst.getHigh(i));
box_src_.setHigh(i,box_src.getHigh(i));
}
if (box_dst.getLow(i) < 0)
{
long int shift = -box_dst.getLow(i);
box_dst_.setLow(i,box_dst.getLow(i) - shift);
box_src_.setLow(i,box_src.getLow(i) - shift);
}
else
{
box_dst_.setLow(i,box_dst.getLow(i));
box_src_.setLow(i,box_src.getLow(i));
}
}
typedef typename to_int_sequence<0,T::max_prop>::type result;
copy_grid_fast_caller<result>::call(*this,grid_src,box_src_,box_dst_);
/* copy_grid_fast<!is_contiguos<prp...>::type::value || has_pack_gen<typename device_grid::value_type>::value,
dim,
grid_cp,
grid_info_cp>::copy(grid_src.getGrid(),
this->getGrid(),
box_src,
box_dst,
grid_src,*this,cnt);*/
/////////////////////////////////////////
}
/*! \brief copy an external grid into a specific place into this grid
*
* It copy the area indicated by the box_src from grid_src into this grid
* at the place box_dst. The volume of box_src and box_dst
*
* \param grid_src source grid
* \param box_src source box
* \param box_dst destination box
*
*/
template<unsigned int ... prp>
void copy_to_prp(const grid_base_impl<dim,T,S,layout_,layout_base> & grid_src,
const Box<dim,size_t> & box_src,
const Box<dim,size_t> & box_dst)
{
typedef typename std::remove_reference<decltype(grid_src)>::type grid_cp;
typedef typename std::remove_reference<decltype(grid_src.getGrid())>::type grid_info_cp;
grid_key_dx<dim> cnt[1];
cnt[0].zero();
copy_grid_fast<!is_contiguos<prp...>::type::value || has_pack_gen<T>::value,
dim,
grid_cp,
grid_info_cp>::copy(grid_src.getGrid(),
this->getGrid(),
box_src,
box_dst,
grid_src,*this,cnt);
}
/*! \brief It does nothing
......@@ -1430,13 +1566,13 @@ public:
* \return a sub-grid iterator
*
*/
/* inline grid_key_dx_iterator_sub<dim> getSubIterator(const grid_key_dx<dim> & start, const grid_key_dx<dim> & stop) const
inline grid_key_dx_iterator_sub<dim> getSubIterator(const grid_key_dx<dim> & start, const grid_key_dx<dim> & stop) const
{
#ifdef SE_CLASS2
check_valid(this,8);
#endif
return g1.getSubIterator(start,stop);
}*/
}
/*! \brief Return a sub-grid iterator
*
......
/*
* grid_test_utils.hpp
*
* Created on: Jun 16, 2019
* Author: i-bird
*/
#ifndef GRID_TEST_UTILS_HPP_
#define GRID_TEST_UTILS_HPP_
template<typename grid_type>
void copy_test(grid_type & g_src, grid_type & g_dst,
Box<grid_type::dims,size_t> & box_src, Box<grid_type::dims,size_t> & box_dst)
{
g_dst.setMemory();
g_src.setMemory();
auto itd = g_dst.getIterator();
while (itd.isNext())
{
auto k = itd.get();
g_dst.template get<0>(k) = 0;
g_dst.template get<1>(k)[0] = 0;
g_dst.template get<1>(k)[1] = 0;
g_dst.template get<1>(k)[2] = 0;
g_dst.template get<2>(k)[0][0] = 0;
g_dst.template get<2>(k)[0][1] = 0;
g_dst.template get<2>(k)[0][2] = 0;
g_dst.template get<2>(k)[1][0] = 0;
g_dst.template get<2>(k)[1][1] = 0;
g_dst.template get<2>(k)[1][2] = 0;
g_dst.template get<2>(k)[2][0] = 0;
g_dst.template get<2>(k)[2][1] = 0;
g_dst.template get<2>(k)[2][2] = 0;
++itd;
}
auto & gs = g_src.getGrid();
auto its = g_src.getIterator();
while (its.isNext())
{
auto k = its.get();
g_src.template get<0>(k) = gs.LinId(k);
g_src.template get<1>(k)[0] = gs.LinId(k) + 100;
g_src.template get<1>(k)[1] = gs.LinId(k) + 200;
g_src.template get<1>(k)[2] = gs.LinId(k) + 300;
g_src.template get<2>(k)[0][0] = gs.LinId(k) + 1000;
g_src.template get<2>(k)[0][1] = gs.LinId(k) + 2000;
g_src.template get<2>(k)[0][2] = gs.LinId(k) + 3000;
g_src.template get<2>(k)[1][0] = gs.LinId(k) + 4000;
g_src.template get<2>(k)[1][1] = gs.LinId(k) + 5000;
g_src.template get<2>(k)[1][2] = gs.LinId(k) + 6000;
g_src.template get<2>(k)[2][0] = gs.LinId(k) + 7000;
g_src.template get<2>(k)[2][1] = gs.LinId(k) + 8000;
g_src.template get<2>(k)[2][2] = gs.LinId(k) + 9000;
++its;
}
// copy
g_dst.copy_to(g_src,box_src,box_dst);
// Check
itd = g_dst.getIterator();
while (itd.isNext())
{
auto k = itd.get();
Point<grid_type::dims,size_t> p;
for (size_t i = 0 ; i < grid_type::dims ; i++)
{p.get(i) = k.get(i);}
if (box_dst.isInside(p) == true)
{
grid_key_dx<grid_type::dims> ks = k + box_src.getKP1() - box_dst.getKP1();
BOOST_REQUIRE_EQUAL(g_dst.template get<0>(k),gs.LinId(ks));
BOOST_REQUIRE_EQUAL(g_dst.template get<1>(k)[0],gs.LinId(ks) + 100);
BOOST_REQUIRE_EQUAL(g_dst.template get<1>(k)[1],gs.LinId(ks) + 200);
BOOST_REQUIRE_EQUAL(g_dst.template get<1>(k)[2],gs.LinId(ks) + 300);
BOOST_REQUIRE_EQUAL(g_dst.template get<2>(k)[0][0],gs.LinId(ks) + 1000);
BOOST_REQUIRE_EQUAL(g_dst.template get<2>(k)[0][1],gs.LinId(ks) + 2000);
BOOST_REQUIRE_EQUAL(g_dst.template get<2>(k)[0][2],gs.LinId(ks) + 3000);
BOOST_REQUIRE_EQUAL(g_dst.template get<2>(k)[1][0],gs.LinId(ks) + 4000);
BOOST_REQUIRE_EQUAL(g_dst.template get<2>(k)[1][1],gs.LinId(ks) + 5000);
BOOST_REQUIRE_EQUAL(g_dst.template get<2>(k)[1][2],gs.LinId(ks) + 6000);
BOOST_REQUIRE_EQUAL(g_dst.template get<2>(k)[2][0],gs.LinId(ks) + 7000);
BOOST_REQUIRE_EQUAL(g_dst.template get<2>(k)[2][1],gs.LinId(ks) + 8000);
BOOST_REQUIRE_EQUAL(g_dst.template get<2>(k)[2][2],gs.LinId(ks) + 9000);
}
else
{
BOOST_REQUIRE_EQUAL(g_dst.template get<0>(k),0);
BOOST_REQUIRE_EQUAL(g_dst.template get<1>(k)[0],0);
BOOST_REQUIRE_EQUAL(g_dst.template get<1>(k)[1],0);
BOOST_REQUIRE_EQUAL(g_dst.template get<1>(k)[2],0);
BOOST_REQUIRE_EQUAL(g_dst.template get<2>(k)[0][0],0);
BOOST_REQUIRE_EQUAL(g_dst.template get<2>(k)[0][1],0);
BOOST_REQUIRE_EQUAL(g_dst.template get<2>(k)[0][2],0);
BOOST_REQUIRE_EQUAL(g_dst.template get<2>(k)[1][0],0);
BOOST_REQUIRE_EQUAL(g_dst.template get<2>(k)[1][1],0);
BOOST_REQUIRE_EQUAL(g_dst.template get<2>(k)[1][2],0);
BOOST_REQUIRE_EQUAL(g_dst.template get<2>(k)[2][0],0);
BOOST_REQUIRE_EQUAL(g_dst.template get<2>(k)[2][1],0);
BOOST_REQUIRE_EQUAL(g_dst.template get<2>(k)[2][2],0);
}
++itd;
}
}
#endif /* GRID_TEST_UTILS_HPP_ */
......@@ -7,11 +7,12 @@
#include "Space/Shape/HyperCube.hpp"
#include "timer.hpp"
#include "grid_util_test.hpp"
#include "grid_test_utils.hpp"
#ifdef TEST_COVERAGE_MODE
#define GS_SIZE 8
constexpr int GS_SIZE = 8;
#else
#define GS_SIZE 128
constexpr int GS_SIZE = 128;
#endif
template<unsigned int dim, typename g> void test_layout_gridNd(g & c3, size_t sz);
......@@ -775,6 +776,21 @@ BOOST_AUTO_TEST_CASE(copy_encap_vector_fusion_test)
BOOST_REQUIRE_EQUAL(g.template get<2>(key)[2][2],g.template get<2>(key1)[2][2]);
}
BOOST_AUTO_TEST_CASE(grid_test_copy_to)
{
size_t sz_dst[] = {5,5};
size_t sz_src[] = {3,2};
grid_cpu<2,aggregate<float,float[3],float[3][3]>> g_dst(sz_dst);
grid_cpu<2,aggregate<float,float[3],float[3][3]>> g_src(sz_src);
Box<2,size_t> box_dst({1,2},{2,3});
Box<2,size_t> box_src({1,0},{2,1});
copy_test(g_src,g_dst,box_src,box_dst);
}
BOOST_AUTO_TEST_SUITE_END()
#endif
......@@ -583,11 +583,13 @@ class grid_cpu<dim,T,S,typename memory_traits_inte<T>::type> : public grid_base_
{
typedef typename apply_transform<memory_traits_inte,T>::type T_;
//! grid layout
typedef typename memory_traits_inte<T>::type layout;
T background;
public:
//! grid layout
typedef typename memory_traits_inte<T>::type layout;
//! Object container for T, it is the return type of get_o it return a object type trough
// you can access all the properties of T
typedef typename grid_base_impl<dim,T,S,typename memory_traits_inte<T>::type, memory_traits_inte>::container container;
......
......@@ -141,6 +141,15 @@ public:
return cl_n.size();
}
/*! \brief Destroy the internal memory including the retained one
*
*/
inline void destroy()
{
cl_n.swap(openfpm::vector<aggregate<local_index>,Memory>());
cl_base.swap(base());
}
/*! \brief Initialize the data to zero
*
* \param slot number of slot for each cell
......
......@@ -406,7 +406,7 @@ struct call_pack_agg_functor
pack_pack_op<openfpm::is_multi_array<decltype(obj.template get<T::value>())>::value,obj_type,Mem>::template call_pack_pack<T::value>(mem,obj,sts);
Packer<obj_t,Mem>::pack(mem,obj.template get<T::value>(),sts);
// Packer<obj_t,Mem>::pack(mem,obj.template get<T::value>(),sts);
}
};
......
......@@ -141,7 +141,7 @@ public:
{
typedef typename std::remove_extent<T>::type prim_type;
meta_copy<T>::meta_copy_((prim_type *)ext.getPointer(),obj);
meta_copy<T>::meta_copy_((prim_type *)ext.getPointerOffset(ps.getOffset()),obj);
ps.addOffset(sizeof(T));
}
......
......@@ -217,12 +217,12 @@ public:
//! getter method for a general property i
template<unsigned int i>
inline auto get() -> decltype(boost::fusion::at_c<i>(data))
{return boost::fusion::at_c<i>(data);};
{return boost::fusion::at_c<i>(data);}
//! getter method for a general property i
template<unsigned int i>
inline auto get() const -> decltype(boost::fusion::at_c<i>(data))
{return boost::fusion::at_c<i>(data);};
{return boost::fusion::at_c<i>(data);}
//! Default constructor
Point_test()
......
......@@ -8,6 +8,8 @@
#ifndef OPENFPM_DATA_SRC_SPARSEGRID_SPARSEGRID_UNIT_TESTS_CPP_
#define OPENFPM_DATA_SRC_SPARSEGRID_SPARSEGRID_UNIT_TESTS_CPP_
#define DISABLE_MPI_WRITTERS
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include "SparseGrid/SparseGrid.hpp"
......
......@@ -6,6 +6,8 @@
#include <boost/test/unit_test.hpp>
#include "util/math_util_complex.hpp"