HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CE_VectorT< T > Class Template Reference

#include <CE_Vector.h>

+ Inheritance diagram for CE_VectorT< T >:

Public Types

typedef T value_type
 

Public Member Functions

 CE_VectorT ()
 
 CE_VectorT (exint len, bool use_pool=false, bool read=true, bool write=true, bool delayed_ogl_bind=false, bool ogl_ocl=false)
 Initialize to given length. More...
 
 CE_VectorT (bool use_pool, bool read, bool write, bool delayed_ogl_bind, bool ogl_ocl)
 
 CE_VectorT (const CE_VectorT< T > &v)
 Copy constructor. More...
 
virtual ~CE_VectorT ()
 
void init (exint len)
 
void init (exint nl, exint nh)
 
void initFromVector (const UT_VectorT< T > &src, bool block=true)
 Initialize from a UT_Vector. More...
 
virtual void rebindOGLBuffer (uint buf_obj)
 Rebing to an OGL buffer. More...
 
virtual void unbindOGLBuffer ()
 
virtual bool isBinded ()
 
uint delayedBindBufferID () const
 
void matchAndCopyToVector (UT_VectorT< T > &dst, bool block=true) const
 Resize the provided UT_Vector to fit and copy this vector's data there. More...
 
exint length () const
 Returns the vector length. More...
 
const cl::Bufferbuffer () const
 Returns the underlying OpenCL buffer. More...
 
void multAndSet (const CE_VectorT< T > &a, const CE_VectorT< T > &b)
 The following functions all mimic those of the same name in UT_Vector. More...
 
void negPlus (const CE_VectorT< T > &a)
 
void scaleAddVec (T s, const CE_VectorT< T > &a)
 
fpreal64 norm (int type) const
 
void zero ()
 
void addScaledVec (T s, const CE_VectorT< T > &a)
 
void blendShapes (const CE_VectorT< T > &bs, const CE_VectorT< T > &wi, exint num_active_shapes, bool write_half)
 
void blendShapesPointNormal (CE_VectorT< T > &n, const CE_VectorT< T > &bs, const CE_VectorT< T > &bsn, const CE_VectorT< T > &wi, exint num_active_shapes, bool write_half)
 Apply Position and Normal blend shapes at the same time in a single kernel. More...
 
void deformShape (const CE_VectorT< T > &shape, const CE_VectorT< T > &transforms, const CE_VectorT< T > &weightIndices, exint num_max_regions)
 Apply deform shapes on the current buffer. More...
 
void deformShapeNormal (const CE_VectorT< T > &shape, const CE_VectorT< T > &transforms, const CE_VectorT< T > &weightIndices, exint num_max_regions)
 
void deformShapeVector (const CE_VectorT< T > &shape, const CE_VectorT< T > &transforms, const CE_VectorT< T > &weightIndices, exint num_max_regions, exint num_vec_attr)
 
void deformShapeQuaternion (const CE_VectorT< T > &shape, const CE_VectorT< T > &xforms, const CE_VectorT< T > &weightIndices, exint num_max_regions, exint num_vec_attr)
 
void dqDeformShape (const CE_VectorT< T > &shape, const CE_VectorT< T > &transforms, const CE_VectorT< T > &weightIndices, exint num_max_regions)
 
void dqDeformShapeVector (const CE_VectorT< T > &shape, const CE_VectorT< T > &transforms, const CE_VectorT< T > &weightIndices, exint num_max_regions, exint num_vec_attr, bool normalize_dst)
 
void dqDeformShapeQuaternion (const CE_VectorT< T > &shape, const CE_VectorT< T > &dqs, const CE_VectorT< T > &weightIndices, exint num_max_regions, exint num_quat_attr)
 
void dqLinearBlendDeformShape (const CE_VectorT< T > &shape, const CE_VectorT< T > &xforms, const CE_VectorT< T > &dqs, const CE_VectorT< T > &weightIndices, const CE_VectorT< T > &dq_linear_blend, exint num_max_regions)
 
void dqLinearBlendDeformNormal (const CE_VectorT< T > &shape, const CE_VectorT< T > &xforms, const CE_VectorT< T > &dqs, const CE_VectorT< T > &weightIndices, const CE_VectorT< T > &dq_linear_blend, exint num_max_regions)
 
void dqLinearBlendDeformVector (const CE_VectorT< T > &shape, const CE_VectorT< T > &xforms, const CE_VectorT< T > &dqs, const CE_VectorT< T > &weightIndices, const CE_VectorT< T > &dq_linear_blend, exint num_max_regions, exint num_attr)
 
