MiniCLTask.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library, Copyright (c) 2007 Erwin Coumans
00003 
00004 This software is provided 'as-is', without any express or implied warranty.
00005 In no event will the authors be held liable for any damages arising from the use of this software.
00006 Permission is granted to anyone to use this software for any purpose, 
00007 including commercial applications, and to alter it and redistribute it freely, 
00008 subject to the following restrictions:
00009 
00010 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.
00011 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00012 3. This notice may not be removed or altered from any source distribution.
00013 
00014 */
00015 
00016 #ifndef MINICL__TASK_H
00017 #define MINICL__TASK_H
00018 
00019 #include "BulletMultiThreaded/PlatformDefinitions.h"
00020 #include "LinearMath/btScalar.h"
00021 
00022 #include "LinearMath/btAlignedAllocator.h"
00023 
00024 
00025 #define MINICL_MAX_ARGLENGTH (sizeof(void*))
00026 #define MINI_CL_MAX_ARG 16
00027 #define MINI_CL_MAX_KERNEL_NAME 256
00028 
00029 struct MiniCLKernel;
00030 
00031 ATTRIBUTE_ALIGNED16(struct) MiniCLTaskDesc
00032 {
00033         BT_DECLARE_ALIGNED_ALLOCATOR();
00034 
00035         MiniCLTaskDesc()
00036         {
00037                 for (int i=0;i<MINI_CL_MAX_ARG;i++)
00038                 {
00039                         m_argSizes[i]=0;
00040                 }
00041         }
00042 
00043         uint32_t                m_taskId;
00044 
00045         uint32_t                m_firstWorkUnit;
00046         uint32_t                m_lastWorkUnit;
00047 
00048         MiniCLKernel*   m_kernel;
00049 
00050         void*                   m_argData[MINI_CL_MAX_ARG];
00051         int                             m_argSizes[MINI_CL_MAX_ARG];
00052 };
00053 
00054 extern "C" int gMiniCLNumOutstandingTasks;
00055 
00056 
00057 void    processMiniCLTask(void* userPtr, void* lsMemory);
00058 void*   createMiniCLLocalStoreMemory();
00059 
00060 
00061 #endif //MINICL__TASK_H
00062