OClCollMeshEngn: implement start/stop/setup/finalize
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
#ifndef _LIVOX_GEN1_OPENCL_COLLATING_AND_MESHING_ENGINE_H
|
||||
#define _LIVOX_GEN1_OPENCL_COLLATING_AND_MESHING_ENGINE_H
|
||||
|
||||
#include <boostAsioLinkageFix.h>
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
#include <functional>
|
||||
#define CL_TARGET_OPENCL_VERSION 300
|
||||
#include <CL/cl.h>
|
||||
#include "stagingBuffer.h"
|
||||
|
||||
namespace smo {
|
||||
namespace stim_buff {
|
||||
@@ -31,6 +34,14 @@ public:
|
||||
bool setup();
|
||||
void finalize();
|
||||
|
||||
// Callback function type for collateFrameReq
|
||||
typedef std::function<void()> collateFrameReqCbFn;
|
||||
|
||||
void start(
|
||||
StagingBuffer& assemblyBuff, StagingBuffer& collationBuff,
|
||||
collateFrameReqCbFn callback);
|
||||
void stop();
|
||||
|
||||
private:
|
||||
PcloudStimulusBuffer& parent;
|
||||
|
||||
@@ -44,9 +55,26 @@ private:
|
||||
bool isSetup;
|
||||
|
||||
// OpenCL buffers
|
||||
cl_mem assemblyBuffer;
|
||||
cl_mem xyzBuffer;
|
||||
cl_mem intensityBuffer;
|
||||
cl_mem clAssemblyBuffer;
|
||||
cl_mem clCollationBuffer;
|
||||
|
||||
// State tracking
|
||||
bool isRunning;
|
||||
cl_event currentKernelEvent;
|
||||
bool memoryPinned;
|
||||
|
||||
// Memory pinning tracking
|
||||
void* assemblyBufferPtr;
|
||||
size_t assemblyBufferSize;
|
||||
void* collationBufferPtr;
|
||||
size_t collationBufferSize;
|
||||
|
||||
// Callback storage
|
||||
collateFrameReqCbFn collateFrameReqCb;
|
||||
|
||||
// Static callback for OpenCL event
|
||||
static void CL_CALLBACK kernelEventCallback(
|
||||
cl_event event, cl_int event_command_exec_status, void* user_data);
|
||||
};
|
||||
|
||||
} // namespace stim_buff
|
||||
|
||||
Reference in New Issue
Block a user