GEOS
|
#include <LifoStorageCuda.hpp>
Public Member Functions | |
LifoStorageCuda (std::string name, size_t elemCnt, int numberOfBuffersToStoreOnDevice, int numberOfBuffersToStoreOnHost, int maxNumberOfBuffers) | |
void | pushAsync (arrayView1d< T > array) override final |
void | pushWait () override final |
void | popAsync (arrayView1d< T > array) override final |
void | popWait () override final |
Public Member Functions inherited from geos::LifoStorageCommon< T, INDEX_TYPE > | |
LifoStorageCommon (std::string name, size_t elemCnt, int numberOfBuffersToStoreOnHost, int maxNumberOfBuffers) | |
void | popAsyncPrelude () |
bool | empty () |
Static Public Member Functions | |
static int | computeNumberOfBufferOnDevice (int percent, size_t bufferSize, int maxNumberOfBuffers) |
Static Public Member Functions inherited from geos::LifoStorageCommon< T, INDEX_TYPE > | |
static int | computeNumberOfBufferOnHost (int percent, size_t bufferSize, int maxNumberOfBuffers, int numberOfBuffersToStoreOnDevice) |
Additional Inherited Members | |
Protected Member Functions inherited from geos::LifoStorageCommon< T, INDEX_TYPE > | |
void | hostToDisk (int id) |
void | diskToHost (int id) |
bool | dirExists (const std::string &dirName) |
void | writeOnDisk (const T *d, int id) |
void | readOnDisk (T *d, int id) |
Protected Attributes inherited from geos::LifoStorageCommon< T, INDEX_TYPE > | |
int | m_maxNumberOfBuffers |
number of buffers to be inserted into the LIFO | |
size_t | m_bufferSize |
size of one buffer in bytes | |
std::string | m_name |
name used to store data on disk | |
FixedSizeDequeWithMutexes< T, INDEX_TYPE > | m_hostDeque |
Queue of data stored on host memory. | |
int | m_bufferCount |
counter of buffer stored in LIFO | |
int | m_bufferToHostCount |
counter of buffer pushed to host | |
int | m_bufferToDiskCount |
counter of buffer pushed to disk | |
std::condition_variable | m_task_queue_not_empty_cond [2] |
condition used to tell m_worker queue has been filled or processed is stopped. | |
std::mutex | m_task_queue_mutex [2] |
mutex to protect access to m_task_queue. | |
std::deque< std::packaged_task< void() > > | m_task_queue [2] |
queue of task to be executed by m_worker. | |
std::thread | m_worker [2] |
thread to execute tasks. | |
bool | m_continue |
boolean to keep m_worker alive. | |
bool | m_hasPoppedBefore |
marker to detect first pop | |
This class is used to store in a LIFO way buffers, first on device, then on host, then on disk.
Definition at line 43 of file LifoStorageCuda.hpp.
|
inline |
A LIFO storage will store numberOfBuffersToStoreDevice buffer on deevice, numberOfBuffersToStoreHost on host and the rest on disk.
name | Prefix of the files used to save the occurenncy of the saved buffer on disk. |
elemCnt | Number of elments in the LvArray we want to store in the LIFO storage. |
numberOfBuffersToStoreOnDevice | Maximum number of array to store on device memory ( -1 = use 80% of remaining memory ). |
numberOfBuffersToStoreOnHost | Maximum number of array to store on host memory ( -1 = use 80% of remaining memory ). |
maxNumberOfBuffers | Number of arrays expected to be stores in the LIFO. |
Definition at line 59 of file LifoStorageCuda.hpp.
|
inlinestatic |
Compute the number of arrays that can be stored on device
percent | Percentage of the remaining device memory that can be dedicated to the LIFO storage. |
bufferSize | Size of one buffer |
maxNumberOfBuffers | Maximum number of buffers to store in the LIFO storage |
Definition at line 148 of file LifoStorageCuda.hpp.
|
inlinefinaloverridevirtual |
Asynchroneously copy last data from the LIFO into the LvArray.
array | LvArray to store data from the LIFO into it. |
Implements geos::LifoStorageCommon< T, INDEX_TYPE >.
Definition at line 110 of file LifoStorageCuda.hpp.
|
inlinefinaloverridevirtual |
Waits for last pop to be terminated
Implements geos::LifoStorageCommon< T, INDEX_TYPE >.
Definition at line 132 of file LifoStorageCuda.hpp.
|
inlinefinaloverridevirtual |
Asynchroneously push a copy of the given LvArray into the LIFO
array | The LvArray to store in the LIFO, should match the size of the data used in constructor. |
Implements geos::LifoStorageCommon< T, INDEX_TYPE >.
Definition at line 71 of file LifoStorageCuda.hpp.
|
inlinefinaloverridevirtual |
Waits for last push to be terminated
Implements geos::LifoStorageCommon< T, INDEX_TYPE >.
Definition at line 97 of file LifoStorageCuda.hpp.