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


##########
src/runtime/hexagon/hexagon_buffer_manager.h:
##########
@@ -85,6 +86,18 @@ class HexagonBufferManager {
     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() {

Review Comment:
   There's also another state not captured - the buffer manager is in an 
invalid state to allocate more memory.
   
   There needs to be two buffer managers, because on ReleaseResources how do we 
know which buffers need to be freed?
   
   I'm thinking that a better model is to enforce that all frees should take 
place before ReleaseResources.  That's cleaner.  I will investigate which ones 
are outstanding.  All objects should be cleanly torn down by the time the 
session ends.  I will file a task to investigate.



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