Skip to content

Split out :executor_runner_lib #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
33 changes: 25 additions & 8 deletions examples/executor_runner/targets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@ def define_common_targets():
TARGETS and BUCK files that call this function.
"""

# Wraps a commandline executable that can be linked against any desired
# kernel or backend implementations. Contains a main() function.
runtime.cxx_library(
name = "executor_runner_lib",
srcs = ["executor_runner.cpp"],
deps = [
"//executorch/runtime/executor:program",
"//executorch/extension/data_loader:file_data_loader",
"//executorch/util:util",
],
external_deps = [
"gflags",
],
define_static_target = True,
visibility = [
"//executorch/examples/...",
],
)

register_custom_op = native.read_config("executorch", "register_custom_op", "0")

if register_custom_op == "1":
Expand All @@ -16,20 +35,18 @@ def define_common_targets():
else:
custom_ops_lib = []

# Test driver for models, uses all portable kernels.
# Test driver for models, uses all portable kernels and a demo backend. This
# is intended to have minimal dependencies. If you want a runner that links
# against a different backend or kernel library, define a new executable
# based on :executor_runner_lib.
runtime.cxx_binary(
name = "executor_runner",
srcs = ["executor_runner.cpp"],
srcs = [],
deps = [
":executor_runner_lib",
"//executorch/runtime/executor/test:test_backend_compiler_lib",
"//executorch/runtime/executor:program",
"//executorch/extension/data_loader:file_data_loader",
"//executorch/util:util",
"//executorch/kernels/portable:generated_lib_all_ops",
] + custom_ops_lib,
external_deps = [
"gflags",
],
define_static_target = True,
**get_oss_build_kwargs()
)