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


##########
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:
   Piggybacking of @Lunderberg's example, this means that we will fail in `step 
4` if we have not de-allocated X prior.



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