* draft Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com> * refactor for multi Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com> * refactor auto draft Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com> * try to fix executable get config test failed issue Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com> * set ExecNetwork only one time Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com> * format code and using alias Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com> * clear head file Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com> * change name from Context to ScheduleContext Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com> * polishing Signed-off-by: fishbell <bell.song@intel.com> * polish & new implementation Signed-off-by: fishbell <bell.song@intel.com> * enable/test a new schedule Signed-off-by: fishbell <bell.song@intel.com> * port fps logs over Signed-off-by: fishbell <bell.song@intel.com> * restructure Signed-off-by: fishbell <bell.song@intel.com> * fix windows build failure Signed-off-by: fishbell <bell.song@intel.com> * clean up code Signed-off-by: fishbell <bell.song@intel.com> Co-authored-by: Hu, Yuan2 <yuan2.hu@intel.com>
37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
// Copyright (C) 2018-2022 Intel Corporation
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
#include "async_infer_request.hpp"
|
|
|
|
namespace MultiDevicePlugin {
|
|
AsyncInferRequest::AsyncInferRequest(const Schedule::Ptr& schedule,
|
|
const IInferPtr& inferRequest,
|
|
const IE::ITaskExecutor::Ptr& callbackExecutor):
|
|
AsyncInferRequestThreadSafeDefault(inferRequest, nullptr, callbackExecutor),
|
|
_schedule(schedule),
|
|
_inferRequest(inferRequest) {
|
|
auto pipeline = _schedule->GetPipeline(_inferRequest, &_workerInferRequest);
|
|
if (pipeline.size() > 0) {
|
|
_pipeline = std::move(pipeline);
|
|
}
|
|
}
|
|
|
|
void AsyncInferRequest::Infer_ThreadUnsafe() {
|
|
InferUsingAsync();
|
|
}
|
|
|
|
std::map<std::string, IE::InferenceEngineProfileInfo>
|
|
AsyncInferRequest::GetPerformanceCounts() const {
|
|
CheckState();
|
|
auto multiDeviceInfer = std::dynamic_pointer_cast<MultiDeviceInferRequest>(_inferRequest);
|
|
return multiDeviceInfer->GetPerformanceCounts();
|
|
}
|
|
|
|
AsyncInferRequest::~AsyncInferRequest() {
|
|
StopAndWait();
|
|
}
|
|
|
|
} // namespace MultiDevicePlugin
|