blob: bea1b2f97b8131064e6ad48e0cf1fdf3e000c897 [file] [log] [blame] [edit]
cc_library {
name: "libexecutorch_runtime",
srcs: [
"extension/data_loader/file_data_loader.cpp",
"extension/data_loader/mmap_data_loader.cpp",
"extension/evalue_util/print_evalue.cpp",
"extension/module/*.cpp",
"extension/runner_util/inputs.cpp",
"extension/runner_util/inputs_portable.cpp",
"extension/training/module/training_module.cpp",
"extension/training/optimizer/sgd.cpp",
"extension/tensor/*.cpp",
":executorch_portable_ops_gen_cpp",
"kernels/portable/cpu/*.cpp",
"kernels/portable/cpu/pattern/*.cpp",
"kernels/portable/cpu/util/*.cpp",
"kernels/prim_ops/et_copy_index.cpp",
"kernels/prim_ops/et_view.cpp",
"kernels/prim_ops/register_prim_ops.cpp",
"runtime/backend/interface.cpp",
"runtime/core/evalue.cpp",
"runtime/core/exec_aten/util/tensor_util_portable.cpp",
"runtime/core/portable_type/tensor_impl.cpp",
"runtime/executor/method.cpp",
"runtime/executor/method_meta.cpp",
"runtime/executor/program.cpp",
"runtime/executor/tensor_parser_exec_aten.cpp",
"runtime/executor/tensor_parser_portable.cpp",
"runtime/kernel/operator_registry.cpp",
"runtime/platform/abort.cpp",
"runtime/platform/default/posix.cpp",
"runtime/platform/log.cpp",
"runtime/platform/profiler.cpp",
"runtime/platform/runtime.cpp",
"schema/extended_header.cpp",
],
header_libs: [
"flatbuffer_headers",
],
generated_headers: [
"executorch_fbs_gen",
"executorch_portable_ops_gen_h",
],
stl: "libc++_static",
cflags: [
"-Wno-unused-parameter",
],
host_supported: true,
apex_available: ["com.android.ondevicepersonalization"],
sdk_version: "current",
min_sdk_version: "apex_inherit",
visibility: ["//packages/modules/OnDevicePersonalization:__subpackages__"],
}
cc_binary {
name: "executor_runner",
srcs: ["examples/portable/executor_runner/executor_runner.cpp"],
static_libs: [
"libgflags",
],
whole_static_libs: [
"libexecutorch_runtime",
],
host_supported: true,
}
cc_binary {
name: "train_runner",
srcs: ["extension/training/examples/XOR/train.cpp"],
static_libs: [
"libgflags",
],
whole_static_libs: [
"libexecutorch_runtime",
],
host_supported: true,
}
cc_genrule {
name: "executorch_fbs_gen",
host_supported: true,
tools: ["flatc"],
srcs: [
"schema/program.fbs",
"schema/scalar_type.fbs",
],
out: [
"executorch/schema/program_generated.h",
"executorch/schema/scalar_type_generated.h",
],
sdk_version: "current",
apex_available: ["com.android.ondevicepersonalization"],
cmd: "$(location flatc) --cpp --cpp-std c++11 --gen-mutable --scoped-enums --include-prefix executorch/schema/ " +
"-o $(genDir)/executorch/schema/ $(in)",
}
filegroup {
name: "executorch_codegen_templates",
srcs: [
"codegen/templates/*.cpp",
"codegen/templates/*.h",
"codegen/templates/*.ini",
],
}
filegroup {
name: "executorch_portable_yaml",
srcs: [
"kernels/portable/functions.yaml",
],
}
cc_genrule {
name: "executorch_portable_ops_gen_cpp",
host_supported: true,
tools: ["torchgen_executorch"],
tool_files: [
":executorch_codegen_templates",
":executorch_portable_yaml",
":torchgen_native_functions",
":torchgen_tags",
],
out: [
"RegisterCodegenUnboxedKernels_0.cpp",
],
sdk_version: "current",
apex_available: ["com.android.ondevicepersonalization"],
cmd: "mkdir templates; cp $(locations :executorch_codegen_templates) templates;" +
"$(location torchgen_executorch) " +
"--source-path=. " +
"--tags-path=$(location :torchgen_tags) " +
"--aten_yaml_path=$(location :torchgen_native_functions) " +
"--functions_yaml_path=$(location :executorch_portable_yaml) " +
"--install_dir=$(genDir)/",
}
cc_genrule {
name: "executorch_portable_ops_gen_h",
host_supported: true,
tools: ["torchgen_executorch"],
tool_files: [
":executorch_codegen_templates",
":executorch_portable_yaml",
":torchgen_native_functions",
":torchgen_tags",
],
out: [
"NativeFunctions.h",
],
sdk_version: "current",
apex_available: ["com.android.ondevicepersonalization"],
cmd: "mkdir templates; cp $(locations :executorch_codegen_templates) templates;" +
"$(location torchgen_executorch) " +
"--source-path=. " +
"--tags-path=$(location :torchgen_tags) " +
"--aten_yaml_path=$(location :torchgen_native_functions) " +
"--functions_yaml_path=$(location :executorch_portable_yaml) " +
"--install_dir=$(genDir)/",
}
java_library_static {
name: "executorch_java",
sdk_version: "current",
min_sdk_version: "33",
srcs: [
"extension/android/src/main/java/org/pytorch/executorch/annotations/*.java",
"extension/android/src/main/java/org/pytorch/executorch/*.java",
"java/com/facebook/soloader/nativeloader/*.java",
],
apex_available: [
"com.android.ondevicepersonalization",
],
static_libs: [
"libfbjni_java",
],
visibility: [
"//packages/modules/OnDevicePersonalization:__subpackages__",
],
}
cc_library_shared {
name: "libexecutorch",
srcs: [
"extension/android/jni/jni_layer.cpp",
"extension/android/jni/log.cpp",
],
header_libs: [
"jni_headers",
],
whole_static_libs: [
"libexecutorch_runtime",
],
static_libs: [
"libfbjni",
],
shared_libs: [
"liblog",
],
stl: "libc++_static",
apex_available: ["com.android.ondevicepersonalization"],
sdk_version: "current",
min_sdk_version: "apex_inherit",
visibility: [
"//packages/modules/OnDevicePersonalization:__subpackages__",
],
cflags: [
"-fexceptions",
],
}