Introduced a newStreamSignal() callback for Island Executables

This commit is contained in:
Dmitry Matveev 2020-03-12 17:30:49 +03:00 committed by Ruslan Garnov
parent 016f9ab16e
commit cb5921b375
2 changed files with 19 additions and 0 deletions

View File

@ -123,6 +123,24 @@ public:
virtual bool canReshape() const = 0;
virtual void reshape(ade::Graph& g, const GCompileArgs& args) = 0;
// This method is called when the GStreamingCompiled gets a new
// input source to process. Normally this method is called once
// per stream execution.
//
// The idea of this method is to reset backend's stream-associated
// internal state, if there is any.
//
// The regular GCompiled invocation doesn't call this, there may
// be reset() introduced there but it is completely unnecessary at
// this moment.
//
// FIXME: The design on this and so-called "stateful" kernels is not
// closed yet.
// FIXME: This thing will likely break stuff once we introduce
// "multi-source streaming", a better design needs to be proposed
// at that stage.
virtual void handleNewStream() {}; // do nothing here by default
virtual ~GIslandExecutable() = default;
};

View File

@ -859,6 +859,7 @@ void cv::gimpl::GStreamingExecutor::setSource(GRunArgs &&ins)
for (auto &&out_eh : op.nh->outNodes()) {
out_queues.push_back(reader_queues(*m_island_graph, out_eh));
}
op.isl_exec->handleNewStream();
m_threads.emplace_back(islandActorThread,
op.in_objects,