Skip to content

Commit 345ac8b

Browse files
cccclaifacebook-github-bot
authored andcommitted
Add backend runtime context (#209)
Summary: Pull Request resolved: #209 Add backend runtime context. Items to be added there: - Event tracer - temp allocator The signature breaking change will be in D48872100 Reviewed By: tarun292 Differential Revision: D48872102 fbshipit-source-id: c3ddbd61e8006e8f0d95563501222ce5e4352b3b
1 parent 8219bcc commit 345ac8b

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
11+
namespace torch {
12+
namespace executor {
13+
14+
/**
15+
* BackendContext will be used to inject run time context.
16+
* The current plan is to add temp allocator and event tracer (for profiling) as
17+
* part of the runtime context.
18+
*/
19+
class BackendRuntimeContext final {};
20+
21+
} // namespace executor
22+
} // namespace torch

runtime/backend/targets.bzl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ def define_common_targets():
77
TARGETS and BUCK files that call this function.
88
"""
99

10+
runtime.cxx_library(
11+
name = "backend_runtime_context",
12+
exported_headers = [
13+
"backend_runtime_context.h",
14+
],
15+
visibility = [
16+
"//executorch/...",
17+
"@EXECUTORCH_CLIENTS",
18+
],
19+
)
20+
1021
for aten_mode in (True, False):
1122
aten_suffix = ("_aten" if aten_mode else "")
1223
runtime.cxx_library(
@@ -23,6 +34,7 @@ def define_common_targets():
2334
"@EXECUTORCH_CLIENTS",
2435
],
2536
exported_deps = [
37+
"//executorch/runtime/backend:backend_runtime_context",
2638
"//executorch/runtime/core:core",
2739
"//executorch/runtime/core:evalue" + aten_suffix,
2840
"//executorch/runtime/core:memory_allocator",

0 commit comments

Comments
 (0)