Skip to content

Commit dff7b68

Browse files
committed
[devtool] make datasink as a sepreate directory
Pull Request resolved: #8514 this diff make data_sink_base and its childrens as a seperate directory for better structure. ghstack-source-id: 268177711 Differential Revision: [D69732404](https://our.internmc.facebook.com/intern/diff/D69732404/)
1 parent 7480514 commit dff7b68

File tree

13 files changed

+85
-54
lines changed

13 files changed

+85
-54
lines changed

devtools/etdump/data_sinks/TARGETS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
load(":targets.bzl", "define_common_targets")
2+
3+
oncall("executorch")
4+
5+
define_common_targets()

devtools/etdump/buffer_data_sink.cpp renamed to devtools/etdump/data_sinks/buffer_data_sink.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
#include <executorch/devtools/etdump/buffer_data_sink.h>
9+
#include <executorch/devtools/etdump/data_sinks/buffer_data_sink.h>
1010
#include <executorch/devtools/etdump/utils.h>
1111

1212
using ::executorch::runtime::Error;

devtools/etdump/buffer_data_sink.h renamed to devtools/etdump/data_sinks/buffer_data_sink.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#pragma once
1010

11-
#include <executorch/devtools/etdump/data_sink_base.h>
11+
#include <executorch/devtools/etdump/data_sinks/data_sink_base.h>
1212
#include <executorch/runtime/core/exec_aten/exec_aten.h>
1313
#include <executorch/runtime/core/span.h>
1414

File renamed without changes.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
2+
3+
4+
def define_common_targets():
5+
"""Defines targets that should be shared between fbcode and xplat.
6+
7+
The directory containing this targets.bzl file should also contain both
8+
TARGETS and BUCK files that call this function.
9+
"""
10+
for aten_mode in (True, False):
11+
aten_suffix = "_aten" if aten_mode else ""
12+
13+
runtime.cxx_library(
14+
name = "data_sink_base" + aten_suffix,
15+
exported_headers = [
16+
"data_sink_base.h",
17+
],
18+
exported_deps = [
19+
"//executorch/runtime/core/exec_aten/util:scalar_type_util" + aten_suffix,
20+
],
21+
visibility = [
22+
"//executorch/...",
23+
"@EXECUTORCH_CLIENTS",
24+
],
25+
)
26+
27+
runtime.cxx_library(
28+
name = "buffer_data_sink" + aten_suffix,
29+
exported_headers = [
30+
"buffer_data_sink.h",
31+
],
32+
srcs = [
33+
"buffer_data_sink.cpp",
34+
],
35+
deps = [
36+
"//executorch/devtools/etdump:utils",
37+
],
38+
exported_deps = [
39+
"//executorch/runtime/core/exec_aten:lib" + aten_suffix,
40+
":data_sink_base" + aten_suffix,
41+
],
42+
visibility = [
43+
"//executorch/...",
44+
"@EXECUTORCH_CLIENTS",
45+
],
46+
)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
load(":targets.bzl", "define_common_targets")
2+
3+
oncall("executorch")
4+
5+
define_common_targets()

devtools/etdump/tests/buffer_data_sink_test.cpp renamed to devtools/etdump/data_sinks/tests/buffer_data_sink_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
#include <executorch/devtools/etdump/buffer_data_sink.h>
9+
#include <executorch/devtools/etdump/data_sinks/buffer_data_sink.h>
1010
#include <executorch/runtime/core/exec_aten/testing_util/tensor_factory.h>
1111
#include <executorch/runtime/core/span.h>
1212
#include <executorch/runtime/platform/runtime.h>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
2+
3+
def define_common_targets():
4+
"""Defines targets that should be shared between fbcode and xplat.
5+
6+
The directory containing this targets.bzl file should also contain both
7+
TARGETS and BUCK files that call this function.
8+
"""
9+
10+
11+
runtime.cxx_test(
12+
name = "buffer_data_sink_test",
13+
srcs = [
14+
"buffer_data_sink_test.cpp",
15+
],
16+
deps = [
17+
"//executorch/devtools/etdump/data_sinks:buffer_data_sink",
18+
"//executorch/runtime/core/exec_aten/testing_util:tensor_util",
19+
],
20+
)

devtools/etdump/etdump_flatcc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include <cstring>
1212

13-
#include <executorch/devtools/etdump/buffer_data_sink.h>
13+
#include <executorch/devtools/etdump/data_sinks/buffer_data_sink.h>
1414
#include <executorch/devtools/etdump/emitter.h>
1515
#include <executorch/devtools/etdump/etdump_schema_flatcc_builder.h>
1616
#include <executorch/devtools/etdump/etdump_schema_flatcc_reader.h>

devtools/etdump/etdump_flatcc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <cstdint>
1212
#include <memory>
1313

14-
#include <executorch/devtools/etdump/data_sink_base.h>
14+
#include <executorch/devtools/etdump/data_sinks/data_sink_base.h>
1515
#include <executorch/runtime/core/event_tracer.h>
1616
#include <executorch/runtime/core/span.h>
1717
#include <executorch/runtime/platform/platform.h>

0 commit comments

Comments
 (0)