Bullet Collision Detection & Physics Library
Classes | Public Member Functions | Public Attributes | List of all members
btSoftBodyLinkDataOpenCLSIMDAware Class Reference

#include <btSoftBodySolverLinkData_OpenCLSIMDAware.h>

Inheritance diagram for btSoftBodyLinkDataOpenCLSIMDAware:
Inheritance graph
[legend]
Collaboration diagram for btSoftBodyLinkDataOpenCLSIMDAware:
Collaboration graph
[legend]

Classes

struct  BatchPair
 
struct  NumBatchesVerticesPair
 

Public Member Functions

 btSoftBodyLinkDataOpenCLSIMDAware (cl_command_queue queue, cl_context ctx)
 
virtual ~btSoftBodyLinkDataOpenCLSIMDAware ()
 
virtual void createLinks (int numLinks)
 Allocate enough space in all link-related arrays to fit numLinks links. More...
 
virtual void setLinkAt (const LinkDescription &link, int linkIndex)
 Insert the link described into the correct data structures assuming space has already been allocated by a call to createLinks. More...
 
virtual bool onAccelerator ()
 Return true if data is on the accelerator. More...
 
virtual bool moveToAccelerator ()
 Move data from host memory to the accelerator. More...
 
virtual bool moveFromAccelerator ()
 Move data from host memory from the accelerator. More...
 
void generateBatches ()
 Generate (and later update) the batching for the entire link set. More...
 
int getMaxVerticesPerWavefront ()
 
int getWavefrontSize ()
 
int getLinksPerWorkItem ()
 
int getMaxLinksPerWavefront ()
 
int getMaxBatchesPerWavefront ()
 
int getNumWavefronts ()
 
NumBatchesVerticesPair getNumBatchesAndVerticesWithinWavefront (int wavefront)
 
int getVertexGlobalAddresses (int vertexIndex)
 
LinkNodePair getVertexPairLocalAddresses (int linkIndex)
 Get post-batching local addresses of the vertex pair for a link assuming all vertices used by a wavefront are loaded locally. More...
 
- Public Member Functions inherited from btSoftBodyLinkData
 btSoftBodyLinkData ()
 
virtual ~btSoftBodyLinkData ()
 
virtual void clear ()
 
int getNumLinks ()
 
LinkNodePairgetVertexPair (int linkIndex)
 Return reference to the vertex index pair for link linkIndex as stored on the host. More...
 
float & getStrength (int linkIndex)
 Return reference to strength of link linkIndex as stored on the host. More...
 
virtual float & getStrengthCorrected (int linkIndex)
 Return a reference to the strength of the link corrected for link sorting. More...
 
float & getRestLength (int linkIndex)
 Return reference to the rest length of link linkIndex as stored on the host. More...
 
float & getLinearStiffnessCoefficient (int linkIndex)
 Return reference to linear stiffness coefficient for link linkIndex as stored on the host. More...
 
float & getMassLSC (int linkIndex)
 Return reference to the MassLSC value for link linkIndex as stored on the host. More...
 
float & getRestLengthSquared (int linkIndex)
 Return reference to rest length squared for link linkIndex as stored on the host. More...
 
Vectormath::Aos::Vector3getCurrentLength (int linkIndex)
 Return reference to current length of link linkIndex as stored on the host. More...
 
float & getLinkLengthRatio (int linkIndex)
 Return the link length ratio from for link linkIndex as stored on the host. More...
 

Public Attributes

bool m_onGPU
 
cl_command_queue m_cqCommandQue
 
const int m_wavefrontSize
 
const int m_linksPerWorkItem
 
const int m_maxLinksPerWavefront
 
int m_maxBatchesWithinWave
 
int m_maxVerticesWithinWave
 
int m_numWavefronts
 
int m_maxVertex
 
btAlignedObjectArray< int > m_linksPerWavefront
 
btAlignedObjectArray
< NumBatchesVerticesPair
m_numBatchesAndVerticesWithinWaves
 
btOpenCLBuffer
< NumBatchesVerticesPair
m_clNumBatchesAndVerticesWithinWaves
 
btAlignedObjectArray< int > m_wavefrontVerticesGlobalAddresses
 
btOpenCLBuffer< int > m_clWavefrontVerticesGlobalAddresses
 
btAlignedObjectArray
< LinkNodePair
m_linkVerticesLocalAddresses
 
btOpenCLBuffer< LinkNodePairm_clLinkVerticesLocalAddresses
 
