31 class INFERENCE_ENGINE_API_CLASS(IStreamsExecutor) :
public ITaskExecutor {
36 using Ptr = std::shared_ptr<IStreamsExecutor>;
52 struct INFERENCE_ENGINE_API_CLASS(Config) {
64 void SetConfig(
const std::string& key,
const std::string& value);
85 int _threadsPerStream = 0;
87 int _threadBindingStep = 1;
88 int _threadBindingOffset = 0;
90 enum PreferredCoreType {
95 } _threadPreferredCoreType = PreferredCoreType::ANY;
110 std::string name =
"StreamsExecutor",
112 int threadsPerStream = 0,
114 int threadBindingStep = 1,
115 int threadBindingOffset = 0,
117 PreferredCoreType threadPreferredCoreType = PreferredCoreType::ANY) :
120 _threadsPerStream{threadsPerStream},
121 _threadBindingType{threadBindingType},
122 _threadBindingStep{threadBindingStep},
123 _threadBindingOffset{threadBindingOffset},
124 _threads{threads}, _threadPreferredCoreType(threadPreferredCoreType){
virtual int GetNumaNodeId()=0
Return the id of current NUMA Node.
~IStreamsExecutor() override
A virtual destructor.
virtual void Execute(Task task)=0
Execute the task in the current thread using streams executor configuration and constraints.
virtual int GetStreamId()=0
Return the index of current stream.
ThreadBindingType
Defines inference thread binding type.
Definition: ie_istreams_executor.hpp:41
@ NUMA
Bind to the NUMA nodes (default mode for the non-hybrid CPUs on the Win/MacOS, where the 'CORES' is n...
Definition: ie_istreams_executor.hpp:45
@ NONE
Don't bind the inference threads.
Definition: ie_istreams_executor.hpp:42
@ CORES
Bind inference threads to the CPU cores (round-robin)
Definition: ie_istreams_executor.hpp:43
std::shared_ptr< IStreamsExecutor > Ptr
Definition: ie_istreams_executor.hpp:36
Interface for Task Executor. Inference Engine uses InferenceEngine::ITaskExecutor interface to run al...
Definition: ie_itask_executor.hpp:46
std::function< void()> Task
Inference Engine Task Executor can use any copyable callable without parameters and output as a task....
Definition: ie_itask_executor.hpp:25
A header file for Inference Engine Task Executor Interface.
Inference Engine Plugin API namespace.
Defines IStreamsExecutor configuration.
Definition: ie_istreams_executor.hpp:52
Config(std::string name="StreamsExecutor", int streams=1, int threadsPerStream=0, ThreadBindingType threadBindingType=ThreadBindingType::NONE, int threadBindingStep=1, int threadBindingOffset=0, int threads=0, PreferredCoreType threadPreferredCoreType=PreferredCoreType::ANY)
A constructor with arguments.
Definition: ie_istreams_executor.hpp:109
void SetConfig(const std::string &key, const std::string &value)
Parses configuration key/value pair.
std::vector< std::string > SupportedKeys()
Supported Configuration keys.
static Config MakeDefaultMultiThreaded(const Config &initial, const bool fp_intesive=true)
Create appropriate multithreaded configuration filing unconfigured values from initial configuration ...
Parameter GetConfig(const std::string &key)
Return configuration value.
std::string _name
Used by ITT to name executor threads.
Definition: ie_istreams_executor.hpp:83