#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 CLEvaluator * | Create (BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, DEVICE_CONTEXT deviceContext) |
Generic creator template. More... | |
static CLEvaluator * | Create (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) |
Definition at line 92 of file clEvaluator.h.
typedef bool Instantiatable |
Definition at line 94 of file clEvaluator.h.
CLEvaluator | ( | cl_context | context, |
cl_command_queue | queue | ||
) |
Constructor.
~CLEvaluator | ( | ) |
Desctructor.
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.
|
inlinestatic |
Generic creator template.
Definition at line 103 of file clEvaluator.h.
|
inlinestatic |
Definition at line 113 of file clEvaluator.h.
|
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
srcBuffer | Input primvar buffer. must have BindCLBuffer() method returning a CL buffer object of source data |
srcDesc | vertex buffer descriptor for the input buffer |
dstBuffer | Output primvar buffer must have BindCLBuffer() method returning a CL buffer object of destination data |
dstDesc | vertex buffer descriptor for the output buffer |
numPatchCoords | number of patchCoords. |
patchCoords | array of locations to be evaluated. must have BindCLBuffer() method returning an array of PatchCoord struct. |
patchTable | CLPatchTable or equivalent |
instance | cached 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. |
deviceContext | client providing context class which supports cL_context GetContext() cl_command_queue GetCommandQueue() methods. |
Definition at line 379 of file clEvaluator.h.
|
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.
srcBuffer | Input primvar buffer. must have BindCLBuffer() method returning a CL buffer object of source data |
srcDesc | vertex buffer descriptor for the input buffer |
dstBuffer | Output primvar buffer must have BindCLBuffer() method returning a CL buffer object of destination data |
dstDesc | vertex buffer descriptor for the output buffer |
duBuffer | |
duDesc | |
dvBuffer | |
dvDesc | |
numPatchCoords | number of patchCoords. |
patchCoords | array of locations to be evaluated. must have BindCLBuffer() method returning an array of PatchCoord struct |
patchTable | CLPatchTable or equivalent |
instance | cached 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. |
deviceContext | client providing context class which supports cL_context GetContext() cl_command_queue GetCommandQueue() methods. |
Definition at line 458 of file clEvaluator.h.
|
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.
srcBuffer | Input primvar buffer. must have BindCLBuffer() method returning a CL buffer object of source data |
srcDesc | vertex buffer descriptor for the input buffer |
dstBuffer | Output primvar buffer must have BindCLBuffer() method returning a CL buffer object of destination data |
dstDesc | vertex buffer descriptor for the output buffer |
numPatchCoords | number of patchCoords. |
patchCoords | array of locations to be evaluated. must have BindCLBuffer() method returning an array of PatchCoord struct. |
patchTable | CLPatchTable or equivalent |
Definition at line 520 of file clEvaluator.h.
|
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.
srcBuffer | Input primvar buffer. must have BindCLBuffer() method returning a CL buffer object of source data |
srcDesc | vertex buffer descriptor for the input buffer |
dstBuffer | Output primvar buffer must have BindCLBuffer() method returning a CL buffer object of destination data |
dstDesc | vertex buffer descriptor for the output buffer |
duBuffer | Output U-derivatives buffer must have BindCLBuffer() method returning a CL buffer object of destination data of Du |
duDesc | vertex buffer descriptor for the duBuffer |
dvBuffer | Output V-derivatives buffer must have BindCLBuffer() method returning a CL buffer object of destination data of Dv |
dvDesc | vertex buffer descriptor for the dvBuffer |
numPatchCoords | number of patchCoords. |
patchCoords | array of locations to be evaluated. |
patchTable | CLPatchTable 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 |
|
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
srcBuffer | Input primvar buffer. must have BindCLBuffer() method returning the cl_mem object for read |
srcDesc | vertex buffer descriptor for the input buffer |
dstBuffer | Output primvar buffer must have BindCLBuffer() method returning the cl_mem object for results to be written |
dstDesc | vertex buffer descriptor for the output buffer |
stencilTable | stencil table to be applied. The table must have SSBO interfaces. |
instance | cached 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. |
deviceContext | client providing context class which supports cL_context GetContext() cl_command_queue GetCommandQueue() methods. |
Definition at line 163 of file clEvaluator.h.
|
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.
srcBuffer | Input primvar buffer. must have BindCLBuffer() method returning the cl_mem object for read |
srcDesc | vertex buffer descriptor for the input buffer |
dstBuffer | Output primvar buffer must have BindCLBuffer() method returning the cl_mem object for results to be written |
dstDesc | vertex buffer descriptor for the output buffer |
duBuffer | Output U-derivative buffer must have BindCLBuffer() method returning the cl_mem object for du results to be written |
duDesc | vertex buffer descriptor for the du output buffer |
dvBuffer | Output V-derivative buffer must have BindCLBuffer() method returning the cl_mem object for dv results to be written |
dvDesc | vertex buffer descriptor for the dv output buffer |
stencilTable | stencil table to be applied. The table must have SSBO interfaces. |
instance | cached 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. |
deviceContext | client providing context class which supports cL_context GetContext() cl_command_queue GetCommandQueue() methods. |
Definition at line 235 of file clEvaluator.h.
|
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.
|
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.
|
inlinestatic |
Wait the OpenCL kernels finish.
Definition at line 619 of file clEvaluator.h.
|
static |