janetsc commented on code in PR #13181:
URL: https://github.com/apache/tvm/pull/13181#discussion_r1005022336
##########
src/runtime/hexagon/hexagon_hvx.cc:
##########
@@ -31,25 +31,30 @@ namespace tvm {
namespace runtime {
namespace hexagon {
-HexagonHvx::HexagonHvx() {
- // Reserve HVX.
- int res = qurt_hvx_reserve(QURT_HVX_RESERVE_ALL_AVAILABLE);
- CHECK((res != QURT_HVX_RESERVE_NOT_SUPPORTED) && (res !=
QURT_HVX_RESERVE_NOT_SUCCESSFUL))
- << "error reserving HVX: " << res;
+HexagonHvx::HexagonHvx() { Acquire(); }
- // Lock HVX.
+HexagonHvx::~HexagonHvx() { Release(); }
+
+void HexagonHvx::Acquire() {
+ reserved_count_ = qurt_hvx_reserve(QURT_HVX_RESERVE_ALL);
Review Comment:
No, the main thread constructs a HexagonHvx object, which calls
qurt_hvx_reserve. Each thread assigned to an HVX_x instance calls Lock();
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]