From 2f8c2b3d2df3bc98f0674669a39411e1308d257a Mon Sep 17 00:00:00 2001 From: Chen Lai Date: Wed, 4 Jun 2025 21:15:06 -0700 Subject: [PATCH] [2/N] Add update context For future needs without breacking API BC, in case we need to pass more information to the update API Differential Revision: [D75919212](https://our.internmc.facebook.com/intern/diff/D75919212/) [ghstack-poisoned] --- runtime/backend/backend_update_context.h | 34 ++++++++++++++++++++++++ runtime/backend/targets.bzl | 1 + 2 files changed, 35 insertions(+) create mode 100644 runtime/backend/backend_update_context.h diff --git a/runtime/backend/backend_update_context.h b/runtime/backend/backend_update_context.h new file mode 100644 index 00000000000..b0ba976213d --- /dev/null +++ b/runtime/backend/backend_update_context.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once +#include +#include +#include + +namespace executorch { +namespace ET_RUNTIME_NAMESPACE { +/** + * BackendUpdateContext will be used to inject runtime info for to initialize + * delegate. + */ +class BackendUpdateContext final { + public: + explicit BackendUpdateContext(){} +}; + +} // namespace ET_RUNTIME_NAMESPACE +} // namespace executorch + +namespace torch { +namespace executor { +// TODO(T197294990): Remove these deprecated aliases once all users have moved +// to the new `::executorch` namespaces. +using ::executorch::ET_RUNTIME_NAMESPACE::BackendUpdateContext; +} // namespace executor +} // namespace torch diff --git a/runtime/backend/targets.bzl b/runtime/backend/targets.bzl index 49a14d4d0d6..c72cf769813 100644 --- a/runtime/backend/targets.bzl +++ b/runtime/backend/targets.bzl @@ -17,6 +17,7 @@ def define_common_targets(): exported_headers = [ "backend_execution_context.h", "backend_init_context.h", + "backend_update_context.h", "backend_options.h", "interface.h", ],