Abstract base class that implements a simple LRU cache on GPU.
More...
#include <random_tree_image_gpu.h>
Protected Member Functions |
bool | isBound () const |
void | setBound (bool bound) |
| set the texture bound property
|
void | updateCacheSize (size_t cacheSize) |
| set the cache size to the passed size
|
virtual void | bind ()=0 |
| bind texture to array
|
virtual void | unbind ()=0 |
| unbind the texture
|
virtual void | allocArray ()=0 |
| allocate a CUDA array
|
virtual void | freeArray ()=0 |
| clear texture data and free the array
|
size_t | getCacheSize () const |
void | copyElements (size_t cacheSize, const std::set< const void * > &elements) |
| resize the cache and transfer the elements to GPU
|
virtual void | transferElement (size_t pos, const void *element, cudaStream_t stream)=0 |
| transfer the element's value at the passed position to GPU
|
virtual std::string | getElementName (const void *element) const =0 |
virtual std::string | getElementsName () const =0 |
Detailed Description
Abstract base class that implements a simple LRU cache on GPU.
Definition at line 128 of file random_tree_image_gpu.h.
Member Function Documentation
bool curfil::DeviceCache::containsElement |
( |
const void * |
element | ) |
const |
- Returns
- true if and only if the given element is in cache.
size_t curfil::DeviceCache::getCacheSize |
( |
| ) |
const |
|
inlineprotected |
virtual std::string curfil::DeviceCache::getElementName |
( |
const void * |
element | ) |
const |
|
protectedpure virtual |
size_t curfil::DeviceCache::getElementPos |
( |
const void * |
element | ) |
const |
- Returns
- the position in cache of the given element
- Exceptions
-
runtime_exception | if the given element is not in cache |
virtual std::string curfil::DeviceCache::getElementsName |
( |
| ) |
const |
|
protectedpure virtual |
std::map<const void*, size_t>& curfil::DeviceCache::getIdMap |
( |
| ) |
|
|
inline |
size_t curfil::DeviceCache::getTotalTransferTimeMircoseconds |
( |
| ) |
const |
|
inline |
- Returns
- the total elapsed time in microseconds that was spent to transfer data to the cache
Definition at line 160 of file random_tree_image_gpu.h.
bool curfil::DeviceCache::isBound |
( |
| ) |
const |
|
inlineprotected |
The documentation for this class was generated from the following file: