8 #ifndef IE_GHOST_GPU_CUH_ 9 #define IE_GHOST_GPU_CUH_ 11 #include "data_type/aggregate.hpp" 13 constexpr
unsigned int lc_proc_ = 0;
14 constexpr
unsigned int proc_ = 1;
15 constexpr
unsigned int shift_id_ = 2;
17 template<
typename output_type>
26 __device__ __host__
inline void op(
unsigned int base,
unsigned int n,
unsigned int proc_act,
unsigned int shift_act,
unsigned int pi)
28 output.template get<0>(base + n) = proc_act;
29 output.template get<1>(base + n) = (
unsigned long int)pi + (((
unsigned long int)shift_act) << 32);
35 __device__ __host__
inline void op(
unsigned int base,
unsigned int n,
unsigned int proc_act,
unsigned int shift_act,
unsigned int pi)
40 template<
unsigned int dim,
typename T,
typename cell_list_type,
typename vb_
int_box_type,
typename vb_
int_type,
typename operation>
41 __device__ __host__
inline unsigned int ghost_processorID_general_impl(
const Point<dim,T> & p,
44 cell_list_type & geo_cell,
45 vb_int_box_type & vb_int_box,
49 unsigned int cell = geo_cell.getCell(p);
50 unsigned int sz = geo_cell.getNelements(cell);
54 bool switch_prc =
false;
59 unsigned int bid = geo_cell.get(cell,0);
60 unsigned int proc_prev = vb_int.template get<proc_>(bid);
61 unsigned int shift_prev = vb_int.template get<shift_id_>(bid);
62 unsigned int proc_act;
63 unsigned int shift_act;
65 if (
Box<dim,T>(vb_int_box.get(bid)).isInsideNP(p) ==
true)
67 op.op(base,n,proc_prev,shift_prev,pi);
77 unsigned int bid = geo_cell.get(cell,i);
78 proc_act = vb_int.template get<proc_>(bid);
79 shift_act = vb_int.template get<shift_id_>(bid);
81 switch_prc = (proc_act == proc_prev && shift_act == shift_prev) & switch_prc;
83 if (
Box<dim,T>(vb_int_box.get(bid)).isInsideNP(p) ==
true && switch_prc ==
false)
85 op.op(base,n,proc_act,shift_act,pi);
91 shift_prev = shift_act;
98 template<
unsigned int dim,
typename T,
typename cell_list_type,
typename vb_
int_box_type,
typename vb_
int_type>
99 __device__ __host__
inline unsigned int ghost_processorID_N_impl(
const Point<dim,T> & p,
100 cell_list_type & geo_cell,
101 vb_int_box_type & vb_int_box,
102 vb_int_type & vb_int)
106 return ghost_processorID_general_impl(p,0,0,geo_cell,vb_int_box,vb_int,op);
117 template<
unsigned int dim,
typename T,
typename Memory,
template<
typename>
class layout_base>
openfpm::vector_gpu_ker< Box< dim, T >, layout_base > vb_int_box
internal ghost box
grid interface available when on gpu
__device__ unsigned int ghost_processorID_cell(const Point< dim, T > &p)
Get the cell from the particle position.
This class implement the point shape in an N-dimensional space.
__device__ unsigned int ghost_processorID_N(const Point< dim, T > &p)
Get the number of processor a particle must sent.
openfpm::vector_gpu_ker< aggregate< unsigned int, unsigned int, unsigned int >, layout_base > vb_int
internal ghost box processor infos
KeyT const ValueT ValueT OffsetIteratorT OffsetIteratorT int
[in] The number of segments that comprise the sorting data
This class represent an N-dimensional box.
structure that store and compute the internal and external local ghost box. Version usable in kernel
__device__ void ghost_processor_ID(const Point< dim, T > &p, output_type &output, unsigned int base, unsigned int pi)
Get the number of processor a particle must sent.
CellList_cpu_ker< dim, T, Mem_fast_ker< Memory, memory_traits_lin, int >, shift< dim, T > > geo_cell
Cell-list that store the geometrical information of the internal ghost boxes.
aggregate of properties, from a list of object if create a struct that follow the OPENFPM native stru...