OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base > Class Template Reference

Detailed Description

template<typename AggregateBlockT, unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
class BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >

Definition at line 41 of file BlockMapGpu.hpp.

+ Inheritance diagram for BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >:

Public Types

typedef AggregateBlockT AggregateType
 

Public Member Functions

void clear ()
 
void swap (self &bm)
 
sparse_grid_bck_value< typename std::remove_reference< decltype(blockMap.getBackground())>::type > getBackgroundValue ()
 Get the background value.
 
template<unsigned int p>
auto get (unsigned int linId) const -> const ScalarTypeOf< AggregateBlockT, p > &
 
auto get (unsigned int linId) const -> const decltype(blockMap.get(0)) &
 
template<unsigned int p>
auto insert (unsigned int linId) -> ScalarTypeOf< AggregateBlockT, p > &
 insert data, host version
 
auto insert_o (unsigned int linId) -> decltype(blockMap.insert(0))
 insert data, host version
 
template<unsigned int p>
auto insertBlockFlush (size_t blockId) -> decltype(blockMap.insertFlush(blockId, is_new).template get< p >())
 insert a block + flush, host version
 
auto insertBlockFlush (size_t blockId) -> decltype(blockMap.insertFlush(blockId, is_new))
 insert a block + flush, host version
 
BlockMapGpu_ker< AggregateInternalT, indexT, layout_base > toKernel ()
 
template<unsigned int ... prp>
void deviceToHost ()
 
void deviceToHost ()
 
template<unsigned int ... prp>
void hostToDevice ()
 
void hostToDevice ()
 
void setGPUInsertBuffer (int nBlock, int nSlot)
 
void preFlush ()
 In case we manually set the added index buffer and the add data buffer we have to call this function before flush.
 
void initializeGPUInsertBuffer ()
 
template<typename ... v_reduce>
void flush (gpu::ofp_context_t &context, flush_type opt=FLUSH_ON_HOST)
 
template<unsigned int p, typename TypeBck >
void setBackgroundValue (TypeBck backgroundValue)
 set the background for property p
 
void removeUnusedBuffers ()
 Eliminate many internal temporary buffer you can use this between flushes if you get some out of memory.
 
decltype(blockMap) & private_get_blockMap_non_const ()
 Return internal structure block map.
 
decltype(blockMap) & private_get_blockMap ()
 Return internal structure block map.
 
const decltype(blockMap) & private_get_blockMap () const
 Return internal structure block map.
 

Static Public Member Functions

template<typename BitMaskT >
static bool getBit (const BitMaskT &bitMask, unsigned char pos)
 
template<typename BitMaskT >
static bool setBit (BitMaskT &bitMask, unsigned char pos)
 
template<typename BitMaskT >
static bool unsetBit (BitMaskT &bitMask, unsigned char pos)
 
template<typename BitMaskT >
static bool exist (BitMaskT &bitMask)
 
template<typename BitMaskT >
static void setExist (BitMaskT &bitMask)
 
template<typename BitMaskT >
static void unsetExist (BitMaskT &bitMask)
 

Protected Types

typedef AggregateAppend< DataBlock< unsignedchar, BlockT0::size >, AggregateBlockT >::type AggregateInternalT
 

Protected Attributes

openfpm::vector_sparse_gpu_block< AggregateInternalT, BlockMapGpuFunctors::BlockFunctor< threadBlockSize >, indexT > blockMap
 

Static Protected Attributes

static const unsigned char EXIST_BIT = 0
 
static const unsigned int pMask = AggregateInternalT::max_prop_real - 1
 

Private Types

typedef BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base > self
 
typedef BlockTypeOf< AggregateBlockT, 0 > BlockT0
 

Private Attributes

bool is_new
 

Member Typedef Documentation

◆ AggregateInternalT

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
typedef AggregateAppend<DataBlock<unsignedchar,BlockT0::size>,AggregateBlockT>::type BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::AggregateInternalT
protected

Definition at line 63 of file BlockMapGpu.hpp.

◆ AggregateType

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
typedef AggregateBlockT BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::AggregateType

Definition at line 72 of file BlockMapGpu.hpp.

