Bullet Collision Detection & Physics Library
MiniCLTask.cpp
Go to the documentation of this file.
1 /*
2 Bullet Continuous Collision Detection and Physics Library, Copyright (c) 2007 Erwin Coumans
3 
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 
10 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.
11 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
12 3. This notice may not be removed or altered from any source distribution.
13 
14 */
15 
16 
17 #include "MiniCLTask.h"
20 #include "LinearMath/btMinMax.h"
21 #include "MiniCLTask.h"
23 
24 
25 #ifdef __SPU__
26 #include <spu_printf.h>
27 #else
28 #include <stdio.h>
29 #define spu_printf printf
30 #endif
31 
33 
35 {
36 
37 };
38 
39 
40 //-- MAIN METHOD
41 void processMiniCLTask(void* userPtr, void* lsMemory)
42 {
43  // BT_PROFILE("processSampleTask");
44 
46 
47  MiniCLTaskDesc* taskDescPtr = (MiniCLTaskDesc*)userPtr;
48  MiniCLTaskDesc& taskDesc = *taskDescPtr;
49 
50  for (unsigned int i=taskDesc.m_firstWorkUnit;i<taskDesc.m_lastWorkUnit;i++)
51  {
52  taskDesc.m_kernel->m_launcher(&taskDesc, i);
53  }
54 
55 // printf("Compute Unit[%d] executed kernel %d work items [%d..%d)\n",taskDesc.m_taskId,taskDesc.m_kernelProgramId,taskDesc.m_firstWorkUnit,taskDesc.m_lastWorkUnit);
56 
57 }
58 
59 
60 #if defined(__CELLOS_LV2__) || defined (LIBSPE2)
61 
63 
65 {
66  return &gLocalStoreMemory;
67 }
68 #else
70 {
71  return new MiniCLTask_LocalStoreMemory;
72 };
73 
74 #endif
MiniCLKernel * m_kernel
Definition: MiniCLTask.h:48
void processMiniCLTask(void *userPtr, void *lsMemory)
Definition: MiniCLTask.cpp:41
void * createMiniCLLocalStoreMemory()
Definition: MiniCLTask.cpp:69
#define ATTRIBUTE_ALIGNED16(a)
Definition: btScalar.h:59
int gMiniCLNumOutstandingTasks
Definition: MiniCLTask.cpp:32
uint32_t m_firstWorkUnit
Definition: MiniCLTask.h:45
uint32_t m_lastWorkUnit
Definition: MiniCLTask.h:46
kernelLauncherCB m_launcher