forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ARM CPU] ACL TBB scheduler (openvinotoolkit#17445)
- Loading branch information
Showing
6 changed files
with
84 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/plugins/intel_cpu/src/nodes/executors/acl/acl_ie_scheduler.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright (C) 2020-2023 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#include "acl_ie_scheduler.hpp" | ||
|
||
#include "arm_compute/core/CPP/ICPPKernel.h" | ||
#include "arm_compute/core/Error.h" | ||
#include "arm_compute/core/Helpers.h" | ||
#include <ie_parallel.hpp> | ||
|
||
namespace ov { | ||
namespace intel_cpu { | ||
|
||
using namespace arm_compute; | ||
|
||
ACLScheduler::ACLScheduler() = default; | ||
|
||
unsigned int ACLScheduler::num_threads() const { return parallel_get_num_threads(); } | ||
|
||
void ACLScheduler::set_num_threads(unsigned int num_threads) {} | ||
|
||
void ACLScheduler::schedule(ICPPKernel *kernel, const Hints &hints) { | ||
ITensorPack tensors; | ||
schedule_common(kernel, hints, kernel->window(), tensors); | ||
} | ||
|
||
void ACLScheduler::schedule_op(ICPPKernel *kernel, const Hints &hints, const Window &window, ITensorPack &tensors) { | ||
schedule_common(kernel, hints, window, tensors); | ||
} | ||
|
||
void ACLScheduler::run_workloads(std::vector<arm_compute::IScheduler::Workload> &workloads) { | ||
InferenceEngine::parallel_for(workloads.size(), [&] (int wid) { | ||
ThreadInfo info; | ||
info.cpu_info = &cpu_info(); | ||
info.num_threads = parallel_get_num_threads(); | ||
info.thread_id = wid; | ||
workloads[wid](info); | ||
}); | ||
} | ||
|
||
} // namespace intel_cpu | ||
} // namespace ov |
28 changes: 28 additions & 0 deletions
28
src/plugins/intel_cpu/src/nodes/executors/acl/acl_ie_scheduler.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (C) 2020-2023 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include <arm_compute/runtime/Scheduler.h> | ||
#include <arm_compute/core/CPP/ICPPKernel.h> | ||
#include <arm_compute/core/ITensorPack.h> | ||
|
||
namespace ov { | ||
namespace intel_cpu { | ||
|
||
using namespace arm_compute; | ||
|
||
class ACLScheduler final : public IScheduler { | ||
public: | ||
ACLScheduler(); | ||
~ACLScheduler() override = default; | ||
std::uint32_t num_threads() const override; | ||
void set_num_threads(unsigned int num_threads) override; | ||
void schedule(ICPPKernel *kernel, const Hints &hints) override; | ||
void schedule_op(ICPPKernel *kernel, const Hints &hints, const Window &window, ITensorPack &tensors) override; | ||
protected: | ||
void run_workloads(std::vector<Workload> &workloads) override; | ||
}; | ||
} // namespace intel_cpu | ||
} // namespace ov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters