janetsc commented on code in PR #13181:
URL: https://github.com/apache/tvm/pull/13181#discussion_r1003478049


##########
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:
   This explicitly reserves all of the HVX units.  Depending on schedules, we 
may want to request fewer HVX units so a future change could include requesting 
only the number of HVX instances needed.  Thoughts on this approach?



-- 
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]

Reply via email to