void dqLinearBlendDeformQuaternion (const CE_VectorT< T > &shape, const CE_VectorT< T > &xforms, const CE_VectorT< T > &dqs, const CE_VectorT< T > &weightIndices, const CE_VectorT< T > &dq_linear_blend, exint num_max_regions, exint num_attr)
 
CE_VectorToperator= (const CE_VectorT< T > &v)
 
fpreal64 sum () const
 Reductions of the vector to a single value. More...
 
fpreal64 sumAbs () const
 
fpreal64 sumSqr () const
 
fpreal64 min () const
 
fpreal64 minAbs () const
 
fpreal64 max () const
 
fpreal64 maxAbs () const
 
fpreal64 average () const
 
fpreal64 dot (const CE_VectorT< T > &a) const
 Returns the dot product with provided vector. More...
 
cl::KernelFunctor bind (cl::Kernel &k) const
 
void setValue (T cval)
 
void copyFrom (const CE_VectorT< T > &v)
 
- Public Member Functions inherited from CE_DelayedOGLBindBuffer
 CE_DelayedOGLBindBuffer ()
 
virtual ~CE_DelayedOGLBindBuffer ()
 

Protected Member Functions

const cl::BufferallocBuffer () const
 
void releaseBuffer ()
 
cl::KernelFunctor bind (const char *kernelName) const
 
cl::Kernel loadKernel (const char *kernelName, const char *opt=NULL) const
 
void getReductionRanges (const cl::Kernel &k, cl::NDRange &globalRange, cl::NDRange &localRange, uint &groupsize, uint &ngroups, size_t &accumsize) const
 
fpreal64 reduceGroup (cl::Buffer out, uint groupsize, uint ngroups, size_t accumsize, const char *reduceFlags) const
 
fpreal64 doReduce (const char *reduceFlags, const CE_VectorT< T > *a=NULL) const
 

Protected Attributes

cl::Buffer myBuffer
 
cl::NDRange myGlobalRange
 
cl::NDRange myLocalRange
 
exint myLen
 
bool myRead
 
bool myWrite
 
bool myUsePool
 
uint32 myDelayedBindBufferID
 
uint32 myBufferObject
 
bool myUseOGLContex
 

Detailed Description

template<typename T>
class CE_VectorT< T >

A simple OpenCL-based vector class that at the moment just mimics just enough of UT_Vector to be used in CE_SparseMatrixELLT::solveConjugateGradient.

Definition at line 25 of file CE_Vector.h.

Member Typedef Documentation

template<typename T>
typedef T CE_VectorT< T >::value_type

Definition at line 29 of file CE_Vector.h.

Constructor & Destructor Documentation

template<typename T>
CE_VectorT< T >::CE_VectorT ( )
template<typename T>
CE_VectorT< T >::CE_VectorT ( exint  len,
bool  use_pool = false,
bool  read = true,
bool  write = true,
bool  delayed_ogl_bind = false,
bool  ogl_ocl = false 
)

Initialize to given length.

template<typename T>
CE_VectorT< T >::CE_VectorT ( bool  use_pool,
bool  read,
bool  write,
bool  delayed_ogl_bind,
bool  ogl_ocl 
)

Initialize to zero in in the cases when we want to init / not init the vector based on size

template<typename T>
CE_VectorT< T >::CE_VectorT ( const CE_VectorT< T > &  v)

Copy constructor.

template<typename T>
virtual CE_VectorT< T >::~CE_VectorT ( )
virtual

Member Function Documentation

template<typename T>
void CE_VectorT< T >::addScaledVec ( T  s,
const CE_VectorT< T > &  a 
)
template<typename T>
const cl::Buffer& CE_VectorT< T >::allocBuffer ( ) const
protected
template<typename T>
fpreal64 CE_VectorT< T >::average ( ) const
inline

Definition at line 179 of file CE_Vector.h.

template<typename T>
cl::KernelFunctor CE_VectorT< T >::bind ( cl::Kernel k) const
template<typename T>
cl::KernelFunctor CE_VectorT< T >::bind ( const char *  kernelName) const
protected
template<typename T>
void CE_VectorT< T >::blendShapes ( const CE_VectorT< T > &  bs,
const CE_VectorT< T > &  wi,
exint  num_active_shapes,
bool  write_half 
)

Apply Blend Shapes on the current buffer bs holds all the blend shape positions concatenated together in a single buffer wi, holds the contribution of the blend shapes with index and weights.

