From b2a5472997ae9d366bdf6689caf2ea9526854ebb Mon Sep 17 00:00:00 2001 From: Nupur Garg Date: Wed, 18 Mar 2020 13:36:10 -0700 Subject: [PATCH] Creates `framework_lib` target. PiperOrigin-RevId: 301656623 Change-Id: Ied2158a67bfb0fa29753d201610d2967f57d3504 --- tensorflow/lite/BUILD | 66 ++++++++++++++++++++++++++--------- tensorflow/lite/kernels/BUILD | 4 +-- 2 files changed, 52 insertions(+), 18 deletions(-) diff --git a/tensorflow/lite/BUILD b/tensorflow/lite/BUILD index 5e22b1fed5c..9c4740b8c0a 100644 --- a/tensorflow/lite/BUILD +++ b/tensorflow/lite/BUILD @@ -62,6 +62,22 @@ TFLITE_DEFAULT_COPTS = if_not_windows([ "-Wno-extern-c-compat", ]) +FRAMEWORK_LIB_HDRS = [ + "allocation.h", + "context.h", + "context_util.h", + "core/macros.h", + "core/subgraph.h", + "error_reporter.h", + "graph_info.h", + "interpreter.h", + "model.h", + "mutable_op_resolver.h", + "op_resolver.h", + "optional_debug_tools.h", + "stderr_reporter.h", +] + cc_library( name = "version", hdrs = ["version.h"], @@ -200,9 +216,8 @@ cc_library( ], ) -# TODO(ahentz): investigate dependency on gemm_support requiring usage of tf_copts. cc_library( - name = "framework", + name = "framework_lib", srcs = [ "core/subgraph.cc", "graph_info.cc", @@ -212,23 +227,42 @@ cc_library( "optional_debug_tools.cc", "stderr_reporter.cc", ], - hdrs = [ - "allocation.h", - "context.h", - "context_util.h", - "core/macros.h", - "core/subgraph.h", - "error_reporter.h", - "graph_info.h", - "interpreter.h", - "model.h", - "mutable_op_resolver.h", - "op_resolver.h", - "optional_debug_tools.h", - "stderr_reporter.h", + hdrs = FRAMEWORK_LIB_HDRS, + copts = tflite_copts() + TFLITE_DEFAULT_COPTS, + visibility = [ + "//tensorflow/lite:__subpackages__", ], + deps = [ + ":allocation", + ":arena_planner", + ":external_cpu_backend_context", + ":graph_info", + ":memory_planner", + ":minimal_logging", + ":simple_memory_arena", + ":string", + ":type_to_tflitetype", + ":util", + ":version", + "//tensorflow/lite/c:common", + "//tensorflow/lite/core/api", + "//tensorflow/lite/delegates/nnapi:nnapi_delegate", + "//tensorflow/lite/experimental/resource", + "//tensorflow/lite/nnapi:nnapi_implementation", + "//tensorflow/lite/schema:schema_fbs", + ], + alwayslink = 1, +) + +# TODO(ahentz): investigate dependency on gemm_support requiring usage of tf_copts. +cc_library( + name = "framework", + srcs = [ + ], + hdrs = FRAMEWORK_LIB_HDRS, copts = tflite_copts() + TFLITE_DEFAULT_COPTS, deps = [ + ":framework_lib", ":allocation", ":arena_planner", ":external_cpu_backend_context", diff --git a/tensorflow/lite/kernels/BUILD b/tensorflow/lite/kernels/BUILD index 57e9b876ec1..1f04cc3ee47 100644 --- a/tensorflow/lite/kernels/BUILD +++ b/tensorflow/lite/kernels/BUILD @@ -526,7 +526,7 @@ cc_library( ":lstm_shared", ":op_macros", ":padding", - "//tensorflow/lite:framework", + "//tensorflow/lite:framework_lib", "//tensorflow/lite:minimal_logging", "//tensorflow/lite:string_util", "//tensorflow/lite/c:common", @@ -660,7 +660,7 @@ cc_library( ], deps = [ ":builtin_op_kernels", - "//tensorflow/lite:framework", + "//tensorflow/lite:framework_lib", "//tensorflow/lite/c:common", ], )