5#ifndef OPENFPM_PDATA_DATABLOCK_CUH
6#define OPENFPM_PDATA_DATABLOCK_CUH
9#include "util/cuda_util.hpp"
15template<
typename ScalarT,
unsigned int DataBlockSize=64>
18 typedef ScalarT scalarType;
20 typedef ScalarT value_type;
22 static const unsigned int EXISTBIT = 0;
24 static const unsigned int size = DataBlockSize;
27 __device__ __host__
DataBlock() =
default;
33 block[threadIdx.x % size] = other.block[threadIdx.x % size];
36 memcpy(block, other.block, size *
sizeof(ScalarT));
44 block[threadIdx.x % size] = other.block[threadIdx.x % size];
47 memcpy(block, other.block, size *
sizeof(ScalarT));
52 __device__ __host__
inline DataBlock & operator=(ScalarT v)
56 block[threadIdx.x % size] = v;
59 for (
unsigned int i = 0; i < size; ++i)
67 __device__ __host__
inline ScalarT &operator[](
unsigned int i)
72 __device__ __host__
inline const ScalarT &operator[](
unsigned int i)
const