template<typename T>
void CE_VectorT< T >::blendShapesPointNormal ( CE_VectorT< T > &  n,
const CE_VectorT< T > &  bs,
const CE_VectorT< T > &  bsn,
const CE_VectorT< T > &  wi,
exint  num_active_shapes,
bool  write_half 
)

Apply Position and Normal blend shapes at the same time in a single kernel.

template<typename T>
const cl::Buffer& CE_VectorT< T >::buffer ( ) const
inline

Returns the underlying OpenCL buffer.

Definition at line 72 of file CE_Vector.h.

template<typename T>
void CE_VectorT< T >::copyFrom ( const CE_VectorT< T > &  v)
template<typename T>
void CE_VectorT< T >::deformShape ( const CE_VectorT< T > &  shape,
const CE_VectorT< T > &  transforms,
const CE_VectorT< T > &  weightIndices,
exint  num_max_regions 
)

Apply deform shapes on the current buffer.

template<typename T>
void CE_VectorT< T >::deformShapeNormal ( const CE_VectorT< T > &  shape,
const CE_VectorT< T > &  transforms,
const CE_VectorT< T > &  weightIndices,
exint  num_max_regions 
)
template<typename T>
void CE_VectorT< T >::deformShapeQuaternion ( const CE_VectorT< T > &  shape,
const CE_VectorT< T > &  xforms,
const CE_VectorT< T > &  weightIndices,
exint  num_max_regions,
exint  num_vec_attr 
)
template<typename T>
void CE_VectorT< T >::deformShapeVector ( const CE_VectorT< T > &  shape,
const CE_VectorT< T > &  transforms,
const CE_VectorT< T > &  weightIndices,
exint  num_max_regions,
exint  num_vec_attr 
)
template<typename T>
uint CE_VectorT< T >::delayedBindBufferID ( ) const
inline

Definition at line 64 of file CE_Vector.h.

template<typename T>
fpreal64 CE_VectorT< T >::doReduce ( const char *  reduceFlags,
const CE_VectorT< T > *  a = NULL 
) const
protected
template<typename T>
fpreal64 CE_VectorT< T >::dot ( const CE_VectorT< T > &  a) const

Returns the dot product with provided vector.

template<typename T>
void CE_VectorT< T >::dqDeformShape ( const CE_VectorT< T > &  shape,
const CE_VectorT< T > &  transforms,
const CE_VectorT< T > &  weightIndices,
exint  num_max_regions 
)
template<typename T>
void CE_VectorT< T >::dqDeformShapeQuaternion ( const CE_VectorT< T > &  shape,
const CE_VectorT< T > &  dqs,
const CE_VectorT< T > &  weightIndices,
exint  num_max_regions,
exint  num_quat_attr 
)
template<typename T>
void CE_VectorT< T >::dqDeformShapeVector ( const CE_VectorT< T > &  shape,
const CE_VectorT< T > &  transforms,
const CE_VectorT< T > &  weightIndices,
exint  num_max_regions,
exint  num_vec_attr,
bool  normalize_dst 
)
template<typename T>
void CE_VectorT< T >::dqLinearBlendDeformNormal ( const CE_VectorT< T > &  shape,
const CE_VectorT< T > &  xforms,
const CE_VectorT< T > &  dqs,
const CE_VectorT< T > &  weightIndices,
const CE_VectorT< T > &  dq_linear_blend,
exint  num_max_regions 
)
template<typename T>
void CE_VectorT< T >::dqLinearBlendDeformQuaternion ( const CE_VectorT< T > &  shape,
const CE_VectorT< T > &  xforms,
const CE_VectorT< T > &  dqs,
const CE_VectorT< T > &  weightIndices,
const CE_VectorT< T > &  dq_linear_blend,
exint  num_max_regions,
exint  num_attr 
)
template<typename T>
void CE_VectorT< T >::dqLinearBlendDeformShape ( const CE_VectorT< T > &  shape,
const CE_VectorT< T > &  xforms,
const CE_VectorT< T > &  dqs,
const CE_VectorT< T > &  weightIndices,
const CE_VectorT< T > &  dq_linear_blend,
exint  num_max_regions 
)
template<typename T>
void CE_VectorT< T >::dqLinearBlendDeformVector ( const CE_VectorT< T > &  shape,
const CE_VectorT< T > &  xforms,
const CE_VectorT< T > &  dqs,
const CE_VectorT< T > &  weightIndices,
const CE_VectorT< T > &  dq_linear_blend,
exint  num_max_regions,
exint  num_attr 
)
template<typename T>
void CE_VectorT< T >::getReductionRanges ( const cl::Kernel k,
cl::NDRange globalRange,
cl::NDRange localRange,
uint groupsize,
uint ngroups,
size_t &  accumsize 
) const
protected
template<typename T>
void CE_VectorT< T >::init ( exint  len)

