Changes excluded by Copybara

PiperOrigin-RevId: 328408665
Change-Id: I86fb74f6eac377afeca2b65df067352dc17e0168
This commit is contained in:
A. Unique TensorFlower 2020-08-25 14:51:27 -07:00 committed by TensorFlower Gardener
parent 9c974ca45d
commit f5cb94eae2
14 changed files with 68 additions and 1 deletions

View File

@ -17,6 +17,7 @@ load(
"tf_kernel_library",
)
load("//tensorflow:tensorflow.bzl", "tf_version_info_genrule")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
load(
"//third_party/mkl:build_defs.bzl",
"mkl_deps",
@ -364,6 +365,7 @@ filegroup(
tf_version_info_genrule(
name = "version_info_gen",
out = "version_info.cc",
compatible_with = get_compatible_with_portable(),
)
cc_library(
@ -507,6 +509,7 @@ cc_library(
name = "version_info",
srcs = ["version_info.cc"],
hdrs = ["//tensorflow/core/public:version.h"],
compatible_with = get_compatible_with_portable(),
copts = tf_copts(),
alwayslink = if_static(0, 1),
)

View File

@ -1,6 +1,7 @@
load("//tensorflow:tensorflow.bzl", "if_not_windows", "tf_cc_test")
load("//tensorflow/lite:build_def.bzl", "if_tflite_experimental_runtime", "tflite_cc_shared_object", "tflite_copts", "tflite_experimental_runtime_linkopts")
load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package(
default_visibility = ["//visibility:public"],
@ -90,6 +91,7 @@ FRAMEWORK_LIB_HDRS = [
cc_library(
name = "version",
hdrs = ["version.h"],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS,
# Note that we only use the header defines from :version_lib.
deps = ["//tensorflow/core:version_lib"],
@ -107,6 +109,7 @@ cc_library(
name = "arena_planner",
srcs = ["arena_planner.cc"],
hdrs = ["arena_planner.h"],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS,
deps = [
":graph_info",
@ -145,6 +148,7 @@ cc_library(
name = "external_cpu_backend_context",
srcs = ["external_cpu_backend_context.cc"],
hdrs = ["external_cpu_backend_context.h"],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS,
deps = [
"//tensorflow/lite/c:common",
@ -154,6 +158,7 @@ cc_library(
cc_library(
name = "graph_info",
hdrs = ["graph_info.h"],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS,
deps = ["//tensorflow/lite/c:common"],
)
@ -161,6 +166,7 @@ cc_library(
cc_library(
name = "memory_planner",
hdrs = ["memory_planner.h"],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS,
deps = ["//tensorflow/lite/c:common"],
)
@ -169,6 +175,7 @@ cc_library(
name = "simple_memory_arena",
srcs = ["simple_memory_arena.cc"],
hdrs = ["simple_memory_arena.h"],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS,
deps = ["//tensorflow/lite/c:common"],
)
@ -188,6 +195,7 @@ cc_library(
"builtin_ops.h",
"context_util.h",
],
compatible_with = get_compatible_with_portable(),
deps = ["//tensorflow/lite/c:common"],
)
@ -198,6 +206,7 @@ cc_library(
hdrs = [
"string_type.h",
],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS,
)
@ -219,6 +228,7 @@ cc_library(
hdrs = [
"allocation.h",
],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS,
deps = [
":string",
@ -240,6 +250,7 @@ cc_library(
"stderr_reporter.cc",
],
hdrs = FRAMEWORK_LIB_HDRS,
compatible_with = get_compatible_with_portable(),
copts = tflite_copts() + TFLITE_DEFAULT_COPTS,
visibility = [
"//tensorflow/lite:__subpackages__",
@ -280,6 +291,7 @@ cc_library(
srcs = [
],
hdrs = FRAMEWORK_LIB_HDRS,
compatible_with = get_compatible_with_portable(),
copts = tflite_copts() + TFLITE_DEFAULT_COPTS,
defines = if_tflite_experimental_runtime(
if_eager = ["TFLITE_EXPERIMENTAL_RUNTIME_EAGER"],
@ -312,6 +324,7 @@ cc_library(
name = "string_util",
srcs = ["string_util.cc"],
hdrs = ["string_util.h"],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS,
deps = [
":string",
@ -356,6 +369,7 @@ cc_library(
cc_library(
name = "tflite_with_xnnpack_default",
compatible_with = get_compatible_with_portable(),
visibility = ["//visibility:private"],
# TODO(b/151246885): put ":tflite_with_xnnpack_enabled" to macos/windows
# once we have a good testing coverage on these two platforms.
@ -373,6 +387,7 @@ cc_library(
"core/macros.h",
"tflite_with_xnnpack_optional.h",
],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts() + TFLITE_DEFAULT_COPTS,
deps = [
"//tensorflow/lite/c:common",
@ -568,6 +583,7 @@ cc_library(
name = "util",
srcs = ["util.cc"],
hdrs = ["util.h"],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS + tflite_copts(),
deps = [
":kernel_api",
@ -611,6 +627,7 @@ cc_library(
],
}),
hdrs = ["minimal_logging.h"],
compatible_with = get_compatible_with_portable(),
copts = TFLITE_DEFAULT_COPTS + tflite_copts(),
linkopts = select({
"//tensorflow:android": ["-llog"],
@ -631,6 +648,7 @@ cc_library(
"type_to_tflitetype.h",
],
}),
compatible_with = get_compatible_with_portable(),
deps = ["//tensorflow/lite/c:common"],
)
@ -660,6 +678,7 @@ cc_test(
cc_library(
name = "shared_library",
hdrs = ["shared_library.h"],
compatible_with = get_compatible_with_portable(),
linkopts = if_not_windows(["-ldl"]),
)

View File

@ -3,6 +3,7 @@ load(
"tflite_cc_shared_object",
"tflite_copts",
)
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package(
default_visibility = ["//visibility:public"],
@ -123,6 +124,7 @@ cc_library(
"builtin_op_data.h",
"common.h",
],
compatible_with = get_compatible_with_portable(),
alwayslink = 1,
)

View File

@ -1,5 +1,6 @@
load("//tensorflow/lite:build_def.bzl", "tflite_copts")
load("//tensorflow/lite/micro:build_def.bzl", "micro_copts")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package(
default_visibility = ["//visibility:public"],
@ -21,6 +22,7 @@ cc_library(
"profiler.h",
"tensor_utils.h",
],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts() + micro_copts(),
deps = [
"@flatbuffers//:runtime_cc",

View File

@ -14,6 +14,7 @@
# ==============================================================================
load("//tensorflow/lite:build_def.bzl", "tflite_copts", "tflite_linkopts")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package(
default_visibility = ["//visibility:public"],
@ -23,6 +24,7 @@ package(
cc_library(
name = "status",
hdrs = ["status.h"],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts(),
deps = [
"//tensorflow/lite/c:common",
@ -33,6 +35,7 @@ cc_library(
name = "utils",
srcs = ["utils.cc"],
hdrs = ["utils.h"],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts(),
deps = [
"//tensorflow/lite:kernel_api",

View File

@ -1,4 +1,5 @@
load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package(
default_visibility = [
@ -26,6 +27,7 @@ cc_library(
"nnapi_delegate.h",
"nnapi_delegate_kernel.h",
],
compatible_with = get_compatible_with_portable(),
deps = [
"//tensorflow/lite:allocation",
"//tensorflow/lite:kernel_api",

View File

@ -1,4 +1,5 @@
load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite_combined")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package(
default_visibility = ["//visibility:public"],
@ -38,6 +39,7 @@ cc_library(
cc_library(
name = "xnnpack_delegate_hdrs_only",
hdrs = ["xnnpack_delegate.h"],
compatible_with = get_compatible_with_portable(),
visibility = ["//tensorflow/lite:__subpackages__"],
deps = [
"//tensorflow/lite/c:common",

View File

@ -1,3 +1,5 @@
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package(
default_visibility = ["//visibility:public"],
licenses = ["notice"], # Apache 2.0
@ -16,6 +18,7 @@ cc_library(
"resource_variable.h",
"static_hashtable.h",
],
compatible_with = get_compatible_with_portable(),
deps = [
"//tensorflow/lite:string_util",
"//tensorflow/lite/c:common",

View File

@ -2,6 +2,7 @@ load("//tensorflow/lite:build_def.bzl", "tflite_copts")
load("//tensorflow/lite/micro:build_def.bzl", "micro_copts")
load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite_combined")
load("//tensorflow:tensorflow.bzl", "tf_opts_nortti_if_android")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package(
default_visibility = [
@ -429,6 +430,7 @@ cc_library(
hdrs = [
"op_macros.h",
],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts(),
deps = ["//tensorflow/lite/micro:debug_log"],
)
@ -441,6 +443,7 @@ cc_library(
hdrs = [
"kernel_util.h",
],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts() + micro_copts(),
deps = [
"//tensorflow/lite/c:common",

View File

@ -3,6 +3,7 @@ load("//tensorflow:tensorflow.bzl", "transitive_hdrs")
load("//tensorflow/lite:build_def.bzl", "tflite_copts")
load("//tensorflow/lite/micro:build_def.bzl", "micro_copts")
load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite_combined")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package(
default_visibility = [
@ -47,6 +48,7 @@ NEON_FLAGS_IF_APPLICABLE = select({
cc_library(
name = "compatibility",
hdrs = ["compatibility.h"],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts(),
deps = [
"//tensorflow/lite/kernels:op_macros",
@ -56,6 +58,7 @@ cc_library(
cc_library(
name = "types",
hdrs = ["types.h"],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts(),
deps = [
":compatibility",
@ -372,6 +375,7 @@ cc_library(
"max.h",
"min.h",
],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts(),
)
@ -379,6 +383,7 @@ cc_library(
name = "quantization_util",
srcs = ["quantization_util.cc"],
hdrs = ["quantization_util.h"],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts() + micro_copts(),
deps = [
":compatibility",
@ -608,6 +613,7 @@ cc_library(
"tensor.h",
],
}),
compatible_with = get_compatible_with_portable(),
copts = tflite_copts(),
deps = [
":types",

View File

@ -1,4 +1,5 @@
load("//tensorflow/lite:special_rules.bzl", "if_nnapi")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package(
default_visibility = [
@ -13,6 +14,7 @@ cc_library(
"NeuralNetworksShim.h",
"NeuralNetworksTypes.h",
],
compatible_with = get_compatible_with_portable(),
linkopts = if_nnapi(["-ldl"]),
)
@ -25,6 +27,7 @@ cc_library(
hdrs = [
"nnapi_implementation.h",
],
compatible_with = get_compatible_with_portable(),
linkopts = if_nnapi(["-ldl"]) + if_nnapi(
supported = ["-lrt"],
supported_android = [],
@ -38,6 +41,7 @@ cc_library(
name = "nnapi_util",
srcs = ["nnapi_util.cc"],
hdrs = ["nnapi_util.h"],
compatible_with = get_compatible_with_portable(),
deps = [
":nnapi_implementation",
"//tensorflow/lite:util",

View File

@ -1,6 +1,7 @@
load("//tensorflow:tensorflow.bzl", "py_test")
load("//tensorflow/lite:special_rules.bzl", "tflite_portable_test_suite")
load("@flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package(
default_visibility = [
@ -64,6 +65,7 @@ exports_files([
flatbuffer_cc_library(
name = "schema_fbs",
srcs = ["schema.fbs"],
compatible_with = get_compatible_with_portable(),
)
# Generic schema for flatbuffer converter (but with mutable makes bigger).

View File

@ -2577,12 +2577,13 @@ def _local_genrule(**kwargs):
**kwargs
)
def tf_version_info_genrule(name, out):
def tf_version_info_genrule(name, out, compatible_with = None):
# TODO(gunan): Investigate making this action hermetic so we do not need
# to run it locally.
_local_genrule(
name = name,
out = out,
compatible_with = compatible_with,
exec_tool = "//tensorflow/tools/git:gen_git_source",
srcs = [
"@local_config_git//:gen/spec.json",
@ -2928,3 +2929,6 @@ def tf_grpc_dependency():
def tf_grpc_cc_dependency():
return "//tensorflow:grpc++"
def get_compatible_with_portable():
return []

View File

@ -24,6 +24,7 @@ def flatbuffer_library_public(
out_prefix = "",
includes = [],
include_paths = [],
compatible_with = [],
flatc_args = DEFAULT_FLATC_ARGS,
reflection_name = "",
reflection_visibility = None,
@ -43,6 +44,8 @@ def flatbuffer_library_public(
single source targets. Usually is a directory name.
includes: Optional, list of filegroups of schemas that the srcs depend on.
include_paths: Optional, list of paths the includes files can be found in.
compatible_with: Optional, passed to genrule for environments this rule
can be built for.
flatc_args: Optional, list of additional arguments to pass to flatc.
reflection_name: Optional, if set this will generate the flatbuffer
reflection binaries for the schemas.
@ -72,6 +75,7 @@ def flatbuffer_library_public(
srcs = srcs,
outs = outs,
output_to_bindir = output_to_bindir,
compatible_with = compatible_with,
tools = includes + [flatc_path],
cmd = genrule_cmd,
message = "Generating flatbuffer files for %s:" % (name),
@ -97,6 +101,7 @@ def flatbuffer_library_public(
srcs = srcs,
outs = reflection_outs,
output_to_bindir = output_to_bindir,
compatible_with = compatible_with,
tools = includes + [flatc_path],
cmd = reflection_genrule_cmd,
message = "Generating flatbuffer reflection binary for %s:" % (name),
@ -111,6 +116,7 @@ def flatbuffer_library_public(
# native.FilesetEntry(files = reflection_outs),
# ],
# visibility = reflection_visibility,
# compatible_with = compatible_with,
# )
def flatbuffer_cc_library(
@ -120,6 +126,7 @@ def flatbuffer_cc_library(
out_prefix = "",
includes = [],
include_paths = [],
compatible_with = [],
flatc_args = DEFAULT_FLATC_ARGS,
visibility = None,
srcs_filegroup_visibility = None,
@ -175,6 +182,8 @@ def flatbuffer_cc_library(
includes: Optional, list of filegroups of schemas that the srcs depend on.
** SEE REMARKS BELOW **
include_paths: Optional, list of paths the includes files can be found in.
compatible_with: Optional, passed to genrule for environments this rule
can be built for
flatc_args: Optional list of additional arguments to pass to flatc
(e.g. --gen-mutable).
visibility: The visibility of the generated cc_library. By default, use the
@ -198,6 +207,7 @@ def flatbuffer_cc_library(
out_prefix = out_prefix,
includes = includes,
include_paths = include_paths,
compatible_with = compatible_with,
flatc_args = flatc_args,
reflection_name = reflection_name,
reflection_visibility = visibility,
@ -215,6 +225,7 @@ def flatbuffer_cc_library(
includes = ["."],
linkstatic = 1,
visibility = visibility,
compatible_with = compatible_with,
)
# A filegroup for the `srcs`. That is, all the schema files for this
@ -223,6 +234,7 @@ def flatbuffer_cc_library(
name = srcs_filegroup_name if srcs_filegroup_name else "%s_includes" % (name),
srcs = srcs,
visibility = srcs_filegroup_visibility if srcs_filegroup_visibility != None else visibility,
compatible_with = compatible_with,
)
# Custom provider to track dependencies transitively.