From b3eb4f89d7e6a4f932ead18bff7bdb98487096dc Mon Sep 17 00:00:00 2001 From: Ruihang Lai Date: Thu, 6 Apr 2023 19:50:05 -0400 Subject: [PATCH] [Runtime] Runtime module property mask for Metal and Vulkan 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 | 6 ++++++ src/runtime/vulkan/vulkan_wrapped_func.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/runtime/metal/metal_module.mm b/src/runtime/metal/metal_module.mm index 1e81ac1bbb34a..f75896648e55b 100644 --- a/src/runtime/metal/metal_module.mm +++ b/src/runtime/metal/metal_module.mm @@ -49,6 +49,12 @@ 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 cd4774bf0f5af..187736e82a6d8 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,