Skip to content

Commit bd8fb10

Browse files
cccclaifacebook-github-bot
authored andcommitted
Add buck file for qnn executor runner and export script
Summary: As title, add more buck files Reviewed By: billmguo Differential Revision: D69276339
1 parent 70143a2 commit bd8fb10

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

examples/qualcomm/TARGETS

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")
55
load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary")
6+
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
7+
load("@fbsource//xplat/executorch/backends/qualcomm/qnn_version.bzl", "get_qnn_library_verision")
68

79
oncall("executorch")
810

@@ -22,6 +24,15 @@ python_binary(
2224
],
2325
)
2426

27+
runtime.command_alias(
28+
name = "export_example_qnn",
29+
env = {
30+
"LD_LIBRARY_PATH": "$(location fbsource//third-party/qualcomm/qnn/qnn-{0}:qnn_offline_compile_libs)".format(get_qnn_library_verision()),
31+
"QNN_SDK_ROOT": "$(location fbsource//third-party/qualcomm/qnn/qnn-{0}:__dir__)".format(get_qnn_library_verision()),
32+
},
33+
exe = ":export_example",
34+
)
35+
2536
python_library(
2637
name = "utils",
2738
srcs = ["utils.py"],
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Any targets that should be shared between fbcode and xplat must be defined in
2+
# targets.bzl. This file can contain xplat-only targets.
3+
4+
load(":targets.bzl", "define_common_targets")
5+
6+
oncall("executorch")
7+
8+
define_common_targets()
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
load(
2+
"@fbsource//tools/build_defs:default_platform_defs.bzl",
3+
"ANDROID",
4+
"APPLE",
5+
"CXX",
6+
"is_apple_platform",
7+
)
8+
load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode")
9+
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
10+
load("@fbsource//xplat/executorch/codegen:codegen.bzl", "executorch_generated_lib")
11+
load("@fbsource//xplat/executorch/extension/pybindings:pybindings.bzl", "MODELS_ATEN_OPS_ATEN_MODE_GENERATED_LIB", "MODELS_ATEN_OPS_LEAN_MODE_GENERATED_LIB")
12+
13+
def define_common_targets():
14+
"""Defines targets that should be shared between fbcode and xplat.
15+
16+
The directory containing this targets.bzl file should also contain both
17+
TARGETS and BUCK files that call this function.
18+
"""
19+
20+
runtime.cxx_binary(
21+
name = "qnn_executor_runner",
22+
srcs = ["qnn_executor_runner.cpp"],
23+
deps = [
24+
"//executorch/runtime/executor/test:test_backend_compiler_lib",
25+
"//executorch/runtime/executor/test:test_backend_with_delegate_mapping",
26+
"//executorch/runtime/executor:program",
27+
"//executorch/devtools/etdump:etdump_flatcc",
28+
"//executorch/devtools/bundled_program:runtime",
29+
"//executorch/extension/data_loader:buffer_data_loader",
30+
"//executorch/extension/data_loader:file_data_loader",
31+
"//executorch/extension/tensor:tensor",
32+
"//executorch/extension/runner_util:inputs",
33+
"//executorch/backends/qualcomm/runtime:runtime",
34+
],
35+
external_deps = [
36+
"gflags",
37+
],
38+
)

0 commit comments

Comments
 (0)