Initialize to given length. NOTE- values are undefined.

template<typename T>
void CE_VectorT< T >::init ( exint  nl,
exint  nh 
)

For "compatibility" with UT_Vector. NOTE: Asserts if nl is not zero!

template<typename T>
void CE_VectorT< T >::initFromVector ( const UT_VectorT< T > &  src,
bool  block = true 
)

Initialize from a UT_Vector.

template<typename T>
virtual bool CE_VectorT< T >::isBinded ( )
virtual
template<typename T>
exint CE_VectorT< T >::length ( ) const
inline

Returns the vector length.

Definition at line 69 of file CE_Vector.h.

template<typename T>
cl::Kernel CE_VectorT< T >::loadKernel ( const char *  kernelName,
const char *  opt = NULL 
) const
protected
template<typename T>
void CE_VectorT< T >::matchAndCopyToVector ( UT_VectorT< T > &  dst,
bool  block = true 
) const

Resize the provided UT_Vector to fit and copy this vector's data there.

template<typename T>
fpreal64 CE_VectorT< T >::max ( ) const
template<typename T>
fpreal64 CE_VectorT< T >::maxAbs ( ) const
template<typename T>
fpreal64 CE_VectorT< T >::min ( ) const
template<typename T>
fpreal64 CE_VectorT< T >::minAbs ( ) const
template<typename T>
void CE_VectorT< T >::multAndSet ( const CE_VectorT< T > &  a,
const CE_VectorT< T > &  b 
)

The following functions all mimic those of the same name in UT_Vector.

template<typename T>
void CE_VectorT< T >::negPlus ( const CE_VectorT< T > &  a)
template<typename T>
fpreal64 CE_VectorT< T >::norm ( int  type) const
template<typename T>
CE_VectorT& CE_VectorT< T >::operator= ( const CE_VectorT< T > &  v)

Operators NOTE: operator= requires the destination be a matching size.

template<typename T>
virtual void CE_VectorT< T >::rebindOGLBuffer ( uint  buf_obj)
virtual

Rebing to an OGL buffer.

Implements CE_DelayedOGLBindBuffer.

template<typename T>
fpreal64 CE_VectorT< T >::reduceGroup ( cl::Buffer  out,
uint  groupsize,
uint  ngroups,
size_t  accumsize,
const char *  reduceFlags 
) const
protected
template<typename T>
void CE_VectorT< T >::releaseBuffer ( )
protected
template<typename T>
void CE_VectorT< T >::scaleAddVec ( T  s,
const CE_VectorT< T > &  a 
)
template<typename T>
void CE_VectorT< T >::setValue ( T  cval)
template<typename T>
fpreal64 CE_VectorT< T >::sum ( ) const

Reductions of the vector to a single value.

template<typename T>
fpreal64 CE_VectorT< T >::sumAbs ( ) const
template<typename T>
fpreal64 CE_VectorT< T >::sumSqr ( ) const
template<typename T>
virtual void CE_VectorT< T >::unbindOGLBuffer ( )
virtual
template<typename T>
void CE_VectorT< T >::zero ( )
inline

Definition at line 83 of file CE_Vector.h.

Member Data Documentation

template<typename T>
cl::Buffer CE_VectorT< T >::myBuffer
mutableprotected

Definition at line 206 of file CE_Vector.h.

template<typename T>
uint32 CE_VectorT< T >::myBufferObject
protected

Definition at line 212 of file CE_Vector.h.

template<typename T>
uint32 CE_VectorT< T >::myDelayedBindBufferID
protected

Definition at line 211 of file CE_Vector.h.

template<typename T>
cl::NDRange CE_VectorT< T >::myGlobalRange
protected

Definition at line 207 of file CE_Vector.h.

template<typename T>
exint CE_VectorT< T >::myLen
protected

Definition at line 208 of file CE_Vector.h.

template<typename T>
cl::NDRange CE_VectorT< T >::myLocalRange
protected

Definition at line 207 of file CE_Vector.h.

template<typename T>
bool CE_VectorT< T >::myRead
protected

Definition at line 210 of file CE_Vector.h.

template<typename T>
bool CE_VectorT< T >::myUseOGLContex
protected

Definition at line 213 of file CE_Vector.h.

template<typename T>
bool CE_VectorT< T >::myUsePool
protected

Definition at line 210 of file CE_Vector.h.

template<typename T>
bool CE_VectorT< T >::myWrite
protected

Definition at line 210 of file CE_Vector.h.


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