btGpuUtilsSharedDefs.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library, http://bulletphysics.org
00003 Copyright (C) 2006, 2007 Sony Computer Entertainment Inc. 
00004 
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose, 
00008 including commercial applications, and to alter it and redistribute it freely, 
00009 subject to the following restrictions:
00010 
00011 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.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015 
00016 // Shared definitions for GPU-based utilities
00017 
00019 //  Keep this file free from Bullet headers
00020 //  it is included into both CUDA and CPU code
00021 //      file with definitions of BT_GPU_xxx should be included first
00023 
00024 
00025 #ifndef BTGPUUTILSDHAREDDEFS_H
00026 #define BTGPUUTILSDHAREDDEFS_H
00027 
00028 
00029 extern "C"
00030 {
00031 
00032 
00033 //Round a / b to nearest higher integer value
00034 int BT_GPU_PREF(iDivUp)(int a, int b);
00035 
00036 // compute grid and thread block size for a given number of elements
00037 void BT_GPU_PREF(computeGridSize)(int n, int blockSize, int &numBlocks, int &numThreads);
00038 
00039 void BT_GPU_PREF(allocateArray)(void** devPtr, unsigned int size);
00040 void BT_GPU_PREF(freeArray)(void* devPtr);
00041 void BT_GPU_PREF(copyArrayFromDevice)(void* host, const void* device, unsigned int size);
00042 void BT_GPU_PREF(copyArrayToDevice)(void* device, const void* host, unsigned int size);
00043 void BT_GPU_PREF(registerGLBufferObject(unsigned int vbo));
00044 void* BT_GPU_PREF(mapGLBufferObject(unsigned int vbo));
00045 void BT_GPU_PREF(unmapGLBufferObject(unsigned int vbo));
00046 
00047 
00048 } // extern "C"
00049 
00050 
00051 #endif // BTGPUUTILSDHAREDDEFS_H
00052