# Any targets that should be shared between fbcode and xplat must be defined in # targets.bzl. This file can contain fbcode-only targets. load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") # TODO: this is a placeholder to support internal fbcode build. We should add the coreml backend target properly. runtime.python_library( name = "coreml", visibility = [ "@EXECUTORCH_CLIENTS", ], ) runtime.python_library( name = "backend", srcs = glob([ "compiler/*.py", ]), visibility = [ "@EXECUTORCH_CLIENTS", ], deps = [ "fbsource//third-party/pypi/coremltools:coremltools", ":executorchcoreml", "//executorch/exir/backend:backend_details", "//executorch/exir/backend:compile_spec_schema", ], ) runtime.python_library( name = "partitioner", srcs = glob([ "partition/*.py", ]), visibility = [ "@EXECUTORCH_CLIENTS", ], deps = [ "fbsource//third-party/pypi/coremltools:coremltools", ":backend", "//caffe2:torch", "//executorch/exir:lib", "//executorch/exir/backend:compile_spec_schema", "//executorch/exir/backend:partitioner", "//executorch/exir/backend:utils", ], ) runtime.python_library( name = "quantizer", srcs = glob([ "quantizer/*.py", ]), visibility = [ "@EXECUTORCH_CLIENTS", ], ) runtime.cxx_python_extension( name = "executorchcoreml", srcs = [ "runtime/inmemoryfs/inmemory_filesystem.cpp", "runtime/inmemoryfs/inmemory_filesystem_py.cpp", "runtime/inmemoryfs/inmemory_filesystem_utils.cpp", "runtime/inmemoryfs/memory_buffer.cpp", "runtime/inmemoryfs/memory_stream.cpp", "runtime/inmemoryfs/reversed_memory_stream.cpp", "runtime/util/json_util.cpp", ], headers = glob([ "runtime/inmemoryfs/**/*.hpp", ]), base_module = "executorch.backends.apple.coreml", compiler_flags = [ "-std=c++17", ], preprocessor_flags = [ "-Iexecutorch/backends/apple/coreml/runtime/util", ], types = [ "executorchcoreml.pyi", ], visibility = [ "//executorch/examples/apple/coreml/...", "@EXECUTORCH_CLIENTS", ], deps = [ "fbsource//third-party/nlohmann-json:nlohmann-json", "fbsource//third-party/pybind11:pybind11", ], ) runtime.python_test( name = "test", srcs = glob([ "test/*.py", ]), deps = [ "fbsource//third-party/pypi/pytest:pytest", ":partitioner", ":quantizer", "//caffe2:torch", "//pytorch/vision:torchvision", ], )