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


##########
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:
   Thanks @Lunderberg, I think your suggestion would satisfy my concern.  What 
do you think @janetsc?  This would allow us to make valid frees a `nop` and to 
catch invalid frees as well.  If I am understanding correctly 
`runtime_hexbuffs` would be instantiated by the Hexagon Device API in the same 
way that we instantiate the `rpc_hexbuffs` ... `HexagonBufferManager 
runtime_hexbuffs;`?  If that is the case, we could potentially have just one 
HeagonBufferManager that implements the API and internal state that @Lunderberg 
suggests.



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