btGpuUtilsSharedDefs.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. Bullet Continuous Collision Detection and Physics Library, http://bulletphysics.org
  3. Copyright (C) 2006, 2007 Sony Computer Entertainment Inc.
  4. This software is provided 'as-is', without any express or implied warranty.
  5. In no event will the authors be held liable for any damages arising from the use of this software.
  6. Permission is granted to anyone to use this software for any purpose,
  7. including commercial applications, and to alter it and redistribute it freely,
  8. subject to the following restrictions:
  9. 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.
  10. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  11. 3. This notice may not be removed or altered from any source distribution.
  12. */
  13. // Shared definitions for GPU-based utilities
  14. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  15. // Keep this file free from Bullet headers
  16. // it is included into both CUDA and CPU code
  17. // file with definitions of BT_GPU_xxx should be included first
  18. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  19. #ifndef BTGPUUTILSDHAREDDEFS_H
  20. #define BTGPUUTILSDHAREDDEFS_H
  21. extern "C"
  22. {
  23. //Round a / b to nearest higher integer value
  24. int BT_GPU_PREF(iDivUp)(int a, int b);
  25. // compute grid and thread block size for a given number of elements
  26. void BT_GPU_PREF(computeGridSize)(int n, int blockSize, int &numBlocks, int &numThreads);
  27. void BT_GPU_PREF(allocateArray)(void** devPtr, unsigned int size);
  28. void BT_GPU_PREF(freeArray)(void* devPtr);
  29. void BT_GPU_PREF(copyArrayFromDevice)(void* host, const void* device, unsigned int size);
  30. void BT_GPU_PREF(copyArrayToDevice)(void* device, const void* host, unsigned int size);
  31. void BT_GPU_PREF(registerGLBufferObject(unsigned int vbo));
  32. void* BT_GPU_PREF(mapGLBufferObject(unsigned int vbo));
  33. void BT_GPU_PREF(unmapGLBufferObject(unsigned int vbo));
  34. } // extern "C"
  35. #endif // BTGPUUTILSDHAREDDEFS_H