/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2011 Advanced Micro Devices, Inc. http://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ ///original author: Erwin Coumans #include "Bullet3OpenCL/Initialize/b3OpenCLUtils.h" #include "Bullet3OpenCL/ParallelPrimitives/b3OpenCLArray.h" #include "Bullet3Common/b3Int2.h" #include "Bullet3Common/b3Quickprof.h" #include "b3BitonicSort.h" #include int numSuccess=0; int numFailed=0; cl_context g_cxMainContext; cl_command_queue g_cqCommandQue; #define MSTRINGIFY(A) #A static const char* kernelSource= #include "BitonicSort.cl" static bool compareFunc(const b3Int2& p, const b3Int2& q) { return (p.x < q.x) || ((p.x == q.x) && ((p.y < q.y))); } int main(int argc, char* argv[]) { int ciErrNum = 0; b3Clock clock; cl_device_type deviceType = CL_DEVICE_TYPE_ALL; const char* vendorSDK = b3OpenCLUtils::getSdkVendorName(); printf("This program was compiled using the %s OpenCL SDK\n",vendorSDK); int numPlatforms = b3OpenCLUtils::getNumPlatforms(); printf("Num Platforms = %d\n", numPlatforms); for (int i=0;i keyValuesGPU(context,g_cqCommandQue); b3AlignedObjectArray keyValuesCPU; b3AlignedObjectArray keyValuesGold; int numValues = 8*1024*1024;//2048;//1024; keyValuesCPU.resize(numValues); for (int i=0;i\n"); getchar(); return 0; }