CudaEvaluator Class Reference

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Static Public Member Functions | List of all members
CudaEvaluator Class Reference

`#include <cudaEvaluator.h>`

## Static Public Member Functions
template<typename SRC_BUFFER , typename DST_BUFFER , typename STENCIL_TABLE >
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 that it can be called transparently from OsdMesh template interface. More...
static bool | EvalStencils (const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, int start, int end)
| Static eval stencils function which takes raw cuda buffers for input and output. More...
template<typename SRC_BUFFER , typename DST_BUFFER , typename STENCIL_TABLE >
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 device kernels have so that it can be called in the same way from OsdMesh template interface. More...
static bool | EvalStencils (const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, const int *sizes, const int *offsets, const int *indices, const float *weights, const float *duWeights, const float *dvWeights, int start, int end)
| Static eval stencils function with derivatives, which takes raw cuda pointers for input and output. More...
template<typename SRC_BUFFER , typename DST_BUFFER , typename PATCHCOORD_BUFFER , typename PATCH_TABLE >
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 it can be called in the same way. More...
template<typename SRC_BUFFER , typename DST_BUFFER , typename PATCHCOORD_BUFFER , typename PATCH_TABLE >
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 kernels have so that it can be called in the same way. More...
static bool | EvalPatches (const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, int numPatchCoords, const PatchCoord *patchCoords, const PatchArray *patchArrays, const int *patchIndices, const PatchParam *patchParams)
| Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchTable. More...
static bool | EvalPatches (const float *src, BufferDescriptor const &srcDesc, float *dst, BufferDescriptor const &dstDesc, float *du, BufferDescriptor const &duDesc, float *dv, BufferDescriptor const &dvDesc, int numPatchCoords, const PatchCoord *patchCoords, const PatchArray *patchArrays, const int *patchIndices, const PatchParam *patchParams)
| Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchTable. More...
static void | Synchronize (void *deviceContext=NULL)

## Detailed Description

Definition at line 88 of file cudaEvaluator.h.

## Member Function Documentation

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`
| ) |  |
| 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

  srcBuffer | Input primvar buffer. must have BindCudaBuffer() method returning a const float pointer for read
  srcDesc | vertex buffer descriptor for the input buffer
  dstBuffer | Output primvar buffer must have BindCudaBuffer() method returning a float pointer for write
  dstDesc | vertex buffer descriptor for the output buffer
  numPatchCoords | number of patchCoords.
  patchCoords | array of locations to be evaluated. must have BindCudaBuffer() method returning an array of PatchCoord struct in cuda memory.
  patchTable | CudaPatchTable or equivalent
  instance | not used in the cuda evaluator
  deviceContext | not used in the cuda evaluator

Definition at line 327 of file cudaEvaluator.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,
|  | CudaEvaluator const * | instance,
|  | void * | deviceContext = `NULL`
| ) |  |
| inlinestatic

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

  srcBuffer | Input primvar buffer. must have BindCudaBuffer() method returning a const float pointer for read
  srcDesc | vertex buffer descriptor for the input buffer
  dstBuffer | Output primvar buffer must have BindCudaBuffer() method returning a float pointer for write
  dstDesc | vertex buffer descriptor for the output buffer
  duBuffer | Output U-derivatives buffer must have BindCudaBuffer() method returning a float pointer for write
  duDesc | vertex buffer descriptor for the duBuffer
  dvBuffer | Output V-derivatives buffer must have BindCudaBuffer() method returning a float pointer for write
  dvDesc | vertex buffer descriptor for the dvBuffer
  numPatchCoords | number of patchCoords.
  patchCoords | array of locations to be evaluated.
  patchTable | CudaPatchTable or equivalent
  instance | not used in the cuda evaluator
  deviceContext | not used in the cuda evaluator

Definition at line 388 of file cudaEvaluator.h.

static bool EvalPatches | ( | const float * | src,
|  | BufferDescriptor const & | srcDesc,
|  | float * | dst,
|  | BufferDescriptor const & | dstDesc,
|  | int | numPatchCoords,
|  | const PatchCoord * | patchCoords,
|  | const PatchArray * | patchArrays,
|  | const int * | patchIndices,
|  | const PatchParam * | patchParams
| ) |  |
| static

Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchTable.

Parameters

  src | Input primvar pointer. An offset of srcDesc will be applied internally (i.e. the pointer should not include the offset)
  srcDesc | vertex buffer descriptor for the input buffer
  dst | Output primvar pointer. An offset of dstDesc will be applied internally.
  dstDesc | vertex buffer descriptor for the output buffer
  numPatchCoords | number of patchCoords.
  patchCoords | array of locations to be evaluated.
  patchArrays | an array of Osd::PatchArray struct indexed by PatchCoord::arrayIndex
  patchIndices | an array of patch indices indexed by PatchCoord::vertIndex
  patchParams | an array of Osd::PatchParam struct indexed by PatchCoord::patchIndex

static bool EvalPatches | ( | const float * | src,
|  | BufferDescriptor const & | srcDesc,
|  | float * | dst,
|  | BufferDescriptor const & | dstDesc,
|  | float * | du,
|  | BufferDescriptor const & | duDesc,
|  | float * | dv,
|  | BufferDescriptor const & | dvDesc,
|  | int | numPatchCoords,
|  | const PatchCoord * | patchCoords,
|  | const PatchArray * | patchArrays,
|  | const int * | patchIndices,
|  | const PatchParam * | patchParams
| ) |  |
| static

Static limit eval function. It takes an array of PatchCoord and evaluate limit values on given PatchTable.

Parameters

  src | Input primvar pointer. An offset of srcDesc will be applied internally (i.e. the pointer should not include the offset)
  srcDesc | vertex buffer descriptor for the input buffer
  dst | Output primvar pointer. An offset of dstDesc will be applied internally.
  dstDesc | vertex buffer descriptor for the output buffer
  du | Output U-derivatives pointer. An offset of duDesc will be applied internally.
  duDesc | vertex buffer descriptor for the du buffer
  dv | Output V-derivatives pointer. An offset of dvDesc will be applied internally.
  dvDesc | vertex buffer descriptor for the dv buffer
  numPatchCoords | number of patchCoords.
  patchCoords | array of locations to be evaluated.
  patchArrays | an array of Osd::PatchArray struct indexed by PatchCoord::arrayIndex
  patchIndices | an array of patch indices indexed by PatchCoord::vertIndex
  patchParams | an array of Osd::PatchParam struct indexed by PatchCoord::patchIndex

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`
| ) |  |
| 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

  srcBuffer | Input primvar buffer. must have BindCudaBuffer() method returning a const float pointer for read
  srcDesc | vertex buffer descriptor for the input buffer
  dstBuffer | Output primvar buffer must have BindCudaBuffer() method returning a float pointer for write
  dstDesc | vertex buffer descriptor for the output buffer
  stencilTable | stencil table to be applied. The table must have Cuda memory interfaces.
  instance | not used in the CudaEvaluator
  deviceContext | not used in the CudaEvaluator

