[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-physics / third-party / bullet3 / src / Bullet3OpenCL / ParallelPrimitives / b3PrefixScanFloat4CL.h
1
2 #ifndef B3_PREFIX_SCAN_CL_H
3 #define B3_PREFIX_SCAN_CL_H
4
5 #include "b3OpenCLArray.h"
6 #include "b3BufferInfoCL.h"
7 #include "Bullet3Common/b3AlignedObjectArray.h"
8 #include "Bullet3Common/b3Vector3.h"
9
10 class b3PrefixScanFloat4CL
11 {
12         enum
13         {
14                 BLOCK_SIZE = 128
15         };
16
17         //      Option m_option;
18
19         cl_command_queue m_commandQueue;
20
21         cl_kernel m_localScanKernel;
22         cl_kernel m_blockSumKernel;
23         cl_kernel m_propagationKernel;
24
25         b3OpenCLArray<b3Vector3>* m_workBuffer;
26
27 public:
28         b3PrefixScanFloat4CL(cl_context ctx, cl_device_id device, cl_command_queue queue, int size = 0);
29
30         virtual ~b3PrefixScanFloat4CL();
31
32         void execute(b3OpenCLArray<b3Vector3>& src, b3OpenCLArray<b3Vector3>& dst, int n, b3Vector3* sum = 0);
33         void executeHost(b3AlignedObjectArray<b3Vector3>& src, b3AlignedObjectArray<b3Vector3>& dst, int n, b3Vector3* sum);
34 };
35
36 #endif  //B3_PREFIX_SCAN_CL_H