adstraw commented on code in PR #13109:
URL: https://github.com/apache/tvm/pull/13109#discussion_r998434879


##########
src/runtime/hexagon/hexagon_buffer_manager.h:
##########
@@ -82,28 +87,35 @@ class HexagonBufferManager {
 
   //! \brief Returns whether the HexagonBufferManager has any allocations.
   bool empty() {
-    std::lock_guard<std::mutex> lock(map_mutex_);
+    std::lock_guard<std::mutex> lock(mutex_);
     return hexagon_buffer_map_.empty();
   }
 
-  //! \brief Returns a vector of currently allocated pointers, owned by the 
manager.
-  // Note - this should only be used by the device API to keep track of what
-  // was in the manager when HexagonDeviceAPI::ReleaseResources is called.
-  std::vector<void*> current_allocations() {
-    std::vector<void*> allocated;
-    std::lock_guard<std::mutex> lock(map_mutex_);
+  void Reset() {
+    std::lock_guard<std::mutex> lock(mutex_);
+    hexagon_buffer_map_.clear();
+    released_buffers_.clear();

Review Comment:
   Would like to hear thoughts from @janetsc.  My understanding was that once 
we call `AcquireResources` in the Hexagon Device API (step 4) which in turn 
calls this `Reset` method we want the any past free of buffers (step 5) to fail.



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