GEOSX
Public Member Functions | List of all members
geos::LifoStorage< T, INDEX_TYPE > Class Template Reference

#include <LifoStorage.hpp>

Public Member Functions

 LifoStorage (std::string name, size_t elemCnt, int numberOfBuffersToStoreOnDevice, int numberOfBuffersToStoreOnHost, int maxNumberOfBuffers)
 
 LifoStorage (std::string name, arrayView1d< T > array, int numberOfBuffersToStoreOnDevice, int numberOfBuffersToStoreOnHost, int maxNumberOfBuffers)
 
void pushAsync (arrayView1d< T > array)
 
void pushWait ()
 
void push (arrayView1d< T > array)
 
void popAsync (arrayView1d< T > array)
 
void popWait ()
 
void pop (arrayView1d< T > array)
 
bool empty ()
 

Detailed Description

template<typename T, typename INDEX_TYPE>
class geos::LifoStorage< T, INDEX_TYPE >

This class is used to store in a LIFO way buffers, first on device, then on host, then on disk.

Definition at line 41 of file LifoStorage.hpp.

Constructor & Destructor Documentation

◆ LifoStorage() [1/2]

template<typename T , typename INDEX_TYPE >
geos::LifoStorage< T, INDEX_TYPE >::LifoStorage ( std::string  name,
size_t  elemCnt,
int  numberOfBuffersToStoreOnDevice,
int  numberOfBuffersToStoreOnHost,
int  maxNumberOfBuffers 
)
inline

A LIFO storage will store numberOfBuffersToStoreDevice buffer on deevice, numberOfBuffersToStoreHost on host and the rest on disk.

Parameters
namePrefix of the files used to save the occurenncy of the saved buffer on disk.
elemCntNumber of elments in the LvArray we want to store in the LIFO storage.
numberOfBuffersToStoreOnDeviceMaximum number of array to store on device memory. If negative opposite of the percent of left memory we want to use( -80 = use 80% of remaining memory ).
numberOfBuffersToStoreOnHostMaximum number of array to store on host memory . If negative opposite of the percent of left memory we want to use( -80 = use 80% of remaining memory ).
maxNumberOfBuffersNumber of arrays expected to be stores in the LIFO.

Definition at line 59 of file LifoStorage.hpp.

◆ LifoStorage() [2/2]

template<typename T , typename INDEX_TYPE >
geos::LifoStorage< T, INDEX_TYPE >::LifoStorage ( std::string  name,
arrayView1d< T >  array,
int  numberOfBuffersToStoreOnDevice,
int  numberOfBuffersToStoreOnHost,
int  maxNumberOfBuffers 
)
inline

Build a LIFO storage for a given LvArray array.

Parameters
namePrefix of the files used to save the occurenncy of the saved buffer on disk.
arrayThe LvArray that will be store in the LIFO.
numberOfBuffersToStoreOnDeviceMaximum number of array to store on device memory.
numberOfBuffersToStoreOnHostMaximum number of array to store on host memory.
maxNumberOfBuffersNumber of arrays expected to be stores in the LIFO.

Definition at line 104 of file LifoStorage.hpp.

Member Function Documentation

◆ empty()

template<typename T , typename INDEX_TYPE >
bool geos::LifoStorage< T, INDEX_TYPE >::empty ( )
inline

Check if the LIFO is empty

Returns
true if the LIFO does not contain a buffer.

Definition at line 177 of file LifoStorage.hpp.

◆ pop()

template<typename T , typename INDEX_TYPE >
void geos::LifoStorage< T, INDEX_TYPE >::pop ( arrayView1d< T >  array)
inline

Copy last data from the LIFO into the LvArray.

Parameters
arrayLvArray to store data from the LIFO into it.

Definition at line 165 of file LifoStorage.hpp.

◆ popAsync()

template<typename T , typename INDEX_TYPE >
void geos::LifoStorage< T, INDEX_TYPE >::popAsync ( arrayView1d< T >  array)
inline

Asynchroneously copy last data from the LIFO into the LvArray.

Parameters
arrayLvArray to store data from the LIFO into it.

Definition at line 144 of file LifoStorage.hpp.

◆ popWait()

template<typename T , typename INDEX_TYPE >
void geos::LifoStorage< T, INDEX_TYPE >::popWait ( )
inline

Waits for last pop to be terminated

Definition at line 154 of file LifoStorage.hpp.

◆ push()

template<typename T , typename INDEX_TYPE >
void geos::LifoStorage< T, INDEX_TYPE >::push ( arrayView1d< T >  array)
inline

Push a copy of the given LvArray into the LIFO

Parameters
arrayThe LvArray to store in the LIFO, should match the size of the data used in constructor.

Definition at line 132 of file LifoStorage.hpp.

◆ pushAsync()

template<typename T , typename INDEX_TYPE >
void geos::LifoStorage< T, INDEX_TYPE >::pushAsync ( arrayView1d< T >  array)
inline

Asynchroneously push a copy of the given LvArray into the LIFO

Parameters
arrayThe LvArray to store in the LIFO, should match the size of the data used in constructor.

Definition at line 112 of file LifoStorage.hpp.

◆ pushWait()

template<typename T , typename INDEX_TYPE >
void geos::LifoStorage< T, INDEX_TYPE >::pushWait ( )
inline

Waits for last push to be terminated

Definition at line 121 of file LifoStorage.hpp.


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