CLEvaluator Class Reference

#include <clEvaluator.h>

Public Types

typedef bool Instantiatable
 

Public Member Functions

 CLEvaluator (cl_context context, cl_command_queue queue)
 Constructor. More...
 
 ~CLEvaluator ()
 Desctructor. More...
 
template<typename SRC_BUFFER , typename DST_BUFFER , typename STENCIL_TABLE >
bool EvalStencils (SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable) const
 
template<typename SRC_BUFFER , typename DST_BUFFER , typename STENCIL_TABLE >
bool EvalStencils (SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable) const
 
bool EvalStencils (cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, BufferDescriptor const &dstDesc, cl_mem sizes, cl_mem offsets, cl_mem indices, cl_mem weights, int start, int end) const
 
bool EvalStencils (cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, cl_mem dv, BufferDescriptor const &dvDesc, cl_mem sizes, cl_mem offsets, cl_mem indices, cl_mem weights, cl_mem duWeights, cl_mem dvWeights, int start, int end) const
 
template<typename SRC_BUFFER , typename DST_BUFFER , typename PATCHCOORD_BUFFER , typename PATCH_TABLE >
bool EvalPatches (SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
 Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way. More...
 
template<typename SRC_BUFFER , typename DST_BUFFER , typename PATCHCOORD_BUFFER , typename PATCH_TABLE >
bool EvalPatches (SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
 Generic limit eval function with derivatives. This function has a same signature as other device kernels have so that it can be called in the same way. More...
 
bool EvalPatches (cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, cl_mem dv, BufferDescriptor const &dvDesc, int numPatchCoords, cl_mem patchCoordsBuffer, cl_mem patchArrayBuffer, cl_mem patchIndexBuffer, cl_mem patchParamsBuffer) const
 
bool Compile (BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc)
 

Static Public Member Functions

template<typename DEVICE_CONTEXT >
static CLEvaluatorCreate (BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, DEVICE_CONTEXT deviceContext)
 Generic creator template. More...
 
static CLEvaluatorCreate (BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, cl_context clContext, cl_command_queue clCommandQueue)
 
template<typename SRC_BUFFER , typename DST_BUFFER , typename STENCIL_TABLE , typename DEVICE_CONTEXT >
static bool EvalStencils (SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext)
 Generic static compute function. This function has a same signature as other device kernels have so that it can be called transparently from OsdMesh template interface. More...
 
template<typename SRC_BUFFER , typename DST_BUFFER , typename STENCIL_TABLE , typename DEVICE_CONTEXT >
static bool EvalStencils (SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext)
 Generic static compute function. This function has a same signature as other device kernels have so that it can be called transparently from OsdMesh template interface. More...
 
template<typename SRC_BUFFER , typename DST_BUFFER , typename PATCHCOORD_BUFFER , typename PATCH_TABLE , typename DEVICE_CONTEXT >
static bool EvalPatches (SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext)
 Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way. More...
 
template<typename SRC_BUFFER , typename DST_BUFFER , typename PATCHCOORD_BUFFER , typename PATCH_TABLE , typename DEVICE_CONTEXT >
static bool EvalPatches (SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext)
 Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way. More...
 
template<typename DEVICE_CONTEXT >
static void Synchronize (DEVICE_CONTEXT deviceContext)
 Wait the OpenCL kernels finish. More...
 
static void Synchronize (cl_command_queue queue)
 

Detailed Description

Definition at line 92 of file clEvaluator.h.

Member Typedef Documentation

typedef bool Instantiatable

Definition at line 94 of file clEvaluator.h.

Constructor & Destructor Documentation

CLEvaluator ( cl_context  context,
cl_command_queue  queue 
)

Constructor.

Desctructor.

Member Function Documentation

bool Compile ( BufferDescriptor const &  srcDesc,
BufferDescriptor const &  dstDesc,
BufferDescriptor const &  duDesc,
BufferDescriptor const &  dvDesc 
)

Other methods


Configure OpenCL kernel. Returns false if it fails to compile the kernel.

static CLEvaluator* Create ( BufferDescriptor const &  srcDesc,
BufferDescriptor const &  dstDesc,
BufferDescriptor const &  duDesc,
BufferDescriptor const &  dvDesc,
DEVICE_CONTEXT  deviceContext 
)
inlinestatic

Generic creator template.

Definition at line 103 of file clEvaluator.h.

static CLEvaluator* Create ( BufferDescriptor const &  srcDesc,
BufferDescriptor const &  dstDesc,
BufferDescriptor const &  duDesc,
BufferDescriptor const &  dvDesc,
cl_context  clContext,
cl_command_queue  clCommandQueue 
)
inlinestatic

Definition at line 113 of file clEvaluator.h.

static bool EvalPatches ( SRC_BUFFER *  srcBuffer,
BufferDescriptor const &  srcDesc,
DST_BUFFER *  dstBuffer,
BufferDescriptor const &  dstDesc,
int  numPatchCoords,
PATCHCOORD_BUFFER *  patchCoords,
PATCH_TABLE *  patchTable,
CLEvaluator const *  instance,
DEVICE_CONTEXT  deviceContext 
)
inlinestatic

Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.


Limit evaluations with PatchTable


Parameters
srcBufferInput primvar buffer. must have BindCLBuffer() method returning a CL buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer must have BindCLBuffer() method returning a CL buffer object of destination data
dstDescvertex buffer descriptor for the output buffer
numPatchCoordsnumber of patchCoords.
patchCoordsarray of locations to be evaluated. must have BindCLBuffer() method returning an array of PatchCoord struct.
patchTableCLPatchTable or equivalent
instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem.
deviceContextclient providing context class which supports cL_context GetContext() cl_command_queue GetCommandQueue() methods.

Definition at line 379 of file clEvaluator.h.

static bool EvalPatches ( SRC_BUFFER *  srcBuffer,
BufferDescriptor const &  srcDesc,
DST_BUFFER *  dstBuffer,
BufferDescriptor const &  dstDesc,
DST_BUFFER *  duBuffer,
BufferDescriptor const &  duDesc,
DST_BUFFER *  dvBuffer,
BufferDescriptor const &  dvDesc,
int  numPatchCoords,
PATCHCOORD_BUFFER *  patchCoords,
PATCH_TABLE *  patchTable,
CLEvaluator const *  instance,
DEVICE_CONTEXT  deviceContext 
)
inlinestatic

Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.

Parameters
srcBufferInput primvar buffer. must have BindCLBuffer() method returning a CL buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer must have BindCLBuffer() method returning a CL buffer object of destination data
dstDescvertex buffer descriptor for the output buffer
duBuffer
duDesc
dvBuffer
dvDesc
numPatchCoordsnumber of patchCoords.
patchCoordsarray of locations to be evaluated. must have BindCLBuffer() method returning an array of PatchCoord struct
patchTableCLPatchTable or equivalent
instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem.
deviceContextclient providing context class which supports cL_context GetContext() cl_command_queue GetCommandQueue() methods.

Definition at line 458 of file clEvaluator.h.

bool EvalPatches ( SRC_BUFFER *  srcBuffer,
BufferDescriptor const &  srcDesc,
DST_BUFFER *  dstBuffer,
BufferDescriptor const &  dstDesc,
int  numPatchCoords,
PATCHCOORD_BUFFER *  patchCoords,
PATCH_TABLE *  patchTable 
) const
inline

Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.

Parameters
srcBufferInput primvar buffer. must have BindCLBuffer() method returning a CL buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer must have BindCLBuffer() method returning a CL buffer object of destination data
dstDescvertex buffer descriptor for the output buffer
numPatchCoordsnumber of patchCoords.
patchCoordsarray of locations to be evaluated. must have BindCLBuffer() method returning an array of PatchCoord struct.
patchTableCLPatchTable or equivalent

Definition at line 520 of file clEvaluator.h.

bool EvalPatches ( SRC_BUFFER *  srcBuffer,
BufferDescriptor const &  srcDesc,
DST_BUFFER *  dstBuffer,
BufferDescriptor const &  dstDesc,
DST_BUFFER *  duBuffer,
BufferDescriptor const &  duDesc,
DST_BUFFER *  dvBuffer,
BufferDescriptor const &  dvDesc,
int  numPatchCoords,
PATCHCOORD_BUFFER *  patchCoords,
PATCH_TABLE *  patchTable 
) const
inline

Generic limit eval function with derivatives. This function has a same signature as other device kernels have so that it can be called in the same way.

Parameters
srcBufferInput primvar buffer. must have BindCLBuffer() method returning a CL buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer must have BindCLBuffer() method returning a CL buffer object of destination data
dstDescvertex buffer descriptor for the output buffer
duBufferOutput U-derivatives buffer must have BindCLBuffer() method returning a CL buffer object of destination data of Du
duDescvertex buffer descriptor for the duBuffer
dvBufferOutput V-derivatives buffer must have BindCLBuffer() method returning a CL buffer object of destination data of Dv
dvDescvertex buffer descriptor for the dvBuffer
numPatchCoordsnumber of patchCoords.
patchCoordsarray of locations to be evaluated.
patchTableCLPatchTable or equivalent

Definition at line 574 of file clEvaluator.h.

bool EvalPatches ( cl_mem  src,
BufferDescriptor const &  srcDesc,
cl_mem  dst,
BufferDescriptor const &  dstDesc,
cl_mem  du,
BufferDescriptor const &  duDesc,
cl_mem  dv,
BufferDescriptor const &  dvDesc,
int  numPatchCoords,
cl_mem  patchCoordsBuffer,
cl_mem  patchArrayBuffer,
cl_mem  patchIndexBuffer,
cl_mem  patchParamsBuffer 
) const
static bool EvalStencils ( SRC_BUFFER *  srcBuffer,
BufferDescriptor const &  srcDesc,
DST_BUFFER *  dstBuffer,
BufferDescriptor const &  dstDesc,
STENCIL_TABLE const *  stencilTable,
CLEvaluator const *  instance,
DEVICE_CONTEXT  deviceContext 
)
inlinestatic

Generic static compute function. This function has a same signature as other device kernels have so that it can be called transparently from OsdMesh template interface.


Stencil evaluations with StencilTable


Parameters
srcBufferInput primvar buffer. must have BindCLBuffer() method returning the cl_mem object for read
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer must have BindCLBuffer() method returning the cl_mem object for results to be written
dstDescvertex buffer descriptor for the output buffer
stencilTablestencil table to be applied. The table must have SSBO interfaces.
instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem.
deviceContextclient providing context class which supports cL_context GetContext() cl_command_queue GetCommandQueue() methods.

Definition at line 163 of file clEvaluator.h.

static bool EvalStencils ( SRC_BUFFER *  srcBuffer,
BufferDescriptor const &  srcDesc,
DST_BUFFER *  dstBuffer,
BufferDescriptor const &  dstDesc,
DST_BUFFER *  duBuffer,
BufferDescriptor const &  duDesc,
DST_BUFFER *  dvBuffer,
BufferDescriptor const &  dvDesc,
STENCIL_TABLE const *  stencilTable,
CLEvaluator const *  instance,
DEVICE_CONTEXT  deviceContext 
)
inlinestatic

Generic static compute function. This function has a same signature as other device kernels have so that it can be called transparently from OsdMesh template interface.

Parameters
srcBufferInput primvar buffer. must have BindCLBuffer() method returning the cl_mem object for read
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer must have BindCLBuffer() method returning the cl_mem object for results to be written
dstDescvertex buffer descriptor for the output buffer
duBufferOutput U-derivative buffer must have BindCLBuffer() method returning the cl_mem object for du results to be written
duDescvertex buffer descriptor for the du output buffer
dvBufferOutput V-derivative buffer must have BindCLBuffer() method returning the cl_mem object for dv results to be written
dvDescvertex buffer descriptor for the dv output buffer
stencilTablestencil table to be applied. The table must have SSBO interfaces.
instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem.
deviceContextclient providing context class which supports cL_context GetContext() cl_command_queue GetCommandQueue() methods.

Definition at line 235 of file clEvaluator.h.

bool EvalStencils ( SRC_BUFFER *  srcBuffer,
BufferDescriptor const &  srcDesc,
DST_BUFFER *  dstBuffer,
BufferDescriptor const &  dstDesc,
STENCIL_TABLE const *  stencilTable 
) const
inline

Generic compute function. Dispatch the CL compute kernel asynchronously. Returns false if the kernel hasn't been compiled yet.

Definition at line 271 of file clEvaluator.h.

bool EvalStencils ( SRC_BUFFER *  srcBuffer,
BufferDescriptor const &  srcDesc,
DST_BUFFER *  dstBuffer,
BufferDescriptor const &  dstDesc,
DST_BUFFER *  duBuffer,
BufferDescriptor const &  duDesc,
DST_BUFFER *  dvBuffer,
BufferDescriptor const &  dvDesc,
STENCIL_TABLE const *  stencilTable 
) const
inline

Generic compute function. Dispatch the CL compute kernel asynchronously. Returns false if the kernel hasn't been compiled yet.

Definition at line 289 of file clEvaluator.h.

bool EvalStencils ( cl_mem  src,
BufferDescriptor const &  srcDesc,
cl_mem  dst,
BufferDescriptor const &  dstDesc,
cl_mem  sizes,
cl_mem  offsets,
cl_mem  indices,
cl_mem  weights,
int  start,
int  end 
) const

Dispatch the CL compute kernel asynchronously. returns false if the kernel hasn't been compiled yet.

bool EvalStencils ( cl_mem  src,
BufferDescriptor const &  srcDesc,
cl_mem  dst,
BufferDescriptor const &  dstDesc,
cl_mem  du,
BufferDescriptor const &  duDesc,
cl_mem  dv,
BufferDescriptor const &  dvDesc,
cl_mem  sizes,
cl_mem  offsets,
cl_mem  indices,
cl_mem  weights,
cl_mem  duWeights,
cl_mem  dvWeights,
int  start,
int  end 
) const

Dispatch the CL compute kernel asynchronously. returns false if the kernel hasn't been compiled yet.

static void Synchronize ( DEVICE_CONTEXT  deviceContext)
inlinestatic

Wait the OpenCL kernels finish.

Definition at line 619 of file clEvaluator.h.

static void Synchronize ( cl_command_queue  queue)
static

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