5 #ifndef OPENFPM_PDATA_DATABLOCK_CUH 6 #define OPENFPM_PDATA_DATABLOCK_CUH 9 #include "util/cuda_util.hpp" 15 template<
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];
35 #else // __CUDA_ARCH__ 36 memcpy(block, other.block, size *
sizeof(ScalarT));
37 #endif // __CUDA_ARCH__ 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 78 #endif //OPENFPM_PDATA_DATABLOCK_CUH