4#include "copy_general.hpp"
5#include "util/cuda_util.hpp"
6#include "util/multi_array_openfpm/multi_array_ref_openfpm.hpp"
9template<
typename ArrTypeView>
19 decltype(arr[0][0])
operator[](
int comp)
21 return arr[comp][pos];
24 decltype(std::declval<const ArrTypeView>()[0][0])
operator[](
int comp)
const
26 return arr[comp][pos];
60 __device__ __host__
static inline void meta_copy_(
const T & src, T & dst)
71 __device__ __host__
static inline void meta_copy_(
const T & src, T && dst)
83template<
typename Tsrc,
typename Tdst>
92 __device__ __host__
static inline void meta_copy_d_(
const Tsrc & src, Tdst & dst)
104 __device__ __host__
static inline void meta_copy_d_(
const Tsrc & src, Tdst && dst)
112template<
typename T,
size_t N1>
121 __device__ __host__
static inline void meta_copy_(
const T src[N1], T dst[N1])
123 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
135 template<
typename T2>
138 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
150 template<
typename v_mpl>
154 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
166 template<
typename v_mpl>
170 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
178template<
typename Tsrc,
typename Tdst,
size_t N1>
187 __device__ __host__
static inline void meta_copy_d_(
const Tsrc src[N1], Tdst && dst)
189 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
201 __device__ __host__
static inline void meta_copy_d_(
const Tsrc src[N1], Tdst & dst)
203 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
211template<
typename Tsrc,
typename Tdst,
size_t N1>
220 __device__ __host__
static inline void meta_copy_d_(
const Tsrc & src, Tdst dst[N1])
222 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
230template<
typename Tsrc,
typename Tdst,
size_t N1>
239 __device__ __host__
static inline void meta_copy_d_(
const Tsrc src[N1], Tdst dst[N1])
241 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
249template<
typename T,
size_t N1,
size_t N2>
258 __device__ __host__
static inline void meta_copy_(
const T src[N1][N2], T dst[N1][N2])
260 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
262 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
275 template<
typename v_mpl>
279 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
281 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
294 template<
typename v_mpl>
298 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
300 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
309template<
typename Tsrc,
typename Tdst,
size_t N1,
size_t N2>
312 __device__ __host__
static inline void meta_copy_d_(
const Tsrc src[N1][N2], Tdst && dst)
320 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
322 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
329 __device__ __host__
static inline void meta_copy_d_(
const Tsrc src[N1][N2], Tdst & dst)
337 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
339 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
348template<
typename Tsrc,
typename Tdst,
size_t N1,
size_t N2>
357 __device__ __host__
static inline void meta_copy_d_(
const Tsrc & src, Tdst dst[N1][N2])
359 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
361 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
372template<
typename Tsrc,
typename Tdst,
size_t N1,
size_t N2>
381 __device__ __host__
static inline void meta_copy_d_(
const Tsrc src[N1][N2], Tdst dst[N1][N2])
383 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
385 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
394template<
typename T,
size_t N1,
size_t N2,
size_t N3>
403 static inline void meta_copy_(
const T src[N1][N2][N3], T dst[N1][N2][N3])
405 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
407 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
409 for (
size_t i3 = 0 ; i3 < N3 ; i3++)
419template<
typename T,
size_t N1,
size_t N2,
size_t N3,
size_t N4>
428 static inline void meta_copy_(
const T src[N1][N2][N3][N4], T dst[N1][N2][N3][N4])
430 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
432 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
434 for (
size_t i3 = 0 ; i3 < N3 ; i3++)
436 for (
size_t i4 = 0 ; i4 < N4 ; i4++)
447template<
typename T,
size_t N1,
size_t N2,
size_t N3,
size_t N4,
size_t N5>
456 static inline void meta_copy_(
const T src[N1][N2][N3][N4][N5], T dst[N1][N2][N3][N4][N5])
458 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
460 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
462 for (
size_t i3 = 0 ; i3 < N3 ; i3++)
464 for (
size_t i4 = 0 ; i4 < N4 ; i4++)
466 for (
size_t i5 = 0 ; i5 < N5 ; i5++)
478template<
typename T,
size_t N1,
size_t N2,
size_t N3,
size_t N4,
size_t N5,
size_t N6>
487 static inline void meta_copy_(
const T src[N1][N2][N3][N4][N5][N6], T dst[N1][N2][N3][N4][N5][N6])
489 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
491 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
493 for (
size_t i3 = 0 ; i3 < N3 ; i3++)
495 for (
size_t i4 = 0 ; i4 < N4 ; i4++)
497 for (
size_t i5 = 0 ; i5 < N5 ; i5++)
499 for (
size_t i6 = 0 ; i6 < N6 ; i6++)
501 copy_general<T>(src[i1][i2][i3][i4][i5][i6],dst[i1][i2][i3][i4][i5][i6]);
512template<
typename T,
size_t N1,
size_t N2,
size_t N3,
size_t N4,
size_t N5,
size_t N6,
size_t N7>
521 static inline void meta_copy_(
const T src[N1][N2][N3][N4][N5][N6][N7], T dst[N1][N2][N3][N4][N5][N6][N7])
523 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
525 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
527 for (
size_t i3 = 0 ; i3 < N3 ; i3++)
529 for (
size_t i4 = 0 ; i4 < N4 ; i4++)
531 for (
size_t i5 = 0 ; i5 < N5 ; i5++)
533 for (
size_t i6 = 0 ; i6 < N6 ; i6++)
535 for (
size_t i7 = 0 ; i7 < N7 ; i7++)
537 copy_general<T>(src[i1][i2][i3][i4][i5][i6][i7],dst[i1][i2][i3][i4][i5][i6][i7]);
549template<
typename T,
size_t N1,
size_t N2,
size_t N3,
size_t N4,
size_t N5,
size_t N6,
size_t N7,
size_t N8>
558 static inline void meta_copy_(
const T src[N1][N2][N3][N4][N5][N6][N7][N8], T dst[N1][N2][N3][N4][N5][N6][N7][N8])
560 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
562 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
564 for (
size_t i3 = 0 ; i3 < N3 ; i3++)
566 for (
size_t i4 = 0 ; i4 < N4 ; i4++)
568 for (
size_t i5 = 0 ; i5 < N5 ; i5++)
570 for (
size_t i6 = 0 ; i6 < N6 ; i6++)
572 for (
size_t i7 = 0 ; i7 < N7 ; i7++)
574 for (
size_t i8 = 0 ; i8 < N8 ; i8++)
576 copy_general<T>(src[i1][i2][i3][i4][i5][i6][i7][i8],dst[i1][i2][i3][i4][i5][i6][i7][i8]);
589template<
typename T,
size_t N1,
size_t N2,
size_t N3,
size_t N4,
size_t N5,
size_t N6,
size_t N7,
size_t N8,
size_t N9>
598 static inline void meta_copy_(
const T src[N1][N2][N3][N4][N5][N6][N7][N8][N9], T dst[N1][N2][N3][N4][N5][N6][N7][N8][N9])
600 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
602 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
604 for (
size_t i3 = 0 ; i3 < N3 ; i3++)
606 for (
size_t i4 = 0 ; i4 < N4 ; i4++)
608 for (
size_t i5 = 0 ; i5 < N5 ; i5++)
610 for (
size_t i6 = 0 ; i6 < N6 ; i6++)
612 for (
size_t i7 = 0 ; i7 < N7 ; i7++)
614 for (
size_t i8 = 0 ; i8 < N8 ; i8++)
616 for (
size_t i9 = 0 ; i9 < N9 ; i9++)
618 copy_general<T>(src[i1][i2][i3][i4][i5][i6][i7][i8][i9],dst[i1][i2][i3][i4][i5][i6][i7][i8][i9]);
632template<
typename T,
size_t N1,
size_t N2,
size_t N3,
size_t N4,
size_t N5,
size_t N6,
size_t N7,
size_t N8,
size_t N9,
size_t N10>
633struct meta_copy<T[N1][N2][N3][N4][N5][N6][N7][N8][N9][N10]>
641 static inline void meta_copy_(
const T src[N1][N2][N3][N4][N5][N6][N7][N8][N9][N10], T dst[N1][N2][N3][N4][N5][N6][N7][N8][N9][N10])
643 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
645 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
647 for (
size_t i3 = 0 ; i3 < N3 ; i3++)
649 for (
size_t i4 = 0 ; i4 < N4 ; i4++)
651 for (
size_t i5 = 0 ; i5 < N5 ; i5++)
653 for (
size_t i6 = 0 ; i6 < N6 ; i6++)
655 for (
size_t i7 = 0 ; i7 < N7 ; i7++)
657 for (
size_t i8 = 0 ; i8 < N8 ; i8++)
659 for (
size_t i9 = 0 ; i9 < N9 ; i9++)
661 for (
size_t i10 = 0 ; i10 < N10 ; i10++)
663 copy_general<T>(src[i1][i2][i3][i4][i5][i6][i7][i8][i9][i10],dst[i1][i2][i3][i4][i5][i6][i7][i8][i9][i10]);
701template<
template<
typename,
typename>
class op,
typename T>
728template<
template<
typename,
typename>
class op,
typename T,
typename vmpl>
739 for (
size_t i1 = 0 ; i1 < boost::mpl::at<vmpl,boost::mpl::int_<0>>::type::value ; i1++)
747template<
template<
typename,
typename>
class op,
typename T,
size_t N1>
758 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
766template<
template<
typename,
typename>
class op,
typename T,
typename vmpl>
777 for (
size_t i1 = 0 ; i1 < boost::mpl::at<vmpl,boost::mpl::int_<0>>::type::value ; i1++)
779 for (
size_t i2 = 0 ; i2 < boost::mpl::at<vmpl,boost::mpl::int_<1>>::type::value ; i2++)
788template<
template<
typename,
typename>
class op,
typename T,
size_t N1,
size_t N2>
799 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
801 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
811template<
template<
typename,
typename>
class op,
typename T,
size_t N1,
size_t N2,
size_t N3>
820 static inline void meta_copy_op_(
const T src[N1][N2][N3], T dst[N1][N2][N3])
822 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
824 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
826 for (
size_t i3 = 0 ; i3 < N3 ; i3++)
836template<
template<
typename,
typename>
class op,
typename Tsrc,
typename Tdst>
863template<
template<
typename,
typename>
class op,
typename Tsrc,
typename Tdst,
size_t N1>
872 __device__ __host__
static inline void meta_copy_op_d_(
const Tsrc src[N1], Tdst && dst)
874 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
882template<
template<
typename,
typename>
class op,
typename Tsrc,
typename Tdst,
size_t N1>
891 __device__ __host__
static inline void meta_copy_op_d_(
const Tsrc & src, Tdst dst[N1])
893 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
901template<
template<
typename,
typename>
class op,
typename Tsrc,
typename Tdst,
typename vmpl>
912 for (
size_t i1 = 0 ; i1 < boost::mpl::at<vmpl,boost::mpl::int_<0>>::type::value ; i1++)
920template<
template<
typename,
typename>
class op,
typename Tsrc,
typename Tdst,
size_t N1>
929 __device__ __host__
static inline void meta_copy_op_d_(
const Tsrc src[N1], Tdst dst[N1])
931 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
939template<
template<
typename,
typename>
class op,
typename Tsrc,
typename Tdst,
size_t N1,
size_t N2>
948 __device__ __host__
static inline void meta_copy_op_d_(
const Tsrc src[N1][N2], Tdst dst[N1][N2])
950 for (
size_t i1 = 0 ; i1 < N1 ; i1++)
952 for (
size_t i2 = 0 ; i2 < N2 ; i2++)
961template<
template<
typename,
typename>
class op,
typename Tsrc,
typename Tdst,
typename vmpl>
972 for (
size_t i1 = 0 ; i1 < boost::mpl::at<vmpl,boost::mpl::int_<0>>::type::value ; i1++)
974 for (
size_t i2 = 0 ; i2 < boost::mpl::at<vmpl,boost::mpl::int_<1>>::type::value ; i2++)
convert a type into constant type
structure to copy aggregates applying an operation
structure to copy aggregates