support cache dir in multi/auto/batch (#13507)
* support cache dir in multi/auto Signed-off-by: fishbell <bell.song@intel.com> * support cache_dir in bat h Signed-off-by: fishbell <bell.song@intel.com> * fix case failure Signed-off-by: fishbell <bell.song@intel.com> * clang format Signed-off-by: fishbell <bell.song@intel.com> Signed-off-by: fishbell <bell.song@intel.com>
This commit is contained in:
@@ -27,7 +27,9 @@
|
||||
namespace AutoBatchPlugin {
|
||||
using namespace InferenceEngine;
|
||||
|
||||
std::vector<std::string> supported_configKeys = {CONFIG_KEY(AUTO_BATCH_DEVICE_CONFIG), CONFIG_KEY(AUTO_BATCH_TIMEOUT)};
|
||||
std::vector<std::string> supported_configKeys = {CONFIG_KEY(AUTO_BATCH_DEVICE_CONFIG),
|
||||
CONFIG_KEY(AUTO_BATCH_TIMEOUT),
|
||||
CONFIG_KEY(CACHE_DIR)};
|
||||
|
||||
template <Precision::ePrecision precision>
|
||||
Blob::Ptr create_shared_blob_on_top_of_batched_blob(Blob::Ptr batched_blob,
|
||||
@@ -695,8 +697,15 @@ DeviceInformation AutoBatchInferencePlugin::ParseMetaDevice(const std::string& d
|
||||
if (!deviceIDLocal.empty()) {
|
||||
tconfig[PluginConfigParams::KEY_DEVICE_ID] = deviceIDLocal;
|
||||
}
|
||||
|
||||
return GetCore()->GetSupportedConfig(deviceName, tconfig);
|
||||
// passthrough the cache dir to core->loadnetwork when underlying device does not support cache dir
|
||||
auto deviceConfig = GetCore()->GetSupportedConfig(deviceName, tconfig);
|
||||
if (tconfig.find(CONFIG_KEY(CACHE_DIR)) != tconfig.end() &&
|
||||
deviceConfig.find(CONFIG_KEY(CACHE_DIR)) == deviceConfig.end()) {
|
||||
auto tmpiter = tconfig.find(CONFIG_KEY(CACHE_DIR));
|
||||
if (tmpiter != tconfig.end())
|
||||
deviceConfig.insert({tmpiter->first, tmpiter->second});
|
||||
}
|
||||
return deviceConfig;
|
||||
};
|
||||
|
||||
auto metaDevice = ParseBatchDevice(devicesBatchCfg);
|
||||
|
||||
Reference in New Issue
Block a user