Skip to content

Commit 8e49e01

Browse files
pytorchbotcccclai
andauthored
[2/N] Add option context (#11875)
This PR was created by the merge bot to help merge the original PR into the main branch. ghstack PR number: #11390 by @cccclai ^ Please use this as the source of truth for the PR details, comments, and reviews ghstack PR base: https://github.com/pytorch/executorch/tree/gh/cccclai/22/base ghstack PR head: https://github.com/pytorch/executorch/tree/gh/cccclai/22/head Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/cccclai/21/orig Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/cccclai/22/orig @diff-train-skip-merge --------- Co-authored-by: Chen Lai <[email protected]> Co-authored-by: cccclai <[email protected]>
1 parent 8f1ded2 commit 8e49e01

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
#pragma once
10+
#include <executorch/runtime/core/event_tracer.h>
11+
#include <executorch/runtime/core/memory_allocator.h>
12+
#include <executorch/runtime/core/named_data_map.h>
13+
14+
namespace executorch {
15+
namespace ET_RUNTIME_NAMESPACE {
16+
/**
17+
* BackendOptionContext will be used to inject runtime info for to initialize
18+
* delegate.
19+
*/
20+
class BackendOptionContext final {
21+
public:
22+
explicit BackendOptionContext() {}
23+
};
24+
25+
} // namespace ET_RUNTIME_NAMESPACE
26+
} // namespace executorch
27+
28+
namespace torch {
29+
namespace executor {
30+
// TODO(T197294990): Remove these deprecated aliases once all users have moved
31+
// to the new `::executorch` namespaces.
32+
using ::executorch::ET_RUNTIME_NAMESPACE::BackendOptionContext;
33+
} // namespace executor
34+
} // namespace torch

runtime/backend/targets.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def define_common_targets():
1717
exported_headers = [
1818
"backend_execution_context.h",
1919
"backend_init_context.h",
20+
"backend_option_context.h",
2021
"options.h",
2122
"interface.h",
2223
],

0 commit comments

Comments
 (0)