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


##########
src/runtime/hexagon/hexagon_device_api.h:
##########
@@ -45,11 +45,27 @@ class HexagonDeviceAPI final : public DeviceAPI {
   static HexagonDeviceAPI* Global();
 
   //! \brief Constructor
-  HexagonDeviceAPI() {}
+  HexagonDeviceAPI() { hexbuffs = std::make_unique<HexagonBufferManager>(); }
 
   //! \brief Destructor
   ~HexagonDeviceAPI() {}
 
+  //! \brief Creates resource managers for the runtime
+  void AcquireResources() {
+    if (!hexbuffs->empty()) {
+      LOG(INFO) << "hexbuffs was not empty in AcquireResources";
+    }
+  }
+
+  //! \brief Ensures we have freed all resources when we end the runtime
+  void ReleaseResources() {
+    if (!hexbuffs->empty()) {
+      LOG(INFO) << "hexbuffs was not empty in ReleaseResources, resetting";
+      hexbuffs.reset();
+      hexbuffs = std::make_unique<HexagonBufferManager>();

Review Comment:
   reset() destroys the original object, and doesn't create a new one.
   
   I could change it to reset(new HexagonBufferManager)



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