You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/04/06 15:45:53 UTC

[GitHub] [tvm] csullivan commented on a diff in pull request #10910: [Hexagon] Refactor to keep HexagonBuffer private to the device api

csullivan commented on code in PR #10910:
URL: https://github.com/apache/tvm/pull/10910#discussion_r844106727


##########
src/runtime/hexagon/hexagon/hexagon_device_api_v2.h:
##########
@@ -125,8 +126,23 @@ class HexagonDeviceAPIv2 final : public DeviceAPI {
                       TVMStreamHandle stream) final;
 
  private:
-  //! Lookup table for the HexagonBuffer managing a workspace allocation.
-  std::unordered_map<void*, HexagonBuffer*> workspace_allocations_;
+  /*! \brief Helper to allocate a HexagonBuffer and register the result
+   *  in the owned buffer map.
+   *  \return Raw data storage managed by the hexagon buffer
+   */
+  template <typename... Args>
+  void* AllocateHexagonBuffer(Args&&... args) {
+    auto buf = std::unique_ptr<HexagonBuffer>(new HexagonBuffer(std::forward<Args>(args)...));

Review Comment:
   Alas my configuration for hexagon was giving false negatives on finding std::make_unique in the std. I had intended to circle back on this one before pushing but forgot, so thank you for the reminder!



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org