25 #ifndef OPENSUBDIV3_OSD_CUDA_EVALUATOR_H
26 #define OPENSUBDIV3_OSD_CUDA_EVALUATOR_H
28 #include "../version.h"
31 #include "../osd/bufferDescriptor.h"
32 #include "../osd/types.h"
35 namespace OPENSUBDIV_VERSION {
40 class LimitStencilTable;
55 void *deviceContext = NULL) {
60 void *deviceContext = NULL) {
119 template <
typename SRC_BUFFER,
typename DST_BUFFER,
typename STENCIL_TABLE>
123 STENCIL_TABLE
const *stencilTable,
124 const void *instance = NULL,
125 void * deviceContext = NULL) {
129 return EvalStencils(srcBuffer->BindCudaBuffer(), srcDesc,
130 dstBuffer->BindCudaBuffer(), dstDesc,
131 (
int const *)stencilTable->GetSizesBuffer(),
132 (
int const *)stencilTable->GetOffsetsBuffer(),
133 (
int const *)stencilTable->GetIndicesBuffer(),
134 (
float const *)stencilTable->GetWeightsBuffer(),
136 stencilTable->GetNumStencils());
171 const float * weights,
211 template <
typename SRC_BUFFER,
typename DST_BUFFER,
typename STENCIL_TABLE>
217 STENCIL_TABLE
const *stencilTable,
219 void * deviceContext = NULL) {
224 return EvalStencils(srcBuffer->BindCudaBuffer(), srcDesc,
225 dstBuffer->BindCudaBuffer(), dstDesc,
226 duBuffer->BindCudaBuffer(), duDesc,
227 dvBuffer->BindCudaBuffer(), dvDesc,
228 (
int const *)stencilTable->GetSizesBuffer(),
229 (
int const *)stencilTable->GetOffsetsBuffer(),
230 (
int const *)stencilTable->GetIndicesBuffer(),
231 (
float const *)stencilTable->GetWeightsBuffer(),
232 (
float const *)stencilTable->GetDuWeightsBuffer(),
233 (
float const *)stencilTable->GetDvWeightsBuffer(),
235 stencilTable->GetNumStencils());
286 const float * weights,
287 const float * duWeights,
288 const float * dvWeights,
325 template <
typename SRC_BUFFER,
typename DST_BUFFER,
326 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
331 PATCHCOORD_BUFFER *patchCoords,
332 PATCH_TABLE *patchTable,
334 void * deviceContext = NULL) {
339 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc,
340 dstBuffer->BindCudaBuffer(), dstDesc,
342 (
const PatchCoord *)patchCoords->BindCudaBuffer(),
343 (
const PatchArray *)patchTable->GetPatchArrayBuffer(),
344 (
const int *)patchTable->GetPatchIndexBuffer(),
345 (
const PatchParam *)patchTable->GetPatchParamBuffer());
386 template <
typename SRC_BUFFER,
typename DST_BUFFER,
387 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
394 PATCHCOORD_BUFFER *patchCoords,
395 PATCH_TABLE *patchTable,
397 void * deviceContext = NULL) {
402 return EvalPatches(srcBuffer->BindCudaBuffer(), srcDesc,
403 dstBuffer->BindCudaBuffer(), dstDesc,
404 duBuffer->BindCudaBuffer(), duDesc,
405 dvBuffer->BindCudaBuffer(), dvDesc,
407 (
const PatchCoord *)patchCoords->BindCudaBuffer(),
408 (
const PatchArray *)patchTable->GetPatchArrayBuffer(),
409 (
const int *)patchTable->GetPatchIndexBuffer(),
410 (
const PatchParam *)patchTable->GetPatchParamBuffer());
446 const int *patchIndices,
494 const int *patchIndices,
502 static void Synchronize(
void *deviceContext = NULL);
509 using namespace OPENSUBDIV_VERSION;
514 #endif // OPENSUBDIV3_OSD_CUDA_EVALUATOR_H
static CudaStencilTable * Create(Far::LimitStencilTable const *limitStencilTable, void *deviceContext=NULL)
void * GetDuWeightsBuffer() const
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CudaEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers. Almost all Osd Evaluator APIs take BufferDescriptors along with device-specific buffer objects.
void * GetDvWeightsBuffer() const
void * GetIndicesBuffer() const
static void Synchronize(void *deviceContext=NULL)
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, const void *instance=NULL, void *deviceContext=NULL)
Generic static compute function. This function has a same signature as other device kernels have so t...
Coordinates set on a patch table.
CudaStencilTable(Far::StencilTable const *stencilTable)
void * GetSizesBuffer() const
Table of subdivision stencils.
static CudaStencilTable * Create(Far::StencilTable const *stencilTable, void *deviceContext=NULL)
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, CudaEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function with derivatives. This function has a same signature as other device kern...
void * GetOffsetsBuffer() const
void * GetWeightsBuffer() const
int GetNumStencils() const
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, const CudaEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function with derivatives. This function has a same signature as other d...
Table of limit subdivision stencils.