btOpenCLBuffer< float > m_clLinkStrength
 
btOpenCLBuffer< float > m_clLinksMassLSC
 
btOpenCLBuffer< float > m_clLinksRestLengthSquared
 
btOpenCLBuffer< float > m_clLinksRestLength
 
btOpenCLBuffer< float > m_clLinksMaterialLinearStiffnessCoefficient
 
btAlignedObjectArray< int > m_linkAddresses
 Link addressing information for each cloth. More...
 
btAlignedObjectArray< BatchPairm_wavefrontBatchStartLengths
 Start and length values for computation batches over link data. More...
 

Additional Inherited Members

- Protected Attributes inherited from btSoftBodyLinkData
btAlignedObjectArray
< LinkNodePair
m_links
 
btAlignedObjectArray< float > m_linkStrength
 
btAlignedObjectArray< float > m_linksMassLSC
 
btAlignedObjectArray< float > m_linksRestLengthSquared
 
btAlignedObjectArray
< Vectormath::Aos::Vector3
m_linksCLength
 
btAlignedObjectArray< float > m_linksLengthRatio
 
btAlignedObjectArray< float > m_linksRestLength
 
btAlignedObjectArray< float > m_linksMaterialLinearStiffnessCoefficient
 

Detailed Description

Definition at line 24 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

Constructor & Destructor Documentation

btSoftBodyLinkDataOpenCLSIMDAware::btSoftBodyLinkDataOpenCLSIMDAware ( cl_command_queue  queue,
cl_context  ctx 
)
btSoftBodyLinkDataOpenCLSIMDAware::~btSoftBodyLinkDataOpenCLSIMDAware ( )
virtual

Definition at line 84 of file btSoftBodySolver_OpenCLSIMDAware.cpp.

Member Function Documentation

void btSoftBodyLinkDataOpenCLSIMDAware::createLinks ( int  numLinks)
virtual

Allocate enough space in all link-related arrays to fit numLinks links.

Reimplemented from btSoftBodyLinkData.

Definition at line 95 of file btSoftBodySolver_OpenCLSIMDAware.cpp.

void btSoftBodyLinkDataOpenCLSIMDAware::generateBatches ( )

Generate (and later update) the batching for the entire link set.

This redoes a lot of work because it batches the entire set when each cloth is inserted. In theory we could delay it until just before we need the cloth. It's a one-off overhead, though, so that is a later optimisation.

Definition at line 932 of file btSoftBodySolver_OpenCLSIMDAware.cpp.

int btSoftBodyLinkDataOpenCLSIMDAware::getLinksPerWorkItem ( )
inline

Definition at line 128 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

int btSoftBodyLinkDataOpenCLSIMDAware::getMaxBatchesPerWavefront ( )
inline

Definition at line 138 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

int btSoftBodyLinkDataOpenCLSIMDAware::getMaxLinksPerWavefront ( )
inline

Definition at line 133 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

int btSoftBodyLinkDataOpenCLSIMDAware::getMaxVerticesPerWavefront ( )
inline

Definition at line 118 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

NumBatchesVerticesPair btSoftBodyLinkDataOpenCLSIMDAware::getNumBatchesAndVerticesWithinWavefront ( int  wavefront)
inline

Definition at line 148 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

int btSoftBodyLinkDataOpenCLSIMDAware::getNumWavefronts ( )
inline

Definition at line 143 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

int btSoftBodyLinkDataOpenCLSIMDAware::getVertexGlobalAddresses ( int  vertexIndex)
inline

Definition at line 153 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

LinkNodePair btSoftBodyLinkDataOpenCLSIMDAware::getVertexPairLocalAddresses ( int  linkIndex)
inline

Get post-batching local addresses of the vertex pair for a link assuming all vertices used by a wavefront are loaded locally.

Definition at line 161 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

int btSoftBodyLinkDataOpenCLSIMDAware::getWavefrontSize ( )
inline

Definition at line 123 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

bool btSoftBodyLinkDataOpenCLSIMDAware::moveFromAccelerator ( )
virtual

Move data from host memory from the accelerator.

The CPU version will always return that it has moved it.

Reimplemented from btSoftBodyLinkData.

Definition at line 146 of file btSoftBodySolver_OpenCLSIMDAware.cpp.

bool btSoftBodyLinkDataOpenCLSIMDAware::moveToAccelerator ( )
virtual

Move data from host memory to the accelerator.

The CPU version will always return that it has moved it.

