You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by tq...@apache.org on 2023/02/24 13:25:22 UTC

[tvm] branch main updated: [Runtime] Fix Potential DeviceAPIManager Memory Bug (#14114)

This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 265bebf65f [Runtime] Fix Potential DeviceAPIManager Memory Bug (#14114)
265bebf65f is described below

commit 265bebf65fb449628e0854da398c4ee09e40e886
Author: Qiang Zhang <jo...@163.com>
AuthorDate: Fri Feb 24 21:25:16 2023 +0800

    [Runtime] Fix Potential DeviceAPIManager Memory Bug (#14114)
---
 python/tvm/relay/function.py | 1 -
 src/runtime/c_runtime_api.cc | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/python/tvm/relay/function.py b/python/tvm/relay/function.py
index dc0636a9b3..54adb45d8c 100644
--- a/python/tvm/relay/function.py
+++ b/python/tvm/relay/function.py
@@ -98,7 +98,6 @@ class Function(BaseFunc):
         return astext(self, show_meta_data, annotate)
 
 
-@tvm._ffi.register_func("relay.FunctionWithFields")
 def FunctionWithFields(
     function,
     params=None,
diff --git a/src/runtime/c_runtime_api.cc b/src/runtime/c_runtime_api.cc
index 744cc799a5..0132e9009c 100644
--- a/src/runtime/c_runtime_api.cc
+++ b/src/runtime/c_runtime_api.cc
@@ -90,7 +90,7 @@ uint8_t ParseCustomDatatype(const std::string& s, const char** scan) {
 
 class DeviceAPIManager {
  public:
-  static const int kMaxDeviceAPI = 32;
+  static const int kMaxDeviceAPI = TVMDeviceExtType_End;
   // Get API
   static DeviceAPI* Get(const Device& dev) { return Get(dev.device_type); }
   static DeviceAPI* Get(int dev_type, bool allow_missing = false) {