Put continuation near frontend func
This commit is contained in:
@@ -9,7 +9,35 @@
|
|||||||
namespace smo {
|
namespace smo {
|
||||||
namespace stim_buff {
|
namespace stim_buff {
|
||||||
|
|
||||||
// Continuation class for assembleAndProduceStimulusFrameReq
|
// OpenCL kernels are used to collate and produce our StimFrames.
|
||||||
|
static SpMcRingBuffer::InputEngineConstraints openClInputConstraints(
|
||||||
|
static_cast<size_t>(sysconf(_SC_PAGE_SIZE)), sizeof(void *));
|
||||||
|
|
||||||
|
PcloudStimulusBuffer::PcloudStimulusBuffer(
|
||||||
|
const device::DeviceAttachmentSpec& deviceAttachmentSpec,
|
||||||
|
std::shared_ptr<livoxProto1::Device> &device,
|
||||||
|
const PcloudFormatDesc& formatDesc,
|
||||||
|
int histbuffMs,
|
||||||
|
size_t nDgramsPerStagingBufferFrame)
|
||||||
|
: StimulusBuffer(
|
||||||
|
deviceAttachmentSpec,
|
||||||
|
static_cast<size_t>(histbuffMs / CONFIG_STIMBUFF_FRAME_PERIOD_MS),
|
||||||
|
openClInputConstraints,
|
||||||
|
device->componentThread->getIoService()),
|
||||||
|
deviceAttachmentSpec(deviceAttachmentSpec), device(device),
|
||||||
|
formatDesc(formatDesc), stagingBuffer(
|
||||||
|
StagingBuffer::InputEngineConstraints::ioUringConstraints,
|
||||||
|
OpenClConstraints(), nDgramsPerStagingBufferFrame),
|
||||||
|
ioUringAssemblyEngine(*this)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void PcloudStimulusBuffer::stimFrameProductionTimesliceInd()
|
||||||
|
{
|
||||||
|
// Release the spinlock for now
|
||||||
|
frameAssemblyRateLimiter.release();
|
||||||
|
}
|
||||||
|
|
||||||
class PcloudStimulusBuffer::AssembleAndProduceStimulusFrameReq
|
class PcloudStimulusBuffer::AssembleAndProduceStimulusFrameReq
|
||||||
: public smo::PostedAsynchronousContinuation<
|
: public smo::PostedAsynchronousContinuation<
|
||||||
assembleAndProduceStimulusFrameReqCbFn>
|
assembleAndProduceStimulusFrameReqCbFn>
|
||||||
@@ -39,34 +67,6 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// OpenCL kernels are used to collate and produce our StimFrames.
|
|
||||||
static SpMcRingBuffer::InputEngineConstraints openClInputConstraints(
|
|
||||||
static_cast<size_t>(sysconf(_SC_PAGE_SIZE)), sizeof(void *));
|
|
||||||
|
|
||||||
PcloudStimulusBuffer::PcloudStimulusBuffer(
|
|
||||||
const device::DeviceAttachmentSpec& deviceAttachmentSpec,
|
|
||||||
std::shared_ptr<livoxProto1::Device> &device,
|
|
||||||
const PcloudFormatDesc& formatDesc,
|
|
||||||
int histbuffMs,
|
|
||||||
size_t nDgramsPerStagingBufferFrame)
|
|
||||||
: StimulusBuffer(
|
|
||||||
deviceAttachmentSpec,
|
|
||||||
static_cast<size_t>(histbuffMs / CONFIG_STIMBUFF_FRAME_PERIOD_MS),
|
|
||||||
openClInputConstraints,
|
|
||||||
device->componentThread->getIoService()),
|
|
||||||
deviceAttachmentSpec(deviceAttachmentSpec), device(device),
|
|
||||||
formatDesc(formatDesc), stagingBuffer(
|
|
||||||
StagingBuffer::InputEngineConstraints::ioUringConstraints,
|
|
||||||
OpenClConstraints(), nDgramsPerStagingBufferFrame)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void PcloudStimulusBuffer::stimFrameProductionTimesliceInd()
|
|
||||||
{
|
|
||||||
// Release the spinlock for now
|
|
||||||
frameAssemblyRateLimiter.release();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PcloudStimulusBuffer::assembleAndProduceStimulusFrameReq(
|
void PcloudStimulusBuffer::assembleAndProduceStimulusFrameReq(
|
||||||
smo::Callback<assembleAndProduceStimulusFrameReqCbFn> callback)
|
smo::Callback<assembleAndProduceStimulusFrameReqCbFn> callback)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user