Skip to content

Commit 51cef8c

Browse files
committed
Android.bp initial commit
1 parent 4b6a033 commit 51cef8c

File tree

1 file changed

+139
-0
lines changed

1 file changed

+139
-0
lines changed

Android.bp

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
cc_library {
2+
name: "libexecutorch",
3+
srcs: [
4+
"extension/data_loader/file_data_loader.cpp",
5+
"extension/data_loader/mmap_data_loader.cpp",
6+
"extension/evalue_util/print_evalue.cpp",
7+
"extension/runner_util/inputs.cpp",
8+
"extension/runner_util/inputs_portable.cpp",
9+
10+
":executorch_portable_ops_gen_cpp",
11+
12+
"kernels/portable/cpu/*.cpp",
13+
"kernels/portable/cpu/pattern/*.cpp",
14+
"kernels/portable/cpu/util/*.cpp",
15+
16+
"kernels/prim_ops/et_copy_index.cpp",
17+
"kernels/prim_ops/et_view.cpp",
18+
"kernels/prim_ops/register_prim_ops.cpp",
19+
20+
"runtime/backend/interface.cpp",
21+
"runtime/core/evalue.cpp",
22+
"runtime/core/exec_aten/util/tensor_util_portable.cpp",
23+
"runtime/core/portable_type/tensor_impl.cpp",
24+
"runtime/executor/method.cpp",
25+
"runtime/executor/method_meta.cpp",
26+
"runtime/executor/program.cpp",
27+
"runtime/executor/tensor_parser_exec_aten.cpp",
28+
"runtime/executor/tensor_parser_portable.cpp",
29+
"runtime/kernel/operator_registry.cpp",
30+
"runtime/platform/abort.cpp",
31+
"runtime/platform/default/posix.cpp",
32+
"runtime/platform/log.cpp",
33+
"runtime/platform/profiler.cpp",
34+
"runtime/platform/runtime.cpp",
35+
36+
"schema/extended_header.cpp",
37+
],
38+
include_dirs: ["external/pytorch"],
39+
header_libs: [
40+
"flatbuffer_headers",
41+
],
42+
generated_headers: [
43+
"executorch_fbs_gen",
44+
"executorch_portable_ops_gen_h",
45+
],
46+
cflags: [
47+
"-Wno-unused-parameter",
48+
],
49+
host_supported: true,
50+
}
51+
52+
cc_binary {
53+
name: "executor_runner",
54+
srcs: ["examples/portable/executor_runner/executor_runner.cpp"],
55+
static_libs: [
56+
"libgflags",
57+
],
58+
whole_static_libs: [
59+
"libexecutorch",
60+
],
61+
include_dirs: ["external/pytorch"],
62+
host_supported: true,
63+
}
64+
65+
cc_genrule {
66+
name: "executorch_fbs_gen",
67+
host_supported: true,
68+
tools: ["flatc"],
69+
srcs: [
70+
"schema/program.fbs",
71+
"schema/scalar_type.fbs"
72+
],
73+
out: [
74+
"executorch/schema/program_generated.h",
75+
"executorch/schema/scalar_type_generated.h"
76+
],
77+
cmd: "$(location flatc) --cpp --cpp-std c++11 --gen-mutable --scoped-enums --include-prefix executorch/schema/ " +
78+
"-o $(genDir)/executorch/schema/ $(in)"
79+
}
80+
81+
filegroup {
82+
name: "executorch_codegen_templates",
83+
srcs: [
84+
"codegen/templates/*.cpp",
85+
"codegen/templates/*.h",
86+
"codegen/templates/*.ini",
87+
],
88+
}
89+
90+
filegroup {
91+
name: "executorch_portable_yaml",
92+
srcs: [
93+
"kernels/portable/functions.yaml",
94+
],
95+
}
96+
97+
cc_genrule {
98+
name: "executorch_portable_ops_gen_cpp",
99+
host_supported: true,
100+
tools: ["torchgen_executorch"],
101+
tool_files: [
102+
":executorch_codegen_templates",
103+
":executorch_portable_yaml",
104+
":torchgen_native_functions",
105+
":torchgen_tags",
106+
],
107+
out: [
108+
"RegisterCodegenUnboxedKernels_0.cpp",
109+
],
110+
cmd: "mkdir templates; cp $(locations :executorch_codegen_templates) templates;" +
111+
"$(location torchgen_executorch) " +
112+
"--source-path=. " +
113+
"--tags-path=$(location :torchgen_tags) " +
114+
"--aten_yaml_path=$(location :torchgen_native_functions) " +
115+
"--functions_yaml_path=$(location :executorch_portable_yaml) " +
116+
"--install_dir=$(genDir)/"
117+
}
118+
119+
cc_genrule {
120+
name: "executorch_portable_ops_gen_h",
121+
host_supported: true,
122+
tools: ["torchgen_executorch"],
123+
tool_files: [
124+
":executorch_codegen_templates",
125+
":executorch_portable_yaml",
126+
":torchgen_native_functions",
127+
":torchgen_tags",
128+
],
129+
out: [
130+
"NativeFunctions.h",
131+
],
132+
cmd: "mkdir templates; cp $(locations :executorch_codegen_templates) templates;" +
133+
"$(location torchgen_executorch) " +
134+
"--source-path=. " +
135+
"--tags-path=$(location :torchgen_tags) " +
136+
"--aten_yaml_path=$(location :torchgen_native_functions) " +
137+
"--functions_yaml_path=$(location :executorch_portable_yaml) " +
138+
"--install_dir=$(genDir)/"
139+
}

0 commit comments

Comments
 (0)