8#ifndef IE_GHOST_GPU_CUH_
9#define IE_GHOST_GPU_CUH_
11#include "data_type/aggregate.hpp"
13constexpr unsigned int lc_proc_ = 0;
14constexpr unsigned int proc_ = 1;
15constexpr unsigned int shift_id_ = 2;
17template<
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)
40template<
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;
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;
85 op.op(base,n,proc_act,shift_act,pi);
91 shift_prev = shift_act;
98template<
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);
117template<
unsigned int dim,
typename T,
typename Memory,
template<
typename>
class layout_base>
This class represent an N-dimensional box.
__device__ __host__ bool isInsideNP(const Point< dim, T > &p) const
Check if the point is inside the region excluding the positive part.
This class implement the point shape in an N-dimensional space.
structure that store and compute the internal and external local ghost box. Version usable in kernel
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.
openfpm::vector_gpu_ker< Box< dim, T >, layout_base > vb_int_box
internal ghost box
openfpm::vector_gpu_ker< aggregate< unsigned int, unsigned int, unsigned int >, layout_base > vb_int
internal ghost box processor infos
__device__ unsigned int ghost_processorID_cell(const Point< dim, T > &p)
Get the cell from the particle position.
__device__ unsigned int ghost_processorID_N(const Point< dim, T > &p)
Get the number of processor a particle must sent.
__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.
aggregate of properties, from a list of object if create a struct that follow the OPENFPM native stru...
grid interface available when on gpu