From c010d29a93dbe95b9acd69e55821be5aa4815059 Mon Sep 17 00:00:00 2001 From: Ruihang Lai Date: Sun, 9 Apr 2023 08:20:56 -0400 Subject: [PATCH] [Cherry-Pick][Runtime] Runtime module property mask for Metal and Vulkan (apache/tvm#14524) (#180) Following #14406, this PR adds the runtime module property mask for Metal and Vulkan backend, which were left before. --- src/runtime/metal/metal_module.mm | 5 +++++ src/runtime/vulkan/vulkan_wrapped_func.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/runtime/metal/metal_module.mm b/src/runtime/metal/metal_module.mm index a89ef8b5ef..52c9e2608a 100644 --- a/src/runtime/metal/metal_module.mm +++ b/src/runtime/metal/metal_module.mm @@ -49,6 +49,11 @@ explicit MetalModuleNode(std::string data, std::string fmt, } const char* type_key() const final { return "metal"; } + /*! \brief Get the property of the runtime module. */ + int GetPropertyMask() const final { + return ModulePropertyMask::kBinarySerializable | ModulePropertyMask::kRunnable; + } + PackedFunc GetFunction(const std::string& name, const ObjectPtr& sptr_to_self) final; void SaveToFile(const std::string& file_name, const std::string& format) final { diff --git a/src/runtime/vulkan/vulkan_wrapped_func.h b/src/runtime/vulkan/vulkan_wrapped_func.h index cd4774bf0f..187736e82a 100644 --- a/src/runtime/vulkan/vulkan_wrapped_func.h +++ b/src/runtime/vulkan/vulkan_wrapped_func.h @@ -89,6 +89,11 @@ class VulkanModuleNode final : public runtime::ModuleNode { const char* type_key() const final { return "vulkan"; } + /*! \brief Get the property of the runtime module. */ + int GetPropertyMask() const final { + return ModulePropertyMask::kBinarySerializable | ModulePropertyMask::kRunnable; + } + PackedFunc GetFunction(const std::string& name, const ObjectPtr& sptr_to_self) final; std::shared_ptr GetPipeline(size_t device_id, const std::string& func_name,