Move some code from Branches/OpenCL to trunk, related to threading and OpenCL:

Added Demos/ThreadingDemo showing how to use the cross-platform btThreadSupportInterface under Windows.
Added Demos/ParticlesOpenCL showing how to run the NVidia particle demo under OpenCL implementations by AMD, NVidia and MiniCL (CPU)
This commit is contained in:
erwin.coumans
2010-06-24 22:54:00 +00:00
parent b2798eaae5
commit 498da0721b
36 changed files with 4020 additions and 38 deletions

View File

@@ -30,10 +30,6 @@ typedef void (*Win32ThreadFunc)(void* userPtr,void* lsMemory);
typedef void* (*Win32lsMemorySetupFunc)();
///Win32ThreadSupport helps to initialize/shutdown libspe2, start/stop SPU tasks and communication
class Win32ThreadSupport : public btThreadSupportInterface
{
@@ -109,6 +105,8 @@ public:
///check for messages from SPUs
virtual void waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1);
virtual bool isTaskCompleted(unsigned int *puiArgument0, unsigned int *puiArgument1, int timeOutInMilliseconds);
///start the spus (can be called at the beginning of each frame, to make sure that the right SPU program is loaded)
virtual void startSPU();
@@ -125,6 +123,14 @@ public:
return m_maxNumTasks;
}
virtual void* getThreadLocalMemory(int taskId)
{
return m_activeSpuStatus[taskId].m_lsMemory;
}
virtual btBarrier* createBarrier();
virtual btCriticalSection* createCriticalSection();
};
#endif //WIN32_THREAD_SUPPORT_H