HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CE_RampCache Class Reference

This class implements a pool for UT_Ramps on the GPU. More...

#include <CE_RampCache.h>

Classes

class  MemoryClient
 
class  RampEntry
 

Public Member Functions

 CE_RampCache (exint size)
 Initialize the pool with specified maximum size. More...
 
 ~CE_RampCache ()
 
void clear ()
 Empty the memory pool of all held buffers. More...
 
cl::Buffer lookupRamp (UT_SharedPtr< UT_Ramp > ramp, int tuplesize, int rampsize)
 
void cacheRamp (cl::Buffer buffer, UT_SharedPtr< UT_Ramp > ramp, int tuplesize, int rampsize)
 Adds to the cache. More...
 
void getUsage (exint &total, exint &not_in_use) const
 
exint freeMemory (exint amount)
 

Protected Types

using RampLRU = UT_LRUCache< CE_RampKey, RampEntry, RampEntry::computeNumBytes >
 

Protected Attributes

RampLRU myRampCache
 
UT_Lock myRampCacheLock
 
MemoryClient myMemoryClient
 The memory client that's registered with the OpenCL device. More...
 

Friends

size_t hash_value (const CE_RampKey &val)
 

Detailed Description

This class implements a pool for UT_Ramps on the GPU.

Definition at line 90 of file CE_RampCache.h.

Member Typedef Documentation

Constructor & Destructor Documentation

CE_RampCache::CE_RampCache ( exint  size)

Initialize the pool with specified maximum size.

CE_RampCache::~CE_RampCache ( )

Member Function Documentation

void CE_RampCache::cacheRamp ( cl::Buffer  buffer,
UT_SharedPtr< UT_Ramp ramp,
int  tuplesize,
int  rampsize 
)

Adds to the cache.

void CE_RampCache::clear ( )

Empty the memory pool of all held buffers.

exint CE_RampCache::freeMemory ( exint  amount)

Attempts to release the requested amount of memory back to the system. Returns the amount actually freed.

void CE_RampCache::getUsage ( exint total,
exint not_in_use 
) const

Query the current usage; total is the total amount of memory held by the pool, not_in_use is the amount that can be freed immediately on demand.

cl::Buffer CE_RampCache::lookupRamp ( UT_SharedPtr< UT_Ramp ramp,
int  tuplesize,
int  rampsize 
)

Returns empty buffer if not in cache. This buffer remains owned by the cache; insofar as calling CE_Context::releaseBuffer.

Friends And Related Function Documentation

size_t hash_value ( const CE_RampKey val)
friend

Member Data Documentation

MemoryClient CE_RampCache::myMemoryClient
protected

The memory client that's registered with the OpenCL device.

Definition at line 203 of file CE_RampCache.h.

RampLRU CE_RampCache::myRampCache
protected

Definition at line 199 of file CE_RampCache.h.

UT_Lock CE_RampCache::myRampCacheLock
mutableprotected

Definition at line 200 of file CE_RampCache.h.


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