Definition at line 120 of file cudaEvaluator.h.

static bool EvalStencils | ( | const float * | src,
|  | BufferDescriptor const & | srcDesc,
|  | float * | dst,
|  | BufferDescriptor const & | dstDesc,
|  | const int * | sizes,
|  | const int * | offsets,
|  | const int * | indices,
|  | const float * | weights,
|  | int | start,
|  | int | end
| ) |  |
| static

Static eval stencils function which takes raw cuda buffers for input and output.

Parameters

  src | Input primvar pointer. An offset of srcDesc will be applied internally (i.e. the pointer should not include the offset)
  srcDesc | vertex buffer descriptor for the input buffer
  dst | Output primvar pointer. An offset of dstDesc will be applied internally.
  dstDesc | vertex buffer descriptor for the output buffer
  sizes | pointer to the sizes buffer of the stencil table
  offsets | pointer to the offsets buffer of the stencil table
  indices | pointer to the indices buffer of the stencil table
  weights | pointer to the weights buffer of the stencil table
  start | start index of stencil table
  end | end index of stencil table

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`
| ) |  |
| inlinestatic

Generic static eval stencils function with derivatives. This function has a same signature as other device kernels have so that it can be called in the same way from OsdMesh template interface.

Parameters

  srcBuffer | Input primvar buffer. must have BindCudaBuffer() method returning a const float pointer for read
  srcDesc | vertex buffer descriptor for the input buffer
  dstBuffer | Output primvar buffer must have BindCudaBuffer() method returning a float pointer for write
  dstDesc | vertex buffer descriptor for the output buffer
  duBuffer | Output U-derivative buffer must have BindCudaBuffer() method returning a float pointer for write
  duDesc | vertex buffer descriptor for the output buffer
  dvBuffer | Output V-derivative buffer must have BindCudaBuffer() method returning a float pointer for write
  dvDesc | vertex buffer descriptor for the output buffer
  stencilTable | stencil table to be applied.
  instance | not used in the cuda kernel (declared as a typed pointer to prevent undesirable template resolution)
  deviceContext | not used in the cuda kernel

Definition at line 212 of file cudaEvaluator.h.

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

Static eval stencils function with derivatives, which takes raw cuda pointers for input and output.

Parameters

  src | Input primvar pointer. An offset of srcDesc will be applied internally (i.e. the pointer should not include the offset)
  srcDesc | vertex buffer descriptor for the input buffer
  dst | Output primvar pointer. An offset of dstDesc will be applied internally.
  dstDesc | vertex buffer descriptor for the output buffer
  du | Output U-derivatives pointer. An offset of duDesc will be applied internally.
  duDesc | vertex buffer descriptor for the output buffer
  dv | Output V-derivatives pointer. An offset of dvDesc will be applied internally.
  dvDesc | vertex buffer descriptor for the output buffer
  sizes | pointer to the sizes buffer of the stencil table
  offsets | pointer to the offsets buffer of the stencil table
  indices | pointer to the indices buffer of the stencil table
  weights | pointer to the weights buffer of the stencil table
  duWeights | pointer to the du-weights buffer of the stencil table
  dvWeights | pointer to the dv-weights buffer of the stencil table
  start | start index of stencil table
  end | end index of stencil table

static void Synchronize | ( | void * | deviceContext = `NULL` | ) |
| static

Other methods

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

- opensubdiv/osd/cudaEvaluator.h