expose the gUseLargeBatches as command-line argument --use_large_batches
This commit is contained in:
committed by
erwincoumans
parent
8a7ad65177
commit
beb9e98cd3
@@ -59,6 +59,7 @@ extern float shadowMapWidth;
|
|||||||
extern float shadowMapHeight;
|
extern float shadowMapHeight;
|
||||||
extern bool gDebugLauncherCL;
|
extern bool gDebugLauncherCL;
|
||||||
extern bool gAllowCpuOpenCL;
|
extern bool gAllowCpuOpenCL;
|
||||||
|
extern bool gUseLargeBatches;
|
||||||
|
|
||||||
extern bool gDebugForceLoadingFromSource;
|
extern bool gDebugForceLoadingFromSource;
|
||||||
extern bool gDebugSkipLoadingBinary;
|
extern bool gDebugSkipLoadingBinary;
|
||||||
@@ -633,7 +634,7 @@ int main(int argc, char* argv[])
|
|||||||
args.GetCmdLineArgument("cl_device", ci.preferredOpenCLDeviceIndex);
|
args.GetCmdLineArgument("cl_device", ci.preferredOpenCLDeviceIndex);
|
||||||
args.GetCmdLineArgument("cl_platform", ci.preferredOpenCLPlatformIndex);
|
args.GetCmdLineArgument("cl_platform", ci.preferredOpenCLPlatformIndex);
|
||||||
gAllowCpuOpenCL = args.CheckCmdLineFlag("allow_opencl_cpu");
|
gAllowCpuOpenCL = args.CheckCmdLineFlag("allow_opencl_cpu");
|
||||||
|
gUseLargeBatches = args.CheckCmdLineFlag("use_large_batches");
|
||||||
|
|
||||||
gUseJacobi = args.CheckCmdLineFlag("use_jacobi");
|
gUseJacobi = args.CheckCmdLineFlag("use_jacobi");
|
||||||
gUseDbvt = args.CheckCmdLineFlag("use_dbvt");
|
gUseDbvt = args.CheckCmdLineFlag("use_dbvt");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
bool oneBigBatch = true;
|
bool gUseLargeBatches = false;
|
||||||
bool gCpuBatchContacts = false;
|
bool gCpuBatchContacts = false;
|
||||||
bool gCpuSolveConstraint = false;
|
bool gCpuSolveConstraint = false;
|
||||||
bool gCpuRadixSort=false;
|
bool gCpuRadixSort=false;
|
||||||
@@ -771,7 +771,7 @@ void b3GpuPgsContactSolver::solveContacts(int numBodies, cl_mem bodyBuf, cl_mem
|
|||||||
|
|
||||||
int maxNumBatches = 0;
|
int maxNumBatches = 0;
|
||||||
|
|
||||||
if (!oneBigBatch)
|
if (!gUseLargeBatches)
|
||||||
{
|
{
|
||||||
|
|
||||||
if( m_data->m_solverGPU->m_contactBuffer2)
|
if( m_data->m_solverGPU->m_contactBuffer2)
|
||||||
@@ -1064,7 +1064,7 @@ void b3GpuPgsContactSolver::solveContacts(int numBodies, cl_mem bodyBuf, cl_mem
|
|||||||
|
|
||||||
int numNonzeroGrid=0;
|
int numNonzeroGrid=0;
|
||||||
|
|
||||||
if (oneBigBatch)
|
if (gUseLargeBatches)
|
||||||
{
|
{
|
||||||
m_data->m_batchSizes.resize(B3_MAX_NUM_BATCHES);
|
m_data->m_batchSizes.resize(B3_MAX_NUM_BATCHES);
|
||||||
int totalNumConstraints = cpuContacts.size();
|
int totalNumConstraints = cpuContacts.size();
|
||||||
@@ -1125,7 +1125,7 @@ void b3GpuPgsContactSolver::solveContacts(int numBodies, cl_mem bodyBuf, cl_mem
|
|||||||
|
|
||||||
//printf("maxNumBatches = %d\n", maxNumBatches);
|
//printf("maxNumBatches = %d\n", maxNumBatches);
|
||||||
|
|
||||||
if (oneBigBatch)
|
if (gUseLargeBatches)
|
||||||
{
|
{
|
||||||
if (nContacts)
|
if (nContacts)
|
||||||
{
|
{
|
||||||
@@ -1197,7 +1197,7 @@ void b3GpuPgsContactSolver::solveContacts(int numBodies, cl_mem bodyBuf, cl_mem
|
|||||||
|
|
||||||
//m_data->m_batchSizesGpu->copyFromHost(m_data->m_batchSizes);
|
//m_data->m_batchSizesGpu->copyFromHost(m_data->m_batchSizes);
|
||||||
|
|
||||||
if (oneBigBatch)
|
if (gUseLargeBatches)
|
||||||
{
|
{
|
||||||
solveContactConstraintBatchSizes(m_data->m_bodyBufferGPU,
|
solveContactConstraintBatchSizes(m_data->m_bodyBufferGPU,
|
||||||
m_data->m_inertiaBufferGPU,
|
m_data->m_inertiaBufferGPU,
|
||||||
|
|||||||
Reference in New Issue
Block a user