25 #ifndef OPENSUBDIV3_OSD_OMP_EVALUATOR_H
26 #define OPENSUBDIV3_OSD_OMP_EVALUATOR_H
28 #include "../version.h"
31 #include "../osd/types.h"
32 #include "../osd/bufferDescriptor.h"
35 namespace OPENSUBDIV_VERSION {
71 template <
typename SRC_BUFFER,
typename DST_BUFFER,
typename STENCIL_TABLE>
75 STENCIL_TABLE
const *stencilTable,
77 void * deviceContext = NULL) {
83 dstBuffer->BindCpuBuffer(), dstDesc,
84 &stencilTable->GetSizes()[0],
85 &stencilTable->GetOffsets()[0],
86 &stencilTable->GetControlIndices()[0],
87 &stencilTable->GetWeights()[0],
89 stencilTable->GetNumStencils());
125 const float * weights,
165 template <
typename SRC_BUFFER,
typename DST_BUFFER,
typename STENCIL_TABLE>
171 STENCIL_TABLE
const *stencilTable,
173 void * deviceContext = NULL) {
178 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
179 dstBuffer->BindCpuBuffer(), dstDesc,
180 duBuffer->BindCpuBuffer(), duDesc,
181 dvBuffer->BindCpuBuffer(), dvDesc,
182 &stencilTable->GetSizes()[0],
183 &stencilTable->GetOffsets()[0],
184 &stencilTable->GetControlIndices()[0],
185 &stencilTable->GetWeights()[0],
186 &stencilTable->GetDuWeights()[0],
187 &stencilTable->GetDvWeights()[0],
189 stencilTable->GetNumStencils());
240 const float * weights,
241 const float * duWeights,
242 const float * dvWeights,
279 template <
typename SRC_BUFFER,
typename DST_BUFFER,
280 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
285 PATCHCOORD_BUFFER *patchCoords,
286 PATCH_TABLE *patchTable,
288 void * deviceContext = NULL) {
293 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
294 dstBuffer->BindCpuBuffer(), dstDesc,
296 (
const PatchCoord*)patchCoords->BindCpuBuffer(),
297 patchTable->GetPatchArrayBuffer(),
298 patchTable->GetPatchIndexBuffer(),
299 patchTable->GetPatchParamBuffer());
342 template <
typename SRC_BUFFER,
typename DST_BUFFER,
343 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
350 PATCHCOORD_BUFFER *patchCoords,
351 PATCH_TABLE *patchTable,
353 void * deviceContext = NULL) {
362 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
363 dstBuffer->BindCpuBuffer(), dstDesc,
364 duBuffer->BindCpuBuffer(), duDesc,
365 dvBuffer->BindCpuBuffer(), dvDesc,
367 (
const PatchCoord*)patchCoords->BindCpuBuffer(),
368 patchTable->GetPatchArrayBuffer(),
369 patchTable->GetPatchIndexBuffer(),
370 patchTable->GetPatchParamBuffer());
406 const int *patchIndexBuffer,
454 const int *patchIndexBuffer,
463 static void Synchronize(
void *deviceContext = NULL);
472 using namespace OPENSUBDIV_VERSION;
477 #endif // OPENSUBDIV3_OSD_OMP_EVALUATOR_H
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.
Coordinates set on a patch table.
static void SetNumThreads(int numThreads)
static void Synchronize(void *deviceContext=NULL)
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 OmpEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function with derivatives. This function has a same signature as other d...
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, const OmpEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function. This function has a same signature as other device kernels hav...
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, OmpEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function with derivatives. This function has a same signature as other device kern...
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, OmpEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...