8#ifndef TOKERNEL_TRANSFORMATION_HPP_
9#define TOKERNEL_TRANSFORMATION_HPP_
11#include "data_type/aggregate.hpp"
33 p.template hostToDevice<T::value>();
37template<
typename T,
typename T_ker,
typename type_prp,
template<
typename>
class layout_base ,
int is_vector>
40 template<
typename mem_type,
typename obj_type>
static void transform(mem_type * mem, obj_type & obj,
size_t start,
size_t stop)
42 start /=
sizeof(type_prp);
43 stop /=
sizeof(type_prp);
48 T * ptr =
static_cast<T *
>(obj.get_pointer());
52 tmp.allocate(mem->size());
54 T_ker * ptr_tt =
static_cast<T_ker *
>(tmp.getPointer());
56 for(
size_t i = start ; i < stop ; i++)
58 new (&ptr_tt[i]) T_ker();
59 ptr_tt[i] = ptr[i].toKernel();
62 mem->hostToDevice(tmp);
66 template<
typename obj_type>
67 static void call(obj_type & obj,
size_t start,
size_t stop)
69 T * ptr =
static_cast<T *
>(obj.get_pointer());
71 for(
size_t i = start ; i < stop ; i++)
75 boost::mpl::for_each_ref<boost::mpl::range_c<int,0,T::value_type::max_prop>>(hdap);
80template<
typename T,
typename T_ker,
typename type_prp ,
template<
typename>
class layout_base>
83 template<
typename mem_type,
typename obj_type>
static void transform(mem_type * mem, obj_type & obj,
size_t start,
size_t stop)
85 mem->hostToDevice(start,stop);
89 template<
typename obj_type>
90 static void call(obj_type & obj,
size_t start,
size_t stop) {}
93template<
typename T,
typename T_ker,
typename type_prp ,
template<
typename>
class layout_base>
96 template<
typename mem_type,
typename obj_type>
static void transform(mem_type * mem, obj_type & obj,
size_t start,
size_t stop)
99 start /= std::extent<type_prp,0>::value;
100 stop /= std::extent<type_prp,0>::value;
101 size_t sz = mem->size() / std::extent<type_prp,0>::value;
104 for (
size_t i = 0 ; i < std::extent<type_prp,0>::value ; i++)
106 mem->hostToDevice(offset+start,offset+stop);
112 template<
typename obj_type>
113 static void call(obj_type & obj,
size_t start,
size_t stop) {}
116template<
typename T,
typename T_ker,
typename type_prp ,
template<
typename>
class layout_base>
119 template<
typename mem_type,
typename obj_type>
static void transform(mem_type * mem, obj_type & obj,
size_t start,
size_t stop)
122 start = start / std::extent<type_prp,0>::value / std::extent<type_prp,1>::value;
123 stop = stop / std::extent<type_prp,0>::value / std::extent<type_prp,1>::value;
124 size_t sz = mem->size() / std::extent<type_prp,0>::value / std::extent<type_prp,1>::value;
127 for (
size_t i = 0 ; i < std::extent<type_prp,0>::value ; i++)
129 for (
size_t j = 0 ; j < std::extent<type_prp,1>::value ; j++)
131 mem->hostToDevice(offset+start,offset+stop);
138 template<
typename obj_type>
139 static void call(obj_type & obj,
size_t start,
size_t stop) {}
195 template<
typename T,
template <
typename>
class layout_base>
196 struct vector_gpu_ker;
200template<
unsigned int dim ,
typename T>
class Box;
205template<
template <
typename>
class layout_base,
typename T,
typename ... args>
211template<
template <
typename>
class layout_base,
typename T,
int impl,
typename ... args>
217template<
template <
typename>
class layout_base,
typename T,
typename ... args>
226template<
template <
typename>
class layout_base,
typename T>
229 typedef typename apply_trasform_impl<layout_base,T,typename T::type>::type type;
234template<
template <
typename>
class layout_base,
typename T >
241template<
template <
typename>
class layout_base,
typename T>
244 typedef typename apply_transform<layout_base,typename T::value_type>::type aggr;
251template<
unsigned int dim ,
typename T>
class Point;
253template<
template <
typename>
class layout_base,
typename T,
typename ... args>
259template<
template <
typename>
class layout_base,
typename T,
typename ... args>
This class represent an N-dimensional box.
This class implement the point shape in an N-dimensional space.
convert a type into constant type
aggregate of properties, from a list of object if create a struct that follow the OPENFPM native stru...
static void call(obj_type &obj, size_t start, size_t stop)
It is not a vector nothing to do.
static void call(obj_type &obj, size_t start, size_t stop)
It is not a vector nothing to do.
static void call(obj_type &obj, size_t start, size_t stop)
It is not a vector nothing to do.
static void call(obj_type &obj, size_t start, size_t stop)
It is a vector recursively call deviceToHost.
this class is a functor for "for_each" algorithm
void operator()(T &t) const
It call the copy function for each property.
Check this is a gpu or cpu type cell-list.
grid interface available when on gpu