Reimplemented from btSoftBodyLinkData.

Definition at line 127 of file btSoftBodySolver_OpenCLSIMDAware.cpp.

bool btSoftBodyLinkDataOpenCLSIMDAware::onAccelerator ( )
virtual

Return true if data is on the accelerator.

The CPU version of this class will return true here because the CPU is the same as the accelerator.

Reimplemented from btSoftBodyLinkData.

Definition at line 122 of file btSoftBodySolver_OpenCLSIMDAware.cpp.

void btSoftBodyLinkDataOpenCLSIMDAware::setLinkAt ( const LinkDescription link,
int  linkIndex 
)
virtual

Insert the link described into the correct data structures assuming space has already been allocated by a call to createLinks.

Reimplemented from btSoftBodyLinkData.

Definition at line 107 of file btSoftBodySolver_OpenCLSIMDAware.cpp.

Member Data Documentation

btOpenCLBuffer<float> btSoftBodyLinkDataOpenCLSIMDAware::m_clLinksMassLSC

Definition at line 58 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

btOpenCLBuffer<float> btSoftBodyLinkDataOpenCLSIMDAware::m_clLinksMaterialLinearStiffnessCoefficient

Definition at line 61 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

btOpenCLBuffer<float> btSoftBodyLinkDataOpenCLSIMDAware::m_clLinksRestLength

Definition at line 60 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

btOpenCLBuffer<float> btSoftBodyLinkDataOpenCLSIMDAware::m_clLinksRestLengthSquared

Definition at line 59 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

btOpenCLBuffer<float> btSoftBodyLinkDataOpenCLSIMDAware::m_clLinkStrength

Definition at line 57 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

btOpenCLBuffer<LinkNodePair> btSoftBodyLinkDataOpenCLSIMDAware::m_clLinkVerticesLocalAddresses

Definition at line 56 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

btOpenCLBuffer< NumBatchesVerticesPair > btSoftBodyLinkDataOpenCLSIMDAware::m_clNumBatchesAndVerticesWithinWaves

Definition at line 48 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

btOpenCLBuffer<int> btSoftBodyLinkDataOpenCLSIMDAware::m_clWavefrontVerticesGlobalAddresses

Definition at line 54 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

cl_command_queue btSoftBodyLinkDataOpenCLSIMDAware::m_cqCommandQue

Definition at line 29 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

btAlignedObjectArray< int > btSoftBodyLinkDataOpenCLSIMDAware::m_linkAddresses

Link addressing information for each cloth.

Allows link locations to be computed independently of data batching.

Definition at line 85 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

btAlignedObjectArray<int> btSoftBodyLinkDataOpenCLSIMDAware::m_linksPerWavefront

Definition at line 46 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

const int btSoftBodyLinkDataOpenCLSIMDAware::m_linksPerWorkItem

Definition at line 32 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

btAlignedObjectArray< LinkNodePair > btSoftBodyLinkDataOpenCLSIMDAware::m_linkVerticesLocalAddresses

Definition at line 55 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

int btSoftBodyLinkDataOpenCLSIMDAware::m_maxBatchesWithinWave

Definition at line 34 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

const int btSoftBodyLinkDataOpenCLSIMDAware::m_maxLinksPerWavefront

Definition at line 33 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

int btSoftBodyLinkDataOpenCLSIMDAware::m_maxVertex

Definition at line 38 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

int btSoftBodyLinkDataOpenCLSIMDAware::m_maxVerticesWithinWave

Definition at line 35 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

btAlignedObjectArray<NumBatchesVerticesPair> btSoftBodyLinkDataOpenCLSIMDAware::m_numBatchesAndVerticesWithinWaves

Definition at line 47 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

int btSoftBodyLinkDataOpenCLSIMDAware::m_numWavefronts

Definition at line 36 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

bool btSoftBodyLinkDataOpenCLSIMDAware::m_onGPU

Definition at line 27 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

btAlignedObjectArray< BatchPair > btSoftBodyLinkDataOpenCLSIMDAware::m_wavefrontBatchStartLengths

Start and length values for computation batches over link data.

Definition at line 90 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

const int btSoftBodyLinkDataOpenCLSIMDAware::m_wavefrontSize

Definition at line 31 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.

btAlignedObjectArray< int > btSoftBodyLinkDataOpenCLSIMDAware::m_wavefrontVerticesGlobalAddresses

Definition at line 53 of file btSoftBodySolverLinkData_OpenCLSIMDAware.h.


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