◆ BlockT0

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
typedef BlockTypeOf<AggregateBlockT, 0> BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::BlockT0
private

Definition at line 47 of file BlockMapGpu.hpp.

◆ self

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
typedef BlockMapGpu<AggregateBlockT,threadBlockSize,indexT,layout_base> BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::self
private

Definition at line 45 of file BlockMapGpu.hpp.

Member Function Documentation

◆ clear()

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
void BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::clear ( )
inline

Definition at line 76 of file BlockMapGpu.hpp.

◆ deviceToHost() [1/2]

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
template<unsigned int ... prp>
void BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::deviceToHost ( )
inline

Definition at line 231 of file BlockMapGpu.hpp.

◆ deviceToHost() [2/2]

template<typename AggregateBlockT , unsigned int threadBlockSize, typename indexT , template< typename > class layout_base>
void BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::deviceToHost

Definition at line 405 of file BlockMapGpu.hpp.

◆ exist()

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
template<typename BitMaskT >
static bool BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::exist ( BitMaskT &  bitMask)
inlinestatic

Definition at line 347 of file BlockMapGpu.hpp.

◆ flush()

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
template<typename ... v_reduce>
void BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::flush ( gpu::ofp_context_t context,
flush_type  opt = FLUSH_ON_HOST 
)
inline

Definition at line 290 of file BlockMapGpu.hpp.

◆ get() [1/2]

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
auto BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::get ( unsigned int  linId) const -> const decltype(blockMap.get(0)) &
inline

Definition at line 128 of file BlockMapGpu.hpp.

◆ get() [2/2]

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
template<unsigned int p>
auto BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::get ( unsigned int  linId) const -> const ScalarTypeOf<AggregateBlockT, p> &
inline

Definition at line 109 of file BlockMapGpu.hpp.

◆ getBackgroundValue()

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
sparse_grid_bck_value< typename std::remove_reference< decltype(blockMap.getBackground())>::type > BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::getBackgroundValue ( )
inline

Get the background value.

Returns
background value

Get the background value

Returns
background value

Definition at line 101 of file BlockMapGpu.hpp.

◆ getBit()

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
template<typename BitMaskT >
static bool BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::getBit ( const BitMaskT &  bitMask,
unsigned char  pos 
)
inlinestatic

Definition at line 329 of file BlockMapGpu.hpp.

◆ hostToDevice() [1/2]

template<typename AggregateBlockT , unsigned int threadBlockSize, typename indexT , template< typename > class layout_base>
template<unsigned int ... prp>
void BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::hostToDevice

Definition at line 412 of file BlockMapGpu.hpp.

◆ hostToDevice() [2/2]

template<typename AggregateBlockT , unsigned int threadBlockSize, typename indexT , template< typename > class layout_base>
void BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::hostToDevice

Definition at line 418 of file BlockMapGpu.hpp.

◆ initializeGPUInsertBuffer()

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
void BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::initializeGPUInsertBuffer ( )
inline

Definition at line 270 of file BlockMapGpu.hpp.

◆ insert()

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
template<unsigned int p>
auto BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::insert ( unsigned int  linId) -> ScalarTypeOf<AggregateBlockT, p> &
inline

insert data, host version

Template Parameters
propertyid
Parameters
linIdlinearized id block + local linearization
Returns
a reference to the data

Definition at line 147 of file BlockMapGpu.hpp.

◆ insert_o()

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
auto BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::insert_o ( unsigned int  linId) -> decltype(blockMap.insert(0))
inline

insert data, host version

Template Parameters
propertyid
Parameters
linIdlinearized id block + local linearization
Returns
a reference to the data

Definition at line 168 of file BlockMapGpu.hpp.

◆ insertBlockFlush() [1/2]

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
auto BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::insertBlockFlush ( size_t  blockId) -> decltype(blockMap.insertFlush(blockId,is_new))
inline

insert a block + flush, host version

Parameters
linIdlinearized id block
Returns
a reference to the block data

Definition at line 210 of file BlockMapGpu.hpp.

◆ insertBlockFlush() [2/2]

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
template<unsigned int p>
auto BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::insertBlockFlush ( size_t  blockId) -> decltype(blockMap.insertFlush(blockId,is_new).template get<p>())
inline

