more bt* to b3*
This commit is contained in:
@@ -138,8 +138,8 @@ void btBoundSearchCL::execute(btOpenCLArray<btSortData>& src, int nSrc, btOpenCL
|
||||
}
|
||||
|
||||
|
||||
void btBoundSearchCL::executeHost( btAlignedObjectArray<btSortData>& src, int nSrc,
|
||||
btAlignedObjectArray<unsigned int>& dst, int nDst, Option option )
|
||||
void btBoundSearchCL::executeHost( b3AlignedObjectArray<btSortData>& src, int nSrc,
|
||||
b3AlignedObjectArray<unsigned int>& dst, int nDst, Option option )
|
||||
{
|
||||
|
||||
|
||||
@@ -188,9 +188,9 @@ void btBoundSearchCL::executeHost( btAlignedObjectArray<btSortData>& src, int nS
|
||||
}
|
||||
else if( option == COUNT )
|
||||
{
|
||||
btAlignedObjectArray<unsigned int> lower;
|
||||
b3AlignedObjectArray<unsigned int> lower;
|
||||
lower.resize(nDst );
|
||||
btAlignedObjectArray<unsigned int> upper;
|
||||
b3AlignedObjectArray<unsigned int> upper;
|
||||
upper.resize(nDst );
|
||||
|
||||
for(int i=0; i<nDst; i++)
|
||||
|
||||
@@ -60,7 +60,7 @@ class btBoundSearchCL
|
||||
// src has to be src[i].m_key <= src[i+1].m_key
|
||||
void execute( btOpenCLArray<btSortData>& src, int nSrc, btOpenCLArray<unsigned int>& dst, int nDst, Option option = BOUND_LOWER );
|
||||
|
||||
void executeHost( btAlignedObjectArray<btSortData>& src, int nSrc, btAlignedObjectArray<unsigned int>& dst, int nDst, Option option = BOUND_LOWER);
|
||||
void executeHost( b3AlignedObjectArray<btSortData>& src, int nSrc, b3AlignedObjectArray<unsigned int>& dst, int nDst, Option option = BOUND_LOWER);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ void btFillCL::execute(btOpenCLArray<unsigned int>& src, const unsigned int valu
|
||||
}
|
||||
}
|
||||
|
||||
void btFillCL::executeHost(btAlignedObjectArray<btInt2> &src, const btInt2 &value, int n, int offset)
|
||||
void btFillCL::executeHost(b3AlignedObjectArray<btInt2> &src, const btInt2 &value, int n, int offset)
|
||||
{
|
||||
for (int i=0;i<n;i++)
|
||||
{
|
||||
@@ -98,7 +98,7 @@ void btFillCL::executeHost(btAlignedObjectArray<btInt2> &src, const btInt2 &valu
|
||||
}
|
||||
}
|
||||
|
||||
void btFillCL::executeHost(btAlignedObjectArray<int> &src, const int value, int n, int offset)
|
||||
void btFillCL::executeHost(b3AlignedObjectArray<int> &src, const int value, int n, int offset)
|
||||
{
|
||||
for (int i=0;i<n;i++)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define BT_FILL_CL_H
|
||||
|
||||
#include "btOpenCLArray.h"
|
||||
#include "BulletCommon/btScalar.h"
|
||||
#include "BulletCommon/b3Scalar.h"
|
||||
|
||||
#include "btInt2.h"
|
||||
#include "btInt4.h"
|
||||
@@ -48,9 +48,9 @@ public:
|
||||
|
||||
void execute(btOpenCLArray<btInt2>& src, const btInt2& value, int n, int offset = 0);
|
||||
|
||||
void executeHost(btAlignedObjectArray<btInt2> &src, const btInt2 &value, int n, int offset);
|
||||
void executeHost(b3AlignedObjectArray<btInt2> &src, const btInt2 &value, int n, int offset);
|
||||
|
||||
void executeHost(btAlignedObjectArray<int> &src, const int value, int n, int offset);
|
||||
void executeHost(b3AlignedObjectArray<int> &src, const int value, int n, int offset);
|
||||
|
||||
// void execute(btOpenCLArray<btInt4>& src, const btInt4& value, int n, int offset = 0);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef BT_INT4_H
|
||||
#define BT_INT4_H
|
||||
|
||||
#include "BulletCommon/btScalar.h"
|
||||
#include "BulletCommon/b3Scalar.h"
|
||||
|
||||
ATTRIBUTE_ALIGNED16(struct) btUnsignedInt4
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#define BT_LAUNCHER_CL_H
|
||||
|
||||
#include "btBufferInfoCL.h"
|
||||
#include "BulletCommon/btMinMax.h"
|
||||
#include "BulletCommon/b3MinMax.h"
|
||||
#include "btOpenCLArray.h"
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -31,14 +31,14 @@ class btLauncherCL
|
||||
cl_kernel m_kernel;
|
||||
int m_idx;
|
||||
|
||||
btAlignedObjectArray<btKernelArgData> m_kernelArguments;
|
||||
b3AlignedObjectArray<btKernelArgData> m_kernelArguments;
|
||||
|
||||
|
||||
int m_serializationSizeInBytes;
|
||||
|
||||
public:
|
||||
|
||||
btAlignedObjectArray<btOpenCLArray<unsigned char>* > m_arrays;
|
||||
b3AlignedObjectArray<btOpenCLArray<unsigned char>* > m_arrays;
|
||||
|
||||
btLauncherCL(cl_command_queue queue, cl_kernel kernel)
|
||||
:m_commandQueue(queue),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef BT_OPENCL_ARRAY_H
|
||||
#define BT_OPENCL_ARRAY_H
|
||||
|
||||
#include "BulletCommon/btAlignedObjectArray.h"
|
||||
#include "BulletCommon/b3AlignedObjectArray.h"
|
||||
#include "../../basic_initialize/b3OpenCLInclude.h"
|
||||
|
||||
template <typename T>
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
}
|
||||
|
||||
// we could enable this assignment, but need to make sure to avoid accidental deep copies
|
||||
// btOpenCLArray<T>& operator=(const btAlignedObjectArray<T>& src)
|
||||
// btOpenCLArray<T>& operator=(const b3AlignedObjectArray<T>& src)
|
||||
// {
|
||||
// copyFromArray(src);
|
||||
// return *this;
|
||||
@@ -212,7 +212,7 @@ public:
|
||||
btAssert( status == CL_SUCCESS );
|
||||
}
|
||||
|
||||
void copyFromHost(const btAlignedObjectArray<T>& srcArray, bool waitForCompletion=true)
|
||||
void copyFromHost(const b3AlignedObjectArray<T>& srcArray, bool waitForCompletion=true)
|
||||
{
|
||||
int newSize = srcArray.size();
|
||||
|
||||
@@ -238,7 +238,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
void copyToHost(btAlignedObjectArray<T>& destArray, bool waitForCompletion=true) const
|
||||
void copyToHost(b3AlignedObjectArray<T>& destArray, bool waitForCompletion=true) const
|
||||
{
|
||||
destArray.resize(this->size());
|
||||
if (size())
|
||||
|
||||
@@ -98,7 +98,7 @@ void btPrefixScanCL::execute(btOpenCLArray<unsigned int>& src, btOpenCLArray<uns
|
||||
}
|
||||
|
||||
|
||||
void btPrefixScanCL::executeHost(btAlignedObjectArray<unsigned int>& src, btAlignedObjectArray<unsigned int>& dst, int n, unsigned int* sum)
|
||||
void btPrefixScanCL::executeHost(b3AlignedObjectArray<unsigned int>& src, b3AlignedObjectArray<unsigned int>& dst, int n, unsigned int* sum)
|
||||
{
|
||||
unsigned int s = 0;
|
||||
//if( data->m_option == EXCLUSIVE )
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "btOpenCLArray.h"
|
||||
#include "btBufferInfoCL.h"
|
||||
#include "BulletCommon/btAlignedObjectArray.h"
|
||||
#include "BulletCommon/b3AlignedObjectArray.h"
|
||||
|
||||
class btPrefixScanCL
|
||||
{
|
||||
@@ -31,7 +31,7 @@ class btPrefixScanCL
|
||||
virtual ~btPrefixScanCL();
|
||||
|
||||
void execute(btOpenCLArray<unsigned int>& src, btOpenCLArray<unsigned int>& dst, int n, unsigned int* sum = 0);
|
||||
void executeHost(btAlignedObjectArray<unsigned int>& src, btAlignedObjectArray<unsigned int>& dst, int n, unsigned int* sum);
|
||||
void executeHost(b3AlignedObjectArray<unsigned int>& src, b3AlignedObjectArray<unsigned int>& dst, int n, unsigned int* sum);
|
||||
};
|
||||
|
||||
#endif //BT_PREFIX_SCAN_CL_H
|
||||
|
||||
@@ -93,7 +93,7 @@ btRadixSort32CL::~btRadixSort32CL()
|
||||
clReleaseKernel(m_prefixScanKernel);
|
||||
}
|
||||
|
||||
void btRadixSort32CL::executeHost(btAlignedObjectArray<btSortData>& inout, int sortBits /* = 32 */)
|
||||
void btRadixSort32CL::executeHost(b3AlignedObjectArray<btSortData>& inout, int sortBits /* = 32 */)
|
||||
{
|
||||
int n = inout.size();
|
||||
const int BITS_PER_PASS = 8;
|
||||
@@ -104,7 +104,7 @@ void btRadixSort32CL::executeHost(btAlignedObjectArray<btSortData>& inout, int s
|
||||
int counter[NUM_TABLES];
|
||||
|
||||
btSortData* src = &inout[0];
|
||||
btAlignedObjectArray<btSortData> workbuffer;
|
||||
b3AlignedObjectArray<btSortData> workbuffer;
|
||||
workbuffer.resize(inout.size());
|
||||
btSortData* dst = &workbuffer[0];
|
||||
|
||||
@@ -166,7 +166,7 @@ void btRadixSort32CL::executeHost(btAlignedObjectArray<btSortData>& inout, int s
|
||||
void btRadixSort32CL::executeHost(btOpenCLArray<btSortData>& keyValuesInOut, int sortBits /* = 32 */)
|
||||
{
|
||||
|
||||
btAlignedObjectArray<btSortData> inout;
|
||||
b3AlignedObjectArray<btSortData> inout;
|
||||
keyValuesInOut.copyToHost(inout);
|
||||
|
||||
executeHost(inout,sortBits);
|
||||
@@ -194,7 +194,7 @@ void btRadixSort32CL::execute(btOpenCLArray<btSortData>& keyValuesInOut, int sor
|
||||
int dataAlignment = DATA_ALIGNMENT;
|
||||
|
||||
#ifdef DEBUG_RADIXSORT2
|
||||
btAlignedObjectArray<btSortData> test2;
|
||||
b3AlignedObjectArray<btSortData> test2;
|
||||
keyValuesInOut.copyToHost(test2);
|
||||
printf("numElem = %d\n",test2.size());
|
||||
for (int i=0;i<test2.size();i++)
|
||||
@@ -307,7 +307,7 @@ void btRadixSort32CL::execute(btOpenCLArray<btSortData>& keyValuesInOut, int sor
|
||||
|
||||
|
||||
#ifdef DEBUG_RADIXSORT
|
||||
btAlignedObjectArray<unsigned int> testHist;
|
||||
b3AlignedObjectArray<unsigned int> testHist;
|
||||
srcHisto->copyToHost(testHist);
|
||||
printf("ib = %d, testHist size = %d, non zero elements:\n",ib, testHist.size());
|
||||
for (int i=0;i<testHist.size();i++)
|
||||
@@ -379,8 +379,8 @@ void btRadixSort32CL::execute(btOpenCLArray<btSortData>& keyValuesInOut, int sor
|
||||
int startBit = ib;
|
||||
|
||||
destHisto->copyToHost(testHist);
|
||||
btAlignedObjectArray<btSortData> srcHost;
|
||||
btAlignedObjectArray<btSortData> dstHost;
|
||||
b3AlignedObjectArray<btSortData> srcHost;
|
||||
b3AlignedObjectArray<btSortData> dstHost;
|
||||
dstHost.resize(src->size());
|
||||
|
||||
src->copyToHost(srcHost);
|
||||
@@ -405,11 +405,11 @@ void btRadixSort32CL::execute(btOpenCLArray<btSortData>& keyValuesInOut, int sor
|
||||
int counter2[NUM_TABLES]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
int tables[NUM_TABLES];
|
||||
btAlignedObjectArray<btSortData> dstHostOK;
|
||||
b3AlignedObjectArray<btSortData> dstHostOK;
|
||||
dstHostOK.resize(src->size());
|
||||
|
||||
destHisto->copyToHost(testHist);
|
||||
btAlignedObjectArray<btSortData> srcHost;
|
||||
b3AlignedObjectArray<btSortData> srcHost;
|
||||
src->copyToHost(srcHost);
|
||||
|
||||
int blockSize = 256;
|
||||
@@ -435,7 +435,7 @@ void btRadixSort32CL::execute(btOpenCLArray<btSortData>& keyValuesInOut, int sor
|
||||
}
|
||||
|
||||
|
||||
btAlignedObjectArray<btSortData> dstHost;
|
||||
b3AlignedObjectArray<btSortData> dstHost;
|
||||
dstHost.resize(src->size());
|
||||
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
|
||||
void execute(btOpenCLArray<btSortData>& keyValuesInOut, int sortBits = 32 );
|
||||
void executeHost(btOpenCLArray<btSortData>& keyValuesInOut, int sortBits = 32);
|
||||
void executeHost(btAlignedObjectArray<btSortData>& keyValuesInOut, int sortBits = 32);
|
||||
void executeHost(b3AlignedObjectArray<btSortData>& keyValuesInOut, int sortBits = 32);
|
||||
|
||||
};
|
||||
#endif //BT_RADIXSORT32_H
|
||||
|
||||
Reference in New Issue
Block a user