From ead5240ca533f66b1e9f635555e910bd64647582 Mon Sep 17 00:00:00 2001 From: Janet Schneider Date: Mon, 7 Nov 2022 16:01:31 -0800 Subject: [PATCH] Move lock/unlock to HexagonHtp temporarily --- src/runtime/hexagon/hexagon_htp.cc | 12 ++++++++++-- src/runtime/hexagon/hexagon_thread_manager.cc | 10 ++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/runtime/hexagon/hexagon_htp.cc b/src/runtime/hexagon/hexagon_htp.cc index f6c1d2f01ffb..ac1b267902c7 100644 --- a/src/runtime/hexagon/hexagon_htp.cc +++ b/src/runtime/hexagon/hexagon_htp.cc @@ -35,9 +35,17 @@ namespace tvm { namespace runtime { namespace hexagon { -HexagonHtp::HexagonHtp() { Acquire(); } +HexagonHtp::HexagonHtp() { + Acquire(); + // TODO(HWE): Perform HTP lock/unlock in thread instead of HexagonHtp + Lock(); +} -HexagonHtp::~HexagonHtp() { Release(); } +HexagonHtp::~HexagonHtp() { + // TODO(HWE): Perform HTP lock/unlock in thread instead of HexagonHtp + Unlock(); + Release(); +} void HexagonHtp::Acquire() { compute_res_attr_t compute_res_attr; diff --git a/src/runtime/hexagon/hexagon_thread_manager.cc b/src/runtime/hexagon/hexagon_thread_manager.cc index 2fbc231e5781..3658611cf00d 100644 --- a/src/runtime/hexagon/hexagon_thread_manager.cc +++ b/src/runtime/hexagon/hexagon_thread_manager.cc @@ -325,8 +325,9 @@ void HexagonThreadManager::thread_exit(void* context) { tc->hvx->Unlock(); DLOG(INFO) << "Thread " << index << " unlocked an HVX instance"; } else if (resource_type == HTP_0) { - tc->htp->Unlock(); - DLOG(INFO) << "Thread " << index << " unlocked the HTP"; + // TODO(HWE): Perform HTP lock/unlock in thread instead of HexagonHtp + // tc->htp->Unlock(); + // DLOG(INFO) << "Thread " << index << " unlocked the HTP"; } DLOG(INFO) << "Thread " << index << " exiting"; @@ -346,8 +347,9 @@ void HexagonThreadManager::thread_main(void* context) { tc->hvx->Lock(); DLOG(INFO) << "Thread " << index << " locked an HVX instance"; } else if (resource_type == HTP_0) { - tc->htp->Lock(); - DLOG(INFO) << "Thread " << index << " locked the HTP"; + // TODO(HWE): Perform HTP lock/unlock in thread instead of HexagonHtp + // tc->htp->Lock(); + // DLOG(INFO) << "Thread " << index << " locked the HTP"; } while (true) { // loop, executing commands from pipe