Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions examples/qualcomm/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

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

oncall("executorch")

Expand All @@ -22,6 +24,15 @@ python_binary(
],
)

runtime.command_alias(
name = "export_example_qnn",
env = {
"LD_LIBRARY_PATH": "$(location fbsource//third-party/qualcomm/qnn/qnn-{0}:qnn_offline_compile_libs)".format(get_qnn_library_verision()),
"QNN_SDK_ROOT": "$(location fbsource//third-party/qualcomm/qnn/qnn-{0}:__dir__)".format(get_qnn_library_verision()),
},
exe = ":export_example",
)

python_library(
name = "utils",
srcs = ["utils.py"],
Expand Down
8 changes: 8 additions & 0 deletions examples/qualcomm/executor_runner/TARGETS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Any targets that should be shared between fbcode and xplat must be defined in
# targets.bzl. This file can contain xplat-only targets.

load(":targets.bzl", "define_common_targets")

oncall("executorch")

define_common_targets()
38 changes: 38 additions & 0 deletions examples/qualcomm/executor_runner/targets.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
load(
"@fbsource//tools/build_defs:default_platform_defs.bzl",
"ANDROID",
"APPLE",
"CXX",
"is_apple_platform",
)
load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
load("@fbsource//xplat/executorch/codegen:codegen.bzl", "executorch_generated_lib")
load("@fbsource//xplat/executorch/extension/pybindings:pybindings.bzl", "MODELS_ATEN_OPS_ATEN_MODE_GENERATED_LIB", "MODELS_ATEN_OPS_LEAN_MODE_GENERATED_LIB")

def define_common_targets():
"""Defines targets that should be shared between fbcode and xplat.

The directory containing this targets.bzl file should also contain both
TARGETS and BUCK files that call this function.
"""

runtime.cxx_binary(
name = "qnn_executor_runner",
srcs = ["qnn_executor_runner.cpp"],
deps = [
"//executorch/runtime/executor/test:test_backend_compiler_lib",
"//executorch/runtime/executor/test:test_backend_with_delegate_mapping",
"//executorch/runtime/executor:program",
"//executorch/devtools/etdump:etdump_flatcc",
"//executorch/devtools/bundled_program:runtime",
"//executorch/extension/data_loader:buffer_data_loader",
"//executorch/extension/data_loader:file_data_loader",
"//executorch/extension/tensor:tensor",
"//executorch/extension/runner_util:inputs",
"//executorch/backends/qualcomm/runtime:runtime",
],
external_deps = [
"gflags",
],
)
Loading