MiniCLTask.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. Bullet Continuous Collision Detection and Physics Library, Copyright (c) 2007 Erwin Coumans
  3. This software is provided 'as-is', without any express or implied warranty.
  4. In no event will the authors be held liable for any damages arising from the use of this software.
  5. Permission is granted to anyone to use this software for any purpose,
  6. including commercial applications, and to alter it and redistribute it freely,
  7. subject to the following restrictions:
  8. 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.
  9. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  10. 3. This notice may not be removed or altered from any source distribution.
  11. */
  12. #ifndef MINICL__TASK_H
  13. #define MINICL__TASK_H
  14. #include "bullet/BulletMultiThreaded/PlatformDefinitions.h"
  15. #include "bullet/LinearMath/btScalar.h"
  16. #include "bullet/LinearMath/btAlignedAllocator.h"
  17. #define MINICL_MAX_ARGLENGTH (sizeof(void*))
  18. #define MINI_CL_MAX_ARG 16
  19. #define MINI_CL_MAX_KERNEL_NAME 256
  20. struct MiniCLKernel;
  21. ATTRIBUTE_ALIGNED16(struct) MiniCLTaskDesc
  22. {
  23. BT_DECLARE_ALIGNED_ALLOCATOR();
  24. MiniCLTaskDesc()
  25. {
  26. for (int i=0;i<MINI_CL_MAX_ARG;i++)
  27. {
  28. m_argSizes[i]=0;
  29. }
  30. }
  31. uint32_t m_taskId;
  32. uint32_t m_firstWorkUnit;
  33. uint32_t m_lastWorkUnit;
  34. MiniCLKernel* m_kernel;
  35. void* m_argData[MINI_CL_MAX_ARG];
  36. int m_argSizes[MINI_CL_MAX_ARG];
  37. };
  38. extern "C" int gMiniCLNumOutstandingTasks;
  39. void processMiniCLTask(void* userPtr, void* lsMemory);
  40. void* createMiniCLLocalStoreMemory();
  41. #endif //MINICL__TASK_H