curfil  ..
 All Classes Functions Variables Typedefs Friends Groups Pages
Public Member Functions | Protected Member Functions | List of all members
curfil::DeviceCache Class Reference

Abstract base class that implements a simple LRU cache on GPU. More...

#include <random_tree_image_gpu.h>

Inheritance diagram for curfil::DeviceCache:
curfil::ImageCache curfil::TreeCache

Public Member Functions

std::map< const void *, size_t > & getIdMap ()
bool containsElement (const void *element) const
size_t getElementPos (const void *element) const
void clear ()
 Clear the entire cache.
size_t getTotalTransferTimeMircoseconds () const

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
Returns
the cache size

Definition at line 200 of file random_tree_image_gpu.h.

virtual std::string curfil::DeviceCache::getElementName ( const void *  element) const
protectedpure virtual
Returns
the passed element's name

Implemented in curfil::TreeCache, and curfil::ImageCache.

size_t curfil::DeviceCache::getElementPos ( const void *  element) const
Returns
the position in cache of the given element
Exceptions
runtime_exceptionif the given element is not in cache
virtual std::string curfil::DeviceCache::getElementsName ( ) const
protectedpure virtual
Returns
all elements names

Implemented in curfil::TreeCache, and curfil::ImageCache.

std::map<const void*, size_t>& curfil::DeviceCache::getIdMap ( )
inline
Returns
a mapping of the in-cache elements to their according positions

Definition at line 137 of file random_tree_image_gpu.h.

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
Returns
whether texture is bound

Definition at line 177 of file random_tree_image_gpu.h.


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