Commit bd022d6e authored by Pietro Incardona's avatar Pietro Incardona

Fixing SE_CLASS2 for refactorization

parent 08e57118
......@@ -215,16 +215,6 @@ fi
INCLUDES_PATH+="-I. -Iconfig -I../../openfpm_devices/src -I../../openfpm_io/src"
####### include /usr/local/lib and /usr/local/lib64 if they exist
if [ -d "/usr/local/lib64" ]; then
LOCAL_LIBS="/usr/local/lib64"
else
if [ -d "/usr/local/lib" ]; then
LOCAL_LIBS="/usr/local/lib"
fi
fi
####### Checking for GPU support
AX_CUDA
......@@ -253,11 +243,15 @@ fi
#
NVCCFLAGS="--std=c++11"
if test x$gpu_support = x"no"; then
CUDA_LIBS=""
CUDA_CFLAGS=""
fi
AC_SUBST(NVCCFLAGS)
AM_CONDITIONAL(BUILDCUDA, test x$gpu_support = x"yes")
##### CHECK FOR BOOST ##############
......
......@@ -54,7 +54,7 @@ struct copy_cpu_encap_encap
#ifdef SE_CLASS1
// e_src and e_dst must have the same number of properties
if (e_src::max_prop != e_dst::max_prop)
if (e_src::T_type::max_prop != e_dst::T_type::max_prop)
std::cerr << "Error " << __FILE__ << ":" << __LINE__ << " the number of properties between src and dst must match";
#endif
};
......@@ -241,7 +241,7 @@ public:
template <unsigned int p> inline auto get() -> decltype(boost::fusion::at_c<p>(data_c))
{
#ifdef SE_CLASS2
check_valid(&boost::fusion::at_c<p>(data_c),sizeof(typename type_cpu_prop<p,Mem>::type));
check_valid(&boost::fusion::at_c<p>(data_c),sizeof(typename boost::mpl::at<type,boost::mpl::int_<p>>::type));
#endif
return boost::fusion::at_c<p>(data_c);
}
......@@ -254,7 +254,7 @@ public:
template <unsigned int p> inline auto get() const -> decltype(boost::fusion::at_c<p>(data_c)) const
{
#ifdef SE_CLASS2
check_valid(&boost::fusion::at_c<p>(data_c),sizeof(typename type_cpu_prop<p,Mem>::type));
check_valid(&boost::fusion::at_c<p>(data_c),sizeof(typename boost::mpl::at<type,boost::mpl::int_<p>>::type));
#endif
return boost::fusion::at_c<p>(data_c);
}
......@@ -263,7 +263,7 @@ public:
template <unsigned int p> inline void set(decltype(boost::fusion::at_c<p>(data_c)) & ele)
{
#ifdef SE_CLASS2
check_valid(&boost::fusion::at_c<p>(data_c),sizeof(typename type_cpu_prop<p,T>::type));
check_valid(&boost::fusion::at_c<p>(data_c),sizeof(typename boost::mpl::at<type,boost::mpl::int_<p>>::type));
#endif
return boost::fusion::at_c<p>(data_c) = ele;
}
......
......@@ -96,9 +96,6 @@ struct mem_setm
{
static inline void setMemory(data_type & data_, const g1_type & g1, bool & is_mem_init)
{
#ifdef SE_CLASS2
check_valid(this,8);
#endif
S * mem = new S();
//! Create and set the memory allocator
......
......@@ -659,10 +659,6 @@ public:
check_init();
check_bound(v1);
#endif
#ifdef SE_CLASS2
if (check_valid(&boost::fusion::at_c<p>(data_.mem_r->operator[](g1.LinId(v1)))) == false) {ACTION_ON_ERROR();}
#endif
// return boost::fusion::at_c<p>(data_.mem_r->operator[](g1.LinId(v1)));
return mem_get<p,layout_base<T>,decltype(this->data_),decltype(this->g1),decltype(v1)>::get(data_,g1,v1);
}
......@@ -685,7 +681,6 @@ public:
#ifdef SE_CLASS2
if (check_valid(&boost::fusion::at_c<p>(data_.mem_r->operator[](g1.LinId(v1)))) == false) {ACTION_ON_ERROR()};
#endif
// return boost::fusion::at_c<p>(data_.mem_r->operator[](g1.LinId(v1)));
return mem_get<p,layout_base<T>,decltype(this->data_),decltype(this->g1),decltype(v1)>::get(data_,g1,v1);
}
......@@ -704,12 +699,8 @@ public:
#ifdef SE_CLASS1
check_init();
check_bound(v1);
#endif
#ifdef SE_CLASS2
if (check_valid(&boost::fusion::at_c<p>(data_.mem_r->operator[](g1.LinId(v1))),sizeof(typename type_cpu_prop<p,memory_lin>::type)) == false) {ACTION_ON_ERROR()};
#endif
return mem_get<p,layout_base<T>,decltype(this->data_),decltype(this->g1),decltype(v1)>::get(data_,g1,v1);
// return boost::fusion::at_c<p>(data_.mem_r->operator[](g1.LinId(v1)));
}
/*! \brief Get the const reference of the selected element
......@@ -727,12 +718,8 @@ public:
#ifdef SE_CLASS1
check_init();
check_bound(v1);
#endif
#ifdef SE_CLASS2
if (check_valid(&boost::fusion::at_c<p>(data_.mem_r->operator[](g1.LinId(v1))),sizeof(typename type_cpu_prop<p,memory_lin>::type)) == false) {ACTION_ON_ERROR()};
#endif
return mem_get<p,layout_base<T>,decltype(this->data_),decltype(this->g1),decltype(v1)>::get(data_,g1,v1);
// return boost::fusion::at_c<p>(data_.mem_r->operator[](g1.LinId(v1)));
}
/*! \brief Get the of the selected element as a boost::fusion::vector
......@@ -750,9 +737,6 @@ public:
#ifdef SE_CLASS1
check_init();
check_bound(v1);
#endif
#ifdef SE_CLASS2
check_valid(&data_.mem_r->operator[](g1.LinId(v1)),sizeof(T));
#endif
return mem_geto<dim,T,layout_base<T>,decltype(this->data_),decltype(this->g1),decltype(v1)>::get(data_,g1,v1);
}
......@@ -772,9 +756,6 @@ public:
#ifdef SE_CLASS1
check_init();
check_bound(v1);
#endif
#ifdef SE_CLASS2
if (check_valid(&data_.mem_r->operator[](g1.LinId(v1)),sizeof(T)) == false) {ACTION_ON_ERROR()}
#endif
return mem_geto<dim,T,layout_base<T>,decltype(this->data_),decltype(this->g1),decltype(v1)>::get(const_cast<decltype(this->data_) &>(data_),g1,v1);
}
......
......@@ -84,7 +84,7 @@ struct copy_fusion_vector_encap
* this mean that the object passed must not be a temporal object
*
*/
inline copy_fusion_vector(const bfv && src, enc && dst)
inline copy_fusion_vector_encap(const bfv && src, enc && dst)
:src(src),dst(dst)
{std::cerr << "Error: " <<__FILE__ << ":" << __LINE__ << " Passing a temporal object\n";};
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment