37#ifndef FilterGraphExecutor_h
38#define FilterGraphExecutor_h
40#include <condition_variable>
59 {
return m_needBegin; }
64 const std::set<FlowGraphNode*>& GetNodes()
70 void Run(vk::raii::CommandBuffer& cmdBuf, std::shared_ptr<QueueHandle> queue)
73 p->Refresh(cmdBuf, queue);
79 std::set<FlowGraphNode*> m_nodes;
89 { m_batches.push_back(
batch); }
91 void Run(vk::raii::CommandBuffer& cmdBuf, std::shared_ptr<QueueHandle> queue);
94 {
return m_batches.empty(); }
96 std::set<FlowGraphNode*> GetNodes();
99 std::vector<ConcurrentDispatchBatch> m_batches;
127 return f->GetDisplayName();
129 return "(non-filter node)";
133 void FindConcurrentNodes(
143 void DoExecutorThread(
size_t i);
Definition AcceleratorBuffer.h:204
A set of filters that can be issued to the GPU concurrently and have no mutual dependencies.
Definition FilterGraphExecutor.h:49
void Run(vk::raii::CommandBuffer &cmdBuf, std::shared_ptr< QueueHandle > queue)
Enqueue all of the filters in this batch to the command buffer, and possibly submit it.
Definition FilterGraphExecutor.h:70
Execution manager / scheduler for the filter graph.
Definition FilterGraphExecutor.h:107
std::vector< std::unique_ptr< std::thread > > m_threads
Set of thread contexts.
Definition FilterGraphExecutor.h:160
std::map< FlowGraphNode *, int64_t > m_currentExecutionTime
Performance statistics from current execution.
Definition FilterGraphExecutor.h:184
std::condition_variable m_completionCvar
Condition variable for waking up main thread when work is complete.
Definition FilterGraphExecutor.h:169
std::mutex m_perfStatsMutex
Mutex for updating performance statistics.
Definition FilterGraphExecutor.h:187
std::set< FlowGraphNode * > m_incompleteNodes
Nodes that have not yet been updated.
Definition FilterGraphExecutor.h:151
std::map< FlowGraphNode *, int64_t > GetRunTimes()
Get the run times of the most recent filter graph evaluation.
Definition FilterGraphExecutor.h:117
std::map< FlowGraphNode *, int64_t > m_lastExecutionTime
Performance statistics from previous execution.
Definition FilterGraphExecutor.h:181
void UpdateRunnable()
Searches m_incompleteNodes for any that are unblocked, and adds them to m_runnableNodes.
Definition FilterGraphExecutor.cpp:488
SubmitBatch GetNextBatch()
Returns the next batch of filters to run.
Definition FilterGraphExecutor.cpp:267
std::set< FlowGraphNode * > m_runningNodes
Nodes that are actively being run.
Definition FilterGraphExecutor.h:157
std::mutex m_completionCvarMutex
Mutex for access to m_completionCvar.
Definition FilterGraphExecutor.h:172
std::mutex m_mutex
Mutex for access to shared state.
Definition FilterGraphExecutor.h:148
bool FindNextHopNodes(SubmitBatch &batch)
Searches for nodes that will be eligible to run once anything in the batch has run and adds it.
Definition FilterGraphExecutor.cpp:347
bool m_terminating
Shutdown flag.
Definition FilterGraphExecutor.h:178
std::mutex m_workerCvarMutex
Mutex for access to m_workerCvar.
Definition FilterGraphExecutor.h:166
bool m_allWorkersComplete
Indicates that all worker threads have finished executing this pass.
Definition FilterGraphExecutor.h:175
std::set< FlowGraphNode * > m_runnableNodes
Nodes that have no dependencies and are eligible to run now.
Definition FilterGraphExecutor.h:154
static void ExecutorThread(FilterGraphExecutor *pThis, size_t i)
Thread function to handle filter graph execution.
Definition FilterGraphExecutor.cpp:526
std::condition_variable m_workerCvar
Condition variable for waking up worker threads when work arrives.
Definition FilterGraphExecutor.h:163
void RunBlocking(const std::set< FlowGraphNode * > &nodes)
Evaluates the filter graph, blocking until execution has completed.
Definition FilterGraphExecutor.cpp:118
Abstract base class for a node in the signal flow graph.
Definition FlowGraphNode.h:81
A single channel of an instrument.
Definition InstrumentChannel.h:63
A set of filters that can be issued to the GPU in a single submit call, but may have dependencies.
Definition FilterGraphExecutor.h:86