CYNQ  0.3.0
Framework to develop FPGA applications in C++ with the easiness of PYNQ
stream.hpp
1 /*
2  * See LICENSE for more information about licensing
3  *
4  * Copyright 2024
5  * Author: Luis G. Leon-Vega <luis.leon@ieee.org>
6  *
7  */
8 #pragma once
9 #include <cynq/enums.hpp>
10 #include <cynq/execution-graph.hpp>
11 #include <cynq/status.hpp>
12 #include <memory>
13 #include <vector>
14 
15 namespace cynq {
27  public:
33  explicit ExecutionStream(std::shared_ptr<ExecutionGraphParameters> params);
34 
49  NodeID Add(const IExecutionGraph::Function &function,
50  const std::vector<IExecutionGraph::NodeID> dependencies =
51  std::vector<IExecutionGraph::NodeID>(0)) override;
52 
65  Status Sync(const IExecutionGraph::NodeID node = -1) override;
66 
74  Status GetLastError() override;
75 
79  virtual ~ExecutionStream();
80 
81  private:
83  std::shared_ptr<ExecutionGraphParameters> params_;
84 
86  void Worker();
87 };
88 } // namespace cynq
ExecutionStream Implementation.
Definition: stream.hpp:26
NodeID Add(const IExecutionGraph::Function &function, const std::vector< IExecutionGraph::NodeID > dependencies=std::vector< IExecutionGraph::NodeID >(0)) override
Adds a function to the execution stream.
Definition: stream.cpp:61
Status Sync(const IExecutionGraph::NodeID node=-1) override
Synchronises the execution of the stream.
Definition: stream.cpp:86
virtual ~ExecutionStream()
destroys the stream
Definition: stream.cpp:196
ExecutionStream(std::shared_ptr< ExecutionGraphParameters > params)
Construct a new execution stream.
Definition: stream.cpp:45
Status GetLastError() override
Get the Last Error found during the execution.
Definition: stream.cpp:135
Execution Graph Interface.
Definition: execution-graph.hpp:52
std::function< Status()> Function
Underlying type for the auxiliar functions.
Definition: execution-graph.hpp:67
int NodeID
Underlying type for the NodeID.
Definition: execution-graph.hpp:57
Structure to define the return characteristics of each function.
Definition: status.hpp:19