[ARM CPU] Fix debug fails in acl tbb scheduler (#20842)

This commit is contained in:
Nesterov Alexander 2023-11-29 10:06:44 +01:00 committed by GitHub
parent d553d4cd55
commit 1b43b3c566
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -24,10 +24,11 @@ void ACLScheduler::set_num_threads(unsigned int num_threads) {}
void ACLScheduler::schedule_custom(ICPPKernel *kernel, const Hints &hints, const Window &window, ITensorPack &tensors) {
const Window & max_window = window;
const unsigned int num_iterations = max_window.num_iterations_total();
const unsigned int num_iterations =
max_window.num_iterations(hints.split_dimension()) == 1 ? 1 : max_window.num_iterations_total();
const auto _num_threads = std::min(num_iterations, static_cast<unsigned int>(parallel_get_num_threads()));
if (num_iterations == 0) {
if (num_iterations < 1) {
return;
}

View File

@ -157,7 +157,8 @@ Engine::SchedulerGuard::~SchedulerGuard() {
// To save the state of scheduler after ACLScheduler has been executed
// TODO: find out the cause of the state
std::lock_guard<std::mutex> lock{this->dest_mutex};
arm_compute::Scheduler::set(arm_compute::Scheduler::Type::ST);
if (!arm_compute::Scheduler::is_available(arm_compute::Scheduler::Type::CUSTOM))
arm_compute::Scheduler::set(arm_compute::Scheduler::Type::ST);
}
#endif