Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/runtime/hexagon/hexagon_htp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 6 additions & 4 deletions src/runtime/hexagon/hexagon_thread_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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
Expand Down