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

#include <CE_RampCache.h>

+ Inheritance diagram for CE_RampCache::MemoryClient:

Public Member Functions

 MemoryClient (CE_RampCache &cache)
 
const char * name () const override
 Printable English name of the client. More...
 
bool freeMemoryRequest (const UT_MemoryResource *resource, RequestSeverity severity, Niceness niceness, exint amount, exint &freed_amount) override
 
bool memoryUse (const UT_MemoryResource *resource, exint &in_use, exint &cache) override
 
- Public Member Functions inherited from UT_MemoryClient
 UT_MemoryClient ()
 
virtual ~UT_MemoryClient ()
 

Additional Inherited Members

- Public Types inherited from UT_MemoryClient
enum  RequestSeverity { NORMAL_REQUEST, FATAL_REQUEST }
 The urgency of the memory free request. More...
 
enum  Niceness {
  SCRATCH_FREE, READILY_FREE, NORMAL_FREE, RELUCTANT_FREE,
  CANNOT_FREE, MAX_NICENESS
}
 How willingly a client can free memory for other clients. More...
 

Detailed Description

This memory client is used to ensure that this memory pool plays nicely with other users of memory on the OpenCL device.

Definition at line 167 of file CE_RampCache.h.

Constructor & Destructor Documentation

CE_RampCache::MemoryClient::MemoryClient ( CE_RampCache cache)
inline

Definition at line 170 of file CE_RampCache.h.

Member Function Documentation

bool CE_RampCache::MemoryClient::freeMemoryRequest ( const UT_MemoryResource resource,
RequestSeverity  severity,
Niceness  nice_level,
exint  size_in_bytes,
exint freed_amount_in_bytes 
)
inlineoverridevirtual

A 'resource' is requesting 'size_in_bytes' amount of memory be freed. If memory is freed, return true and the amount of memory freed in 'freed_amount_in_bytes' 'severity' - severity passed to UT_MemoryResource::requestMemoryFree() 'nice_level' - the current niceness level being asked to free. This will always match once of the niceness levels the client was registered with.

Implements UT_MemoryClient.

Definition at line 177 of file CE_RampCache.h.

bool CE_RampCache::MemoryClient::memoryUse ( const UT_MemoryResource resource,
exint in_use_size_bytes,
exint cached_size_bytes 
)
inlineoverridevirtual

Report the amount of memory this client is using from 'resource' 'in_use' refers to memory that is currently being used, where as 'cached' refers to memory that'd being held either for reuse or scratch buffers. Return true if the size can be meaningully reported.

Reimplemented from UT_MemoryClient.

Definition at line 186 of file CE_RampCache.h.

const char* CE_RampCache::MemoryClient::name ( ) const
inlineoverridevirtual

Printable English name of the client.

Implements UT_MemoryClient.

Definition at line 172 of file CE_RampCache.h.


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