b3PrefixScanFloat4CL.h 850 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef B3_PREFIX_SCAN_CL_H
  2. #define B3_PREFIX_SCAN_CL_H
  3. #include "b3OpenCLArray.h"
  4. #include "b3BufferInfoCL.h"
  5. #include "Bullet3Common/b3AlignedObjectArray.h"
  6. #include "Bullet3Common/b3Vector3.h"
  7. class b3PrefixScanFloat4CL
  8. {
  9. enum
  10. {
  11. BLOCK_SIZE = 128
  12. };
  13. // Option m_option;
  14. cl_command_queue m_commandQueue;
  15. cl_kernel m_localScanKernel;
  16. cl_kernel m_blockSumKernel;
  17. cl_kernel m_propagationKernel;
  18. b3OpenCLArray<b3Vector3>* m_workBuffer;
  19. public:
  20. b3PrefixScanFloat4CL(cl_context ctx, cl_device_id device, cl_command_queue queue, int size = 0);
  21. virtual ~b3PrefixScanFloat4CL();
  22. void execute(b3OpenCLArray<b3Vector3>& src, b3OpenCLArray<b3Vector3>& dst, int n, b3Vector3* sum = 0);
  23. void executeHost(b3AlignedObjectArray<b3Vector3>& src, b3AlignedObjectArray<b3Vector3>& dst, int n, b3Vector3* sum);
  24. };
  25. #endif //B3_PREFIX_SCAN_CL_H