struct InferenceEngine::IStreamsExecutor::Config¶
Overview¶
Defines IStreamsExecutor configuration. More…
#include <ie_istreams_executor.hpp>
struct Config
{
// enums
enum PreferredCoreType;
// fields
std::string _name;
int _streams = 1;
int _threadsPerStream = 0;
ThreadBindingType _threadBindingType = ThreadBindingType::NONE;
int _threadBindingStep = 1;
int _threadBindingOffset = 0;
int _threads = 0;
enum InferenceEngine::IStreamsExecutor::Config::PreferredCoreType _threadPreferredCoreType = PreferredCoreType::ANY;
// construction
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
);
// methods
std::vector<std::string> SupportedKeys() const;
void SetConfig(const std::string& key, const std::string& value);
Parameter GetConfig(const std::string& key) const;
static Config MakeDefaultMultiThreaded(
const Config& initial,
const bool fp_intesive = true
);
static int GetDefaultNumStreams();
};
Detailed Documentation¶
Defines IStreamsExecutor configuration.
Fields¶
std::string _name
Used by ITT
to name executor threads.
int _streams = 1
Number of streams.
int _threadsPerStream = 0
Number of threads per stream that executes ie_parallel
calls.
ThreadBindingType _threadBindingType = ThreadBindingType::NONE
Thread binding to hardware resource type. No binding by default
int _threadBindingStep = 1
In case of CORES binding offset type thread binded to cores with defined step
int _threadBindingOffset = 0
In case of CORES binding offset type thread binded to cores starting from offset
int _threads = 0
Number of threads distributed between streams. Reserved. Should not be used.
enum InferenceEngine::IStreamsExecutor::Config::PreferredCoreType _threadPreferredCoreType = PreferredCoreType::ANY
In case of HYBRID_AWARE hints the TBB to affinitize.
Construction¶
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.
Parameters:
name |
The executor name |
streams |
Number of streams. |
threadsPerStream |
Number of threads per stream that executes |
threadBindingType |
|
threadBindingStep |
|
threadBindingOffset |
|
threads |
|
threadPreferBigCores |
Methods¶
std::vector<std::string> SupportedKeys() const
Supported Configuration keys.
Returns:
vector of supported configuration keys
void SetConfig(const std::string& key, const std::string& value)
Parses configuration key/value pair.
Parameters:
key |
configuration key |
value |
configuration values |
Parameter GetConfig(const std::string& key) const
Return configuration value.
Parameters:
key |
configuration key |
Returns:
configuration value wrapped into Parameter
static Config MakeDefaultMultiThreaded(
const Config& initial,
const bool fp_intesive = true
)
Create appropriate multithreaded configuration filing unconfigured values from initial configuration using hardware properties.
Parameters:
initial |
Inital configuration |
fp_intesive |
additional hint for the the (Hybrid) core-types selection logic whether the executor should be configured for floating point intensive work (as opposite to int8 intensive) |
Returns:
configured values