insert a block + flush, host version

Template Parameters
propertyid
Parameters
linIdlinearized id block
Returns
a reference to the block data

Definition at line 187 of file BlockMapGpu.hpp.

◆ preFlush()

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
void BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::preFlush ( )
inline

In case we manually set the added index buffer and the add data buffer we have to call this function before flush.

Definition at line 265 of file BlockMapGpu.hpp.

◆ private_get_blockMap() [1/2]

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
decltype(blockMap) & BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::private_get_blockMap ( )
inline

Return internal structure block map.

Returns
the blockMap

Definition at line 388 of file BlockMapGpu.hpp.

◆ private_get_blockMap() [2/2]

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
const decltype(blockMap) & BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::private_get_blockMap ( ) const
inline

Return internal structure block map.

Returns
the blockMap

Definition at line 398 of file BlockMapGpu.hpp.

◆ private_get_blockMap_non_const()

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
decltype(blockMap) & BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::private_get_blockMap_non_const ( )
inline

Return internal structure block map.

Returns
the blockMap

Definition at line 378 of file BlockMapGpu.hpp.

◆ removeUnusedBuffers()

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
void BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::removeUnusedBuffers ( )
inline

Eliminate many internal temporary buffer you can use this between flushes if you get some out of memory.

Definition at line 368 of file BlockMapGpu.hpp.

◆ setBackgroundValue()

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
template<unsigned int p, typename TypeBck >
void BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::setBackgroundValue ( TypeBck  backgroundValue)
inline

set the background for property p

Template Parameters
pproperty p

Definition at line 307 of file BlockMapGpu.hpp.

◆ setBit()

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
template<typename BitMaskT >
static bool BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::setBit ( BitMaskT &  bitMask,
unsigned char  pos 
)
inlinestatic

Definition at line 335 of file BlockMapGpu.hpp.

◆ setExist()

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
template<typename BitMaskT >
static void BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::setExist ( BitMaskT &  bitMask)
inlinestatic

Definition at line 353 of file BlockMapGpu.hpp.

◆ setGPUInsertBuffer()

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
void BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::setGPUInsertBuffer ( int  nBlock,
int  nSlot 
)
inline

\Brief Before inser any element you have to call this function to initialize the insert buffer

Parameters
nBlocknumber of blocks the insert buffer has
nSlotmaximum number of insertion each thread block does

Definition at line 249 of file BlockMapGpu.hpp.

◆ swap()

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
void BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::swap ( self bm)
inline

Definition at line 81 of file BlockMapGpu.hpp.

◆ toKernel()

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
BlockMapGpu_ker< AggregateInternalT, indexT, layout_base > BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::toKernel ( )
inline

Definition at line 224 of file BlockMapGpu.hpp.

◆ unsetBit()

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
template<typename BitMaskT >
static bool BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::unsetBit ( BitMaskT &  bitMask,
unsigned char  pos 
)
inlinestatic

Definition at line 341 of file BlockMapGpu.hpp.

◆ unsetExist()

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
template<typename BitMaskT >
static void BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::unsetExist ( BitMaskT &  bitMask)
inlinestatic

Definition at line 359 of file BlockMapGpu.hpp.

Field Documentation

◆ blockMap

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
openfpm::vector_sparse_gpu_block< AggregateInternalT, BlockMapGpuFunctors::BlockFunctor<threadBlockSize>, indexT > BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::blockMap
protected

Definition at line 69 of file BlockMapGpu.hpp.

◆ EXIST_BIT

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
const unsigned char BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::EXIST_BIT = 0
staticprotected

Definition at line 62 of file BlockMapGpu.hpp.

◆ is_new

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
bool BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::is_new
private

Definition at line 49 of file BlockMapGpu.hpp.

◆ pMask

template<typename AggregateBlockT , unsigned int threadBlockSize = 128, typename indexT = long int, template< typename > class layout_base = memory_traits_inte>
const unsigned int BlockMapGpu< AggregateBlockT, threadBlockSize, indexT, layout_base >::pMask = AggregateInternalT::max_prop_real - 1
staticprotected

Definition at line 64 of file BlockMapGpu.hpp.


The documentation for this class was generated from the following file: