borrow device memory for AUTO:GPU case to avoid performance gap (#8389)

* borrow device memory for AUTO:GPU case to avoid performance gap

Signed-off-by: fishbell <bell.song@intel.com>

* simplify the logic

Signed-off-by: fishbell <bell.song@intel.com>
This commit is contained in:
song, bell 2021-11-15 09:59:09 -05:00 committed by GitHub
parent cac45e4f29
commit e279ec5962
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -383,6 +383,11 @@ InferenceEngine::IInferRequestInternal::Ptr MultiDeviceExecutableNetwork::Create
InferenceEngine::SoIInferRequestInternal request_to_share_blobs_with;
if (_workModeIsAUTO) {
if (!_networkFirstReady && _networkActualNeeded) {
auto& dev_requests = _workerRequests[_acceleratorDevice.deviceName];
auto index = num % dev_requests.size();
request_to_share_blobs_with = dev_requests.at(index)._inferRequest;
}
return std::make_shared<MultiDeviceInferRequest>(inputs, outputs, request_to_share_blobs_with);
}
@ -406,6 +411,11 @@ InferenceEngine::IInferRequestInternal::Ptr MultiDeviceExecutableNetwork::Create
InferenceEngine::SoIInferRequestInternal request_to_share_blobs_with;
if (_workModeIsAUTO) {
if (!_networkFirstReady && _networkActualNeeded) {
auto& dev_requests = _workerRequests[_acceleratorDevice.deviceName];
auto index = num % dev_requests.size();
request_to_share_blobs_with = dev_requests.at(index)._inferRequest;
}
return std::make_shared<MultiDeviceInferRequest>(networkInputs, networkOutputs, request_to_share_blobs_with);
}