11 #ifndef __CE_RampCache__
12 #define __CE_RampCache__
120 myNumBytes = numbytes;
124 myNumBytes =
b.myNumBytes;
125 myBuffer = std::move(
b.myBuffer);
132 myNumBytes =
b.myNumBytes;
133 myBuffer = std::move(
b.myBuffer);
140 void destroyBuffers();
159 void getUsage(
exint& total,
exint& not_in_use)
const;
172 const char*
name()
const override
174 return "OpenCL Ramp Cache";
182 freed_amount = myRampCache.freeMemory(amount);
183 return freed_amount > 0;
187 exint& cache)
override
189 myRampCache.getUsage(in_use, cache);
UT_SharedPtr< UT_Ramp > myRamp
std::size_t SYS_HashType
Define the type for hash values.
MemoryClient(CE_RampCache &cache)
RampEntry(cl::Buffer buffer, exint numbytes)
bool freeMemoryRequest(const UT_MemoryResource *resource, RequestSeverity severity, Niceness niceness, exint amount, exint &freed_amount) override
MemoryClient myMemoryClient
The memory client that's registered with the OpenCL device.
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
CE_API CE_RampCache * CEgetRampCache()
GLboolean GLboolean GLboolean b
RampEntry & operator=(RampEntry &&b)
bool operator==(const CE_RampKey &from) const
This class implements a pool for UT_Ramps on the GPU.
std::size_t operator()(const CE_RampKey &key) const noexcept
SYS_HashType hash() const
IMATH_NAMESPACE::V2f IMATH_NAMESPACE::Box2i std::string this attribute is obsolete as of OpenEXR v3 float
cl::Buffer buffer() const
CE_RampKey(UT_SharedPtr< UT_Ramp > ramp, int tuplesize, int rampsize)
static exint computeNumBytes(const RampEntry &entry)
Niceness
How willingly a client can free memory for other clients.
bool memoryUse(const UT_MemoryResource *resource, exint &in_use, exint &cache) override
Wrapper for a client of a limit memory resource.
RequestSeverity
The urgency of the memory free request.
const char * name() const override
Printable English name of the client.
size_t hash_value(const CH_ChannelRef &ref)