OClCollMeshEngn: Add method compactCollateAndMeshFrameReq

This method takes an input assembly buffer and selects which
OpenCL kernels need to be executed on that buffer to transform
the input data into the eventual output StimulusFrame for the
current timeslice period.
This commit is contained in:
2025-11-10 00:58:48 -04:00
parent 19a79faabe
commit eedeb4b803
2 changed files with 152 additions and 3 deletions
@@ -10,6 +10,9 @@
#include <stdexcept>
#define CL_TARGET_OPENCL_VERSION 300
#include <CL/cl.h>
#include <asynchronousLoop.h>
#include <callback.h>
#include <user/stimulusFrame.h>
#include "stagingBuffer.h"
#include "frameAssemblyDesc.h"
@@ -40,6 +43,8 @@ public:
// Callback function types
typedef std::function<void(cl_int)> compactKernelCbFn;
typedef std::function<void(cl_int)> collateKernelCbFn;
typedef std::function<void(bool, StimulusFrame&)>
compactCollateAndMeshFrameReqCbFn;
bool startCompactKernel(
StagingBuffer& assemblyBuff, uint32_t nSucceeded,
@@ -52,6 +57,10 @@ public:
void stopCollateKernel();
void stop();
void compactCollateAndMeshFrameReq(
AsynchronousLoop& asyncLoop, StimulusFrame& stimulusFrame,
Callback<compactCollateAndMeshFrameReqCbFn> callback);
private:
PcloudStimulusBuffer& parent;
@@ -106,6 +115,9 @@ private:
StagingBuffer& assemblyBuff, uint32_t nSucceeded);
bool setupCollateDgramsArgs(StagingBuffer& assemblyBuff);
// Forward declaration for continuation class
class CompactCollateAndMeshFrameReq;
// Unified kernel start function
template<typename SetupArgsFn, typename ValidateBuffersFn>
bool startKernel(