blob: 3b38d31386e610b7a9d9282ac6c1330c6d7b7995 [file] [log] [blame]
# Description:
# TensorFlow is a computational framework, primarily for use in machine
# learning applications.
#
# Public targets:
#
# ":protos_all_cc" - exports all core TensorFlow protos
# ":protos_all_py" - py_proto_library version (Google-internal)
# ":lib" - exports the public non-test headers for:
# //third_party/tensorflow/core/platform:: Platform-specific code and external dependencies
# lib/: Low-level libraries that are not TensorFlow-specific
# ":test" - test equivalent of ":lib".
# This is currently public, but may be made internal in the
# future. Try to avoid depending on it.
# ":framework" - exports the public non-test headers for:
# util/: General low-level TensorFlow-specific libraries
# framework/: Support for adding new ops & kernels
# example/: Wrappers to simplify access to Example proto
# ":ops" - defines TensorFlow ops, but no implementations / kernels
# ops/: Standard ops
# user_ops/: User-supplied ops
# This aggregates a number of smaller op libraries (":*_op_lib")
# ":core_cpu" - exports the public non-test headers for:
# graph/: Support for graphs made up of ops
# common_runtime/: Common code for execution of graphs
# public/: Public APIs for running graphs
# ":core" - The code for ":core_cpu" plus a GPU runtime
# ":all_kernels" - The cpu-specific kernels, plus gpu kernels if
# built with Cuda
# ":tensorflow_opensource" - The complete open-source package, including
# ":all_kernels", ":core", and a Session implementation.
# ":tensorflow" - "tensorflow_opensource" plus some Google-internal libraries.
# ":testlib" - TensorFlow-specific test support, e.g. utilities for testing
# kernels.
# ":direct_session" - An implementation of the Session interface that
# directly runs Graphs via the internal TensorFlow executor.
# "framework_lite" - Intended to be used by operator implementations
# (kernels) that can also be run outside the tensorflow runtime. This
# contains a small set of headers and utilities that can be used for core
# kernels, without bringing in libraries that can bloat code size (e.g.,
# logging is not included because using it will bring in a large amount of
# ostream code).
#
# ":example_parser_configuration" -- A library for extracting the
# tensorflow.Example proto configuration from a Graph.
#
# Public Android targets:
#
# filegroup ":android_proto_srcs" - Protos
# filegroup ":android_srcs" - Core sources
# cc_library ":android_tensorflow_lib" - Native library
# cc_library ":android_tensorflow_lib_lite" - Native library, without ops,
# supporting SELECTIVE_REGISTRATION feature.
# portable_proto_library ":android_proto_lib" (Google-internal)
#
# Note that :framework and :lib have incomplete transitive dependencies (they
# declare but do not define some symbols) if framework_shared_object=True
# (meaning there is an explicit framework shared object). Missing symbols are
# included in //tensorflow:libtensorflow_framework.so. This split supports
# custom op registration; see comments on
# //tensorflow:libtensorflow_framework.so. It does mean that TensorFlow cc_test
# and cc_binary rules will not build. Using tf_cc_test and tf_cc_binary (from
# //tensorflow/tensorflow.bzl) will include the necessary symbols in binary
# build targets.
load(
"//tensorflow:tensorflow.bzl",
"cc_header_only_library",
"if_android",
"if_emscripten",
"if_ios",
"if_linux_x86_64",
"if_mobile",
"if_not_windows",
"if_windows",
"tf_android_core_proto_headers",
"tf_android_core_proto_sources",
"tf_cc_test",
"tf_cc_test_mkl",
"tf_cc_tests",
"tf_copts",
"tf_cuda_library",
"tf_cuda_only_cc_test",
"tf_features_nomodules_if_android",
"tf_features_nomodules_if_emscripten",
"tf_gen_op_libs",
"tf_generate_proto_text_sources",
"tf_genrule_cmd_append_to_srcs",
"tf_opts_nortti_if_android",
"tf_opts_nortti_if_emscripten",
"transitive_hdrs",
)
load("//tensorflow:tensorflow.bzl", "if_nccl")
load("//tensorflow:tensorflow.bzl", "tensorflow_opensource_extra_deps")
# load("//tensorflow:tensorflow.bzl", "tf_android_full_lite_protos")
load("//tensorflow:tensorflow.bzl", "tf_cc_test_gpu")
load("//tensorflow:tensorflow.bzl", "tf_cc_tests_gpu")
load("//tensorflow:tensorflow.bzl", "tf_cuda_cc_test")
# Placeholder: load("//tensorflow:tensorflow.bzl", "tf_portable_proto_lib")
load("//tensorflow:tensorflow.bzl", "tf_portable_proto_library")
load("//tensorflow:tensorflow.bzl", "tf_version_info_genrule")
# For platform specific build config
load(
"//tensorflow/core/platform:default/build_config.bzl",
"tf_additional_all_protos",
"tf_additional_cloud_kernel_deps",
"tf_additional_cloud_op_deps",
"tf_additional_core_deps",
"tf_additional_cupti_wrapper_deps",
"tf_additional_device_tracer_cuda_deps",
"tf_additional_device_tracer_deps",
"tf_additional_device_tracer_test_flags",
"tf_additional_gdr_lib_defines",
"tf_additional_human_readable_json_deps",
"tf_additional_lib_defines",
"tf_additional_lib_deps",
"tf_additional_libdevice_data",
"tf_additional_libdevice_deps",
"tf_additional_minimal_lib_srcs",
"tf_additional_monitoring_hdrs",
"tf_additional_mpi_lib_defines",
"tf_additional_numa_copts",
"tf_additional_numa_deps",
"tf_additional_numa_lib_defines",
"tf_additional_test_deps",
"tf_additional_verbs_lib_defines",
"tf_grpc_service_all",
"tf_jspb_proto_library",
"tf_kernel_tests_linkstatic",
"tf_lib_proto_compiler_deps",
"tf_lib_proto_parsing_deps",
"tf_proto_library",
"tf_proto_library_cc",
"tf_protos_all",
"tf_protos_all_impl",
"tf_protos_grappler",
"tf_protos_grappler_impl",
"tf_pyclif_proto_library",
)
load(
"//tensorflow/core/platform:default/build_config_root.bzl",
"if_dynamic_kernels",
"if_static",
"tf_cuda_tests_tags",
"tf_gpu_tests_tags",
)
load("@local_config_cuda//cuda:build_defs.bzl", "if_cuda")
load("@local_config_tensorrt//:build_defs.bzl", "if_tensorrt")
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_proto_library")
load(
"//third_party/mkl:build_defs.bzl",
"if_mkl",
"mkl_deps",
)
# Placeholder for Google-internal load statements.
package(
default_visibility = [
":dependency_whitelist",
"//tensorflow:internal",
"//tensorflow_models:__subpackages__",
],
licenses = ["notice"], # Apache 2.0
)
package_group(
name = "dependency_whitelist",
packages = [
"//learning/freud/topic_models/tensorflow/...",
"//perftools/accelerators/xprof/api/...",
"//quality/webanswers/brain/tokenization/custom_tf_ops/kernels/...",
],
)
# Export the BUILD file so automated tooling can check licenses
exports_files(["BUILD"])
package_group(name = "experimental_access")
exports_files(["ops/ops.pbtxt"])
# -----------------------------------------------------------------------------
# Public targets
# Protos which are needed for core tensorflow, including on mobile builds.
#
# Note that some protos are in neither additional_core_proto_srcs nor this
# filegroup; e.g. ones with individual proto_library targets.
# LINT.IfChange
COMMON_PROTO_SRCS = [
"example/example.proto",
"example/feature.proto",
"framework/allocation_description.proto",
"framework/api_def.proto",
"framework/attr_value.proto",
"framework/cost_graph.proto",
"framework/device_attributes.proto",
"framework/function.proto",
"framework/graph.proto",
"framework/graph_transfer_info.proto",
"framework/kernel_def.proto",
"framework/log_memory.proto",
"framework/node_def.proto",
"framework/op_def.proto",
"framework/reader_base.proto",
"framework/remote_fused_graph_execute_info.proto",
"framework/resource_handle.proto",
"framework/step_stats.proto",
"framework/summary.proto",
"framework/tensor.proto",
"framework/tensor_description.proto",
"framework/tensor_shape.proto",
"framework/tensor_slice.proto",
"framework/types.proto",
"framework/variable.proto",
"framework/versions.proto",
"protobuf/config.proto",
"protobuf/cluster.proto",
"protobuf/debug.proto",
"protobuf/device_properties.proto",
"protobuf/graph_debug_info.proto",
"protobuf/queue_runner.proto",
"protobuf/rewriter_config.proto",
"protobuf/tensor_bundle.proto",
"protobuf/saver.proto",
"protobuf/verifier_config.proto",
"protobuf/trace_events.proto",
"util/event.proto",
"util/memmapped_file_system.proto",
"util/saved_tensor_slice.proto",
]
ERROR_CODES_PROTO_SRCS = [
"lib/core/error_codes.proto",
]
# LINT.ThenChange(//tensorflow/core/android_proto_config.asciipb)
CORE_PROTO_SRCS = COMMON_PROTO_SRCS + ERROR_CODES_PROTO_SRCS
# Protos which are not needed on mobile builds, but should be included in
# protos_all.
#
# Note that some protos are in neither core_proto_srcs nor this filegroup; e.g.
# ones with individual proto_library targets.
ADDITIONAL_CORE_PROTO_SRCS = [
"example/example_parser_configuration.proto",
"protobuf/trackable_object_graph.proto",
"protobuf/control_flow.proto",
"protobuf/data/experimental/snapshot.proto",
# TODO(ebrevdo): Re-enable once CriticalSection is in core.
# "protobuf/critical_section.proto",
"protobuf/meta_graph.proto",
"protobuf/named_tensor.proto",
"protobuf/saved_model.proto",
"protobuf/saved_object_graph.proto",
"protobuf/struct.proto",
"protobuf/tensorflow_server.proto",
"protobuf/transport_options.proto",
"util/test_log.proto",
]
tf_proto_library(
name = "protos_all",
srcs = [],
cc_api_version = 2,
make_default_target_header_only = True,
protodeps = [
":protos_all_proto",
":error_codes_proto",
],
visibility = ["//visibility:public"],
)
tf_jspb_proto_library(
name = "protos_all_jspb_proto",
visibility = ["//visibility:public"],
deps = [":protos_all_cc"],
)
proto_library(
name = "example_protos",
srcs = [
"example/example.proto",
"example/feature.proto",
],
visibility = ["//visibility:public"],
)
java_proto_library(
name = "example_java_proto",
visibility = ["//visibility:public"],
deps = [":example_protos"],
)
closure_proto_library(
name = "example_protos_closure",
visibility = ["//visibility:public"],
deps = [":example_protos"],
)
exports_files([
"framework/types.proto",
])
tf_proto_library(
name = "protos_test",
srcs = ["util/example_proto_fast_parsing_test.proto"],
cc_api_version = 2,
protodeps = tf_additional_all_protos(),
visibility = ["//visibility:public"],
)
filegroup(
name = "platform_base_hdrs",
srcs = [
"//tensorflow/core/platform:byte_order.h",
"//tensorflow/core/platform:cord.h",
"//tensorflow/core/platform:env_time.h",
"//tensorflow/core/platform:logging.h",
"//tensorflow/core/platform:macros.h",
"//tensorflow/core/platform:platform_strings.h",
"//tensorflow/core/platform:tstring.h",
"//tensorflow/core/platform:types.h",
],
visibility = ["//visibility:private"],
)
cc_library(
name = "platform_base",
hdrs = [":platform_base_hdrs"],
copts = tf_copts(),
tags = ["avoid_dep"],
visibility = [":__subpackages__"],
deps = [
"//tensorflow/core/platform",
"//tensorflow/core/platform:byte_order",
"//tensorflow/core/platform:env_time",
"//tensorflow/core/platform:logging",
"//tensorflow/core/platform:macros",
"//tensorflow/core/platform:types",
"//tensorflow/core/platform/default/build_config:base",
"@com_google_absl//absl/base",
"@com_google_absl//absl/strings",
],
)
cc_library(
name = "framework_bounds_check",
hdrs = ["framework/bounds_check.h"],
visibility = ["//tensorflow/core/kernels:friends"],
deps = [
":platform_base",
"//third_party/eigen3",
],
)
filegroup(
name = "platform_port_hdrs",
srcs = [
"//tensorflow/core/platform:cpu_info.h",
"//tensorflow/core/platform:dynamic_annotations.h",
"//tensorflow/core/platform:init_main.h",
"//tensorflow/core/platform:mem.h",
"//tensorflow/core/platform:mutex.h",
"//tensorflow/core/platform:numa.h",
"//tensorflow/core/platform:thread_annotations.h",
],
visibility = ["//visibility:private"],
)
# Headers that are not exported as part of ":lib".
filegroup(
name = "platform_port_internal_hdrs",
srcs = [
"//tensorflow/core/platform:demangle.h",
"//tensorflow/core/platform:host_info.h",
"//tensorflow/core/platform:snappy.h",
],
visibility = ["//visibility:private"],
)
cc_library(
name = "platform_port",
srcs = [
"//tensorflow/core/platform:cpu_info.cc",
"//tensorflow/core/platform:legacy_platform_port_srcs",
],
hdrs = [
":platform_port_hdrs",
":platform_port_internal_hdrs",
],
copts = tf_copts() + tf_additional_numa_copts(),
visibility = [":__subpackages__"],
deps = [
"//tensorflow/core/platform:platform",
":platform_base",
"@com_google_absl//absl/base",
"//tensorflow/core/platform/default/build_config:port",
"@snappy",
] + tf_additional_numa_deps(),
)
filegroup(
name = "platform_protobuf_hdrs",
srcs = [
"//tensorflow/core/platform:protobuf.h",
],
visibility = ["//visibility:private"],
)
# Headers that are not exported as part of ":lib".
filegroup(
name = "platform_protobuf_internal_hdrs",
srcs = [
"//tensorflow/core/platform:protobuf_internal.h",
],
visibility = ["//visibility:private"],
)
cc_library(
name = "platform_protobuf",
srcs = [
"lib/core/status.h",
"//tensorflow/core/platform:protobuf.cc",
"//tensorflow/core/platform:protobuf.h",
"//tensorflow/core/platform:protobuf_util.cc",
],
hdrs = [
":platform_protobuf_hdrs",
":platform_protobuf_internal_hdrs",
],
copts = tf_copts(),
visibility = [":__subpackages__"],
deps = [
":platform_base",
":platform_port",
"//tensorflow/core/platform",
"//tensorflow/core/platform/default/build_config:protobuf",
"@com_google_protobuf//:protobuf",
],
)
cc_library(
name = "grpc_services",
srcs = [],
hdrs = [
"//tensorflow/core/platform:grpc_services.h",
],
copts = tf_copts(),
visibility = ["//visibility:public"],
deps = tf_grpc_service_all(),
)
cc_library(
name = "human_readable_json",
srcs = ["//tensorflow/core/platform:legacy_human_readable_json_src"],
hdrs = ["//tensorflow/core/platform:human_readable_json.h"],
copts = tf_copts(),
visibility = ["//visibility:public"],
deps = [
":lib",
":lib_internal",
] + tf_additional_human_readable_json_deps(),
)
cc_library(
name = "logger",
srcs = ["//tensorflow/core/platform:logger.cc"],
hdrs = ["//tensorflow/core/platform:logger.h"],
copts = tf_copts(),
visibility = ["//visibility:public"],
deps = [
":lib",
":lib_proto_parsing",
"@com_google_absl//absl/base",
"@com_google_absl//absl/synchronization",
],
)
filegroup(
name = "platform_env_hdrs",
srcs = [
"//tensorflow/core/platform:env.h",
"//tensorflow/core/platform:file_statistics.h",
"//tensorflow/core/platform:file_system.h",
],
visibility = ["//visibility:private"],
)
# Headers that are not exported as part of ":lib".
filegroup(
name = "platform_env_internal_hdrs",
srcs = [
"//tensorflow/core/platform:load_library.h",
],
visibility = ["//visibility:private"],
)
cc_library(
name = "platform_env",
srcs = [
"//tensorflow/core/platform:env.cc",
"//tensorflow/core/platform:file_system.cc",
"//tensorflow/core/platform:legacy_platform_env_srcs",
],
hdrs = [
":platform_env_hdrs",
":platform_env_internal_hdrs",
],
copts = tf_copts(),
visibility = [
":__subpackages__",
"//tensorflow/c:__subpackages__",
],
deps = [
":error_codes_proto_cc",
":lib",
":lib_internal",
":platform_base",
":platform_port",
":platform_protobuf",
"//tensorflow/core/platform",
"//tensorflow/core/platform/default/build_config:env",
"//tensorflow/core/platform/default/build_config:port",
],
)
filegroup(
name = "platform_file_system_hdrs",
srcs = [
"//tensorflow/core/platform:file_system_helper.h",
"//tensorflow/core/platform:null_file_system.h",
],
visibility = ["//visibility:private"],
)
cc_library(
name = "platform_file_system",
srcs = [
"//tensorflow/core/platform:file_system_helper.cc",
"//tensorflow/core/platform:legacy_file_system_hdrs",
],
hdrs = [
":platform_file_system_hdrs",
],
copts = tf_copts(),
visibility = [":__subpackages__"],
deps = [
":lib",
":platform_env",
"//tensorflow/core/platform",
],
)
cc_library(
name = "platform_strings",
srcs = [
"//tensorflow/core/platform:platform_strings.cc",
"//tensorflow/core/platform:platform_strings_computed.h",
],
hdrs = [
"//tensorflow/core/platform:platform_strings.h",
],
visibility = [":__subpackages__"],
deps = [],
)
filegroup(
name = "platform_other_hdrs",
srcs = [
"//tensorflow/core/platform:abi.h",
"//tensorflow/core/platform:context.h",
"//tensorflow/core/platform:cpu_feature_guard.h",
"//tensorflow/core/platform:error.h",
"//tensorflow/core/platform:fingerprint.h",
"//tensorflow/core/platform:monitoring.h",
"//tensorflow/core/platform:net.h",
"//tensorflow/core/platform:notification.h",
"//tensorflow/core/platform:prefetch.h",
"//tensorflow/core/platform:profile_utils/android_armv7a_cpu_utils_helper.h",
"//tensorflow/core/platform:profile_utils/clock_cycle_profiler.h",
"//tensorflow/core/platform:profile_utils/cpu_utils.h",
"//tensorflow/core/platform:profile_utils/i_cpu_utils_helper.h",
"//tensorflow/core/platform:stacktrace.h",
"//tensorflow/core/platform:stacktrace_handler.h",
"//tensorflow/core/platform:strong_hash.h",
"//tensorflow/core/platform:subprocess.h",
] + tf_additional_monitoring_hdrs(),
visibility = ["//visibility:private"],
)
tf_cc_test(
name = "platform_unbounded_work_queue_test",
srcs = ["//tensorflow/core/platform:unbounded_work_queue_test.cc"],
deps = [
":framework",
":lib",
":lib_internal",
":lib_test_internal",
":test",
":test_main",
"@com_google_absl//absl/memory",
],
)
# Headers that are not exported as part of ":lib".
filegroup(
name = "platform_other_internal_hdrs",
srcs = [
"//tensorflow/core/platform:denormal.h",
"//tensorflow/core/platform:setround.h",
"//tensorflow/core/platform:tracing.h",
],
visibility = ["//visibility:private"],
)
cc_library(
name = "platform_other",
srcs = [
"//tensorflow/core/platform:cpu_feature_guard.cc",
"//tensorflow/core/platform:denormal.cc",
"//tensorflow/core/platform:legacy_platform_other_srcs",
"//tensorflow/core/platform:profile_utils/android_armv7a_cpu_utils_helper.cc",
"//tensorflow/core/platform:profile_utils/clock_cycle_profiler.cc",
"//tensorflow/core/platform:profile_utils/cpu_utils.cc",
"//tensorflow/core/platform:setround.cc",
"//tensorflow/core/platform:tracing.cc",
],
hdrs = [
":platform_other_hdrs",
":platform_other_internal_hdrs",
],
copts = tf_copts(),
visibility = [":__subpackages__"],
deps = [
":lib",
":platform_base",
":platform_env",
":platform_port",
":platform_protobuf",
"//tensorflow/core/platform",
"//tensorflow/core/platform:abi",
"//tensorflow/core/platform:annotation",
"//tensorflow/core/platform:stacktrace",
"//tensorflow/core/platform/default/build_config:other",
"//tensorflow/core/platform/default/build_config:platformlib",
"//tensorflow/core/platform/default/build_config:port",
"@com_google_absl//absl/time",
],
)
# Minimal lib so that tools used for mobile compilation
# don't have to depend on lib/platformlib.
cc_library(
name = "lib_proto_parsing",
srcs = [
"//tensorflow/core/platform:protobuf.cc",
],
hdrs = [
"lib/core/errors.h",
"lib/core/status.h",
"lib/core/stringpiece.h",
"lib/strings/numbers.h",
"lib/strings/strcat.h",
"//tensorflow/core/lib/bfloat16:bfloat16.h",
"//tensorflow/core/platform:init_main.h",
"//tensorflow/core/platform:legacy_proto_hdrs",
"//tensorflow/core/platform:logging.h",
"//tensorflow/core/platform:macros.h",
"//tensorflow/core/platform:platform.h",
"//tensorflow/core/platform:protobuf.h",
"//tensorflow/core/platform:stringpiece.h",
"//tensorflow/core/platform:tstring.h",
"//tensorflow/core/platform:types.h",
],
copts = tf_copts(),
deps = tf_lib_proto_parsing_deps() + [
":platform_base",
"@com_google_absl//absl/strings",
"@double_conversion//:double-conversion",
"//tensorflow/core/lib/bfloat16",
"//tensorflow/core/platform:cpu_info",
"//tensorflow/core/platform:logging",
"//tensorflow/core/platform:macros",
"//tensorflow/core/platform:platform",
"//tensorflow/core/platform:stringpiece",
"//tensorflow/core/platform:types",
],
)
cc_library(
name = "lib_proto_compiler",
hdrs = [
"//tensorflow/core/platform:protobuf_compiler.h",
],
copts = tf_copts(),
deps = tf_lib_proto_compiler_deps() + [
":lib_proto_parsing",
],
)
# This build rule (along with :lib_internal, :framework, and
# :framework_internal) purposefully omits the definitions of many declared
# symbols, which are included in //tensorflow:libtensorflow_framework.so. Using
# tf_cc_test and tf_cc_binary will include the necessary symbols.
cc_library(
name = "lib",
hdrs = [
"lib/core/arena.h",
"lib/core/bitmap.h",
"lib/core/bits.h",
"lib/core/coding.h",
"lib/core/errors.h",
"lib/core/notification.h",
"lib/core/raw_coding.h",
"lib/core/status.h",
"lib/core/stringpiece.h",
"lib/core/threadpool.h",
"lib/core/threadpool_interface.h",
"lib/hash/crc32c.h",
"lib/hash/hash.h",
"lib/histogram/histogram.h",
"lib/io/buffered_inputstream.h",
"lib/io/compression.h",
"lib/io/inputstream_interface.h",
"lib/io/path.h",
"lib/io/proto_encode_helper.h",
"lib/io/random_inputstream.h",
"lib/io/record_reader.h",
"lib/io/record_writer.h",
"lib/io/table.h",
"lib/io/table_builder.h",
"lib/io/table_options.h",
"lib/math/math_util.h",
"lib/monitoring/collected_metrics.h",
"lib/monitoring/collection_registry.h",
"lib/monitoring/counter.h",
"lib/monitoring/gauge.h",
"lib/monitoring/metric_def.h",
"lib/monitoring/sampler.h",
"lib/random/distribution_sampler.h",
"lib/random/philox_random.h",
"lib/random/random_distributions.h",
"lib/random/simple_philox.h",
"lib/strings/numbers.h",
"lib/strings/proto_serialization.h",
"lib/strings/str_util.h",
"lib/strings/strcat.h",
"lib/strings/stringprintf.h",
":platform_base_hdrs",
":platform_env_hdrs",
":platform_file_system_hdrs",
":platform_other_hdrs",
":platform_port_hdrs",
":platform_protobuf_hdrs",
"//tensorflow/core/lib/bfloat16:bfloat16.h",
"//tensorflow/core/lib/gtl:legacy_lib_gtl_headers",
],
visibility = ["//visibility:public"],
deps = [
":lib_internal",
"//tensorflow/core/platform:stringpiece",
"//tensorflow/core/platform:stringprintf",
"@com_google_absl//absl/container:inlined_vector",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:optional",
],
)
# APIs defined in lib_experimental are for experimental usage and may be
# subject to change. Its visibility is limited to selected packages.
cc_library(
name = "lib_experimental",
hdrs = [
"lib/core/threadpool_options.h",
],
visibility = [
":experimental_access",
"//tensorflow/cc:__pkg__",
],
deps = [
":lib",
],
)
cc_library(
name = "feature_util",
srcs = ["example/feature_util.cc"],
hdrs = ["example/feature_util.h"],
visibility = ["//visibility:public"],
deps = [
":core_stringpiece",
":lib_proto_parsing",
":protos_all_cc",
],
)
cc_library(
name = "stacktrace_handler",
srcs = ["//tensorflow/core/platform:stacktrace_handler.cc"],
hdrs = ["//tensorflow/core/platform:stacktrace_handler.h"],
deps = [
"//tensorflow/core/platform",
"//tensorflow/core/platform:abi",
"//tensorflow/core/platform:stacktrace",
],
)
# DEPRECATED: use platform:stringpiece instead.
cc_library(
name = "core_stringpiece",
hdrs = ["lib/core/stringpiece.h"],
copts = tf_copts(),
deps = [
"//tensorflow/core/platform:stringpiece",
],
)
# Test support library needed for all tests
# This is currently public, but may be made internal in the
# future. Try to avoid depending on it.
cc_library(
name = "test",
testonly = 1,
srcs = [
"util/reporter.cc",
"//tensorflow/core/platform:legacy_test_srcs",
"//tensorflow/core/platform:test.cc",
],
hdrs = [
"lib/core/status_test_util.h",
"util/reporter.h",
"//tensorflow/core/platform:test.h",
"//tensorflow/core/platform:test_benchmark.h",
],
copts = tf_copts(),
linkopts = select({
"//tensorflow:windows": [],
"//conditions:default": ["-lm"],
}),
visibility = ["//visibility:public"],
deps = [
":function_ops_op_lib",
":functional_ops_op_lib",
":lib",
":lib_internal",
":protos_all_cc",
"//tensorflow/core/platform/default/build_config:gtest",
"//tensorflow/core/kernels:required",
] + tf_additional_test_deps(),
)
# Testing libraries - lite versions that don't depend on all of "lib" or
# "lib_internal". Instead, they only need a much smaller set of support
# libraries such as ":platform_base" and ":core_stringpiece".
cc_library(
name = "test_lite",
testonly = 1,
srcs = [
"//tensorflow/core/platform:test.cc",
],
hdrs = [
"//tensorflow/core/platform:test.h",
"//tensorflow/core/platform:test_benchmark.h",
],
copts = tf_copts(),
deps = [
":platform_base",
"//tensorflow/core/platform",
"//tensorflow/core/platform/default/build_config:gtest",
],
)
# This build rule (along with :framework_internal, :lib, and :lib_internal)
# purposefully omits the definitions of many declared symbols, which are
# included in //tensorflow:libtensorflow_framework.so. Using tf_cc_test and tf_cc_binary
# will include the necessary symbols.
tf_cuda_library(
name = "framework",
hdrs = [
"example/feature_util.h",
"framework/allocator.h",
"framework/bounds_check.h",
"framework/variant.h",
"framework/variant_encode_decode.h",
"framework/variant_op_registry.h",
"framework/variant_tensor_data.h",
"framework/allocator_registry.h",
"framework/attr_value_util.h",
"framework/bfloat16.h",
"framework/cancellation.h",
"framework/collective.h",
"framework/common_shape_fns.h",
"framework/control_flow.h", # TODO(josh11b): Make internal?
"framework/dataset.h",
"framework/dataset_stateful_op_whitelist.h",
"framework/device_base.h",
"framework/function.h",
"framework/function_handle_cache.h",
"framework/graph_def_util.h",
"framework/graph_to_functiondef.h",
"framework/kernel_def_builder.h",
"framework/kernel_def_util.h",
"framework/log_memory.h",
"framework/logging.h",
"framework/lookup_interface.h",
"framework/memory_types.h",
"framework/node_def_builder.h",
"framework/node_def_util.h",
"framework/numeric_op.h",
"framework/numeric_types.h",
"framework/op.h",
"framework/op_def_builder.h",
"framework/op_def_util.h",
"framework/op_kernel.h",
"framework/ops_util.h",
"framework/partial_tensor_shape.h",
"framework/queue_interface.h",
"framework/reader_interface.h",
"framework/reader_op_kernel.h",
"framework/register_types.h",
"framework/register_types_traits.h",
"framework/resource_mgr.h",
"framework/resource_op_kernel.h",
"framework/selective_registration.h",
"framework/session_state.h",
"framework/shape_inference.h",
"framework/stats_aggregator.h",
"framework/tensor.h",
"framework/tensor_shape.h",
"framework/tensor_slice.h",
"framework/tensor_types.h",
"framework/tensor_util.h",
"framework/thread_factory.h",
"framework/tracking_allocator.h",
"framework/type_index.h",
"framework/type_traits.h",
"framework/typed_allocator.h",
"framework/types.h",
"public/version.h",
"util/activation_mode.h",
"util/batch_util.h",
"util/bcast.h",
"util/matmul_bcast.h",
"util/device_name_utils.h",
"util/dump_graph.h",
"util/events_writer.h",
"util/example_proto_fast_parsing.h",
"util/example_proto_helper.h",
"util/gpu_kernel_helper.h",
"util/guarded_philox_random.h",
"util/mirror_pad_mode.h",
"util/padding.h",
"util/einsum_op_util.h",
"util/port.h",
"util/ptr_util.h",
"util/reffed_status_callback.h",
"util/saved_tensor_slice_util.h",
"util/sparse/group_iterator.h",
"util/sparse/sparse_tensor.h",
"util/stat_summarizer.h",
"util/stat_summarizer_options.h",
"util/stream_executor_util.h",
"util/strided_slice_op.h",
"util/tensor_format.h",
"util/tensor_ops_util.h",
"util/tensor_slice_reader.h",
"util/tensor_slice_reader_cache.h",
"util/tensor_slice_writer.h",
"util/use_cudnn.h",
"util/matmul_autotune.h",
"util/util.h",
"util/work_sharder.h",
] + select({
"//tensorflow:windows": [],
"//conditions:default": [
"util/memmapped_file_system.h",
"util/memmapped_file_system_writer.h",
],
}) + if_mkl([
"util/mkl_util.h",
]),
visibility = ["//visibility:public"],
deps = [
":framework_internal",
"@com_google_absl//absl/base",
],
)
# This is redundant with the "framework" target above. It's useful for
# applications that want to depend on a minimal subset of TensorFlow (e.g. XLA).
cc_library(
name = "allocator",
srcs = [
"framework/allocator.cc",
"framework/allocator_registry.h",
"framework/numeric_types.h",
"framework/tracking_allocator.cc",
"framework/tracking_allocator.h",
"framework/type_traits.h",
],
hdrs = [
"framework/allocator.h",
],
features = ["parse_headers"],
visibility = ["//visibility:public"],
deps = [
":lib",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:optional",
"//third_party/eigen3",
] + if_static(extra_deps = [":allocator_registry_impl"]),
alwayslink = 1,
)
# This target will be included in libtensorflow_framework.so via the
# framework_internal_impl target.
# All other dependencies on this target need to go through if_static guard,
# as otherwise duplicate registration in the registry will cause crashes.
cc_library(
name = "allocator_registry_impl",
srcs = [
"framework/allocator.h",
"framework/allocator_registry.cc",
"framework/allocator_registry.h",
"framework/cpu_allocator_impl.cc",
"framework/numeric_types.h",
"framework/tracking_allocator.h",
"framework/type_traits.h",
],
deps = [
":lib",
"//third_party/eigen3",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:optional",
],
alwayslink = 1,
)
cc_library(
name = "stats_calculator_portable",
srcs = [
"util/stat_summarizer_options.h",
"util/stats_calculator.cc",
],
hdrs = [
"util/stats_calculator.h",
],
copts = tf_copts(),
)
tf_cc_test(
name = "stats_calculator_test",
srcs = ["util/stats_calculator_test.cc"],
deps = [
":stats_calculator_portable",
":test",
":test_main",
],
)
cc_library(
name = "overflow",
hdrs = ["util/overflow.h"],
deps = [
":framework_lite",
":lib",
],
)
cc_library(
name = "exec_on_stall",
hdrs = ["util/exec_on_stall.h"],
deps = [":framework_lite"],
)
cc_library(
name = "ptr_util",
hdrs = ["util/ptr_util.h"],
)
cc_library(
name = "reader_base",
srcs = ["framework/reader_base.cc"],
hdrs = ["framework/reader_base.h"],
visibility = ["//visibility:public"],
deps = [
":framework",
":lib",
":protos_all_cc",
],
)
cc_library(
name = "op_gen_lib",
srcs = ["framework/op_gen_lib.cc"],
hdrs = ["framework/op_gen_lib.h"],
visibility = ["//visibility:public"],
deps = [
":lib",
":lib_internal",
":protos_all_cc",
"//tensorflow/core/util/proto:proto_utils",
"@com_google_absl//absl/strings",
],
)
cc_library(
name = "session_options",
hdrs = ["public/session_options.h"],
visibility = ["//visibility:public"],
deps = [
":lib",
":protos_all_cc",
],
)
cc_library(
name = "framework_lite",
srcs = [
"//tensorflow/core/platform:legacy_minimal_lib_srcs",
],
hdrs = [
"framework/numeric_types.h",
"framework/tensor_types.h",
"framework/type_traits.h",
"//tensorflow/core/lib/bfloat16:bfloat16.h",
"//tensorflow/core/platform:byte_order.h",
"//tensorflow/core/platform:default/dynamic_annotations.h",
"//tensorflow/core/platform:default/integral_types.h",
"//tensorflow/core/platform:default/logging.h",
"//tensorflow/core/platform:default/mutex.h",
"//tensorflow/core/platform:default/thread_annotations.h",
"//tensorflow/core/platform:dynamic_annotations.h",
"//tensorflow/core/platform:macros.h",
"//tensorflow/core/platform:mutex.h",
"//tensorflow/core/platform:platform.h",
"//tensorflow/core/platform:prefetch.h",
"//tensorflow/core/platform:protobuf.h",
"//tensorflow/core/platform:thread_annotations.h",
"//tensorflow/core/platform:tstring.h",
"//tensorflow/core/platform:types.h",
"//tensorflow/core/platform:cpu_info.h",
] + if_windows(["//tensorflow/core/platform:windows/integral_types.h"]),
visibility = ["//visibility:public"],
deps =
[
"@nsync//:nsync_cpp",
] + [
"//third_party/eigen3",
"//tensorflow/core/lib/bfloat16",
"//tensorflow/core/platform/default/build_config:minimal",
"//tensorflow/core/platform:types",
],
)
# Generates library per group of ops.
tf_gen_op_libs(
is_external = False,
op_lib_names = [
"batch_ops",
"bitwise_ops",
"boosted_trees_ops",
"tensor_forest_ops",
"candidate_sampling_ops",
"checkpoint_ops",
"clustering_ops",
"collective_ops",
"control_flow_ops",
"ctc_ops",
"data_flow_ops",
"dataset_ops",
"decode_proto_ops",
"encode_proto_ops",
"experimental_dataset_ops",
"function_ops",
"functional_ops",
"image_ops",
"io_ops",
"linalg_ops",
"list_ops",
"lookup_ops",
"logging_ops",
"manip_ops",
"math_ops",
"mkl_nn_ops",
"nccl_ops",
"nn_ops",
"no_op",
"parsing_ops",
"random_grad",
"random_ops",
"stateful_random_ops",
"remote_fused_graph_ops",
"rnn_ops",
"rpc_ops",
"scoped_allocator_ops",
"sdca_ops",
"set_ops",
"script_ops",
"sendrecv_ops",
"sparse_ops",
"spectral_ops",
"state_ops",
"stateless_random_ops",
"summary_ops",
"training_ops",
],
deps = [
":lib",
":protos_all_cc",
],
)
tf_gen_op_libs(
op_lib_names = [
"string_ops",
],
deps = [
":lib_internal",
":lib_proto_parsing",
"@com_google_absl//absl/strings",
],
)
tf_gen_op_libs(
op_lib_names = [
"array_ops",
],
deps = [
":lib",
":protos_all_cc",
],
)
tf_gen_op_libs(
op_lib_names = [
"mkl_array_ops",
],
deps = [":protos_all_cc"],
)
tf_gen_op_libs(
op_lib_names = [
"audio_ops",
],
deps = [":lib"],
)
tf_gen_op_libs(
op_lib_names = ["debug_ops"],
deps = ["//tensorflow/core/kernels:debug_ops"],
)
tf_gen_op_libs(
is_external = False,
op_lib_names = [
"resource_variable_ops",
],
deps = [":lib"],
)
tf_gen_op_libs(
op_lib_names = [
"tpu_configuration_ops",
"tpu_cross_replica_ops",
"tpu_embedding_ops",
"tpu_functional_ops",
"tpu_heartbeat_ops",
"tpu_host_compute_ops",
"tpu_infeed_ops",
"tpu_outfeed_ops",
"tpu_ordinal_selector_ops",
"tpu_replication_ops",
],
deps = [
":lib",
":lib_proto_parsing",
":protos_all_cc",
"//tensorflow/core/protobuf/tpu:tpu_embedding_configuration_proto_cc",
"//tensorflow/core/tpu:tpu_embedding_optimization_parameters_utils",
"//tensorflow/core/tpu:tpu_embedding_output_layout_utils",
],
)
# And one for all user ops
cc_library(
name = "user_ops_op_lib",
srcs = glob(["user_ops/**/*.cc"]),
copts = tf_copts(),
linkstatic = 1,
visibility = ["//visibility:public"],
deps = [":framework"],
alwayslink = 1,
)
cc_library(
name = "word2vec_ops",
srcs = ["ops/word2vec_ops.cc"],
linkstatic = 1,
visibility = ["//tensorflow:internal"],
deps = [":framework"],
alwayslink = 1,
)
cc_library(
name = "cudnn_rnn_ops",
srcs = [
"ops/cudnn_rnn_ops.cc",
],
linkstatic = 1,
visibility = ["//tensorflow:internal"],
deps = [
":framework",
":lib",
":lib_internal",
":stream_executor",
"//tensorflow/core/kernels:bounds_check_lib",
],
alwayslink = 1,
)
tf_gen_op_libs(
op_lib_names = [
"cudnn_rnn_ops",
],
deps = [
":lib",
],
)
cc_library(
name = "ragged_ops",
deps = [
":ragged_array_ops_op_lib",
":ragged_conversion_ops_op_lib",
":ragged_math_ops_op_lib",
],
)
tf_gen_op_libs(
op_lib_names = [
"ragged_array_ops",
"ragged_conversion_ops",
"ragged_math_ops",
],
deps = [":ragged_to_dense_util"],
)
cc_library(
name = "ragged_to_dense_util",
srcs = [
"ops/ragged_to_dense_util.cc",
],
hdrs = [
"ops/ragged_to_dense_util.h",
],
deps = [
"//tensorflow/core:framework",
"//tensorflow/core:protos_all_cc",
],
)
tf_cc_test(
name = "ragged_to_dense_util_test",
srcs = [
"ops/ragged_to_dense_util_test.cc",
],
deps = [
":ragged_to_dense_util",
":test",
":testlib",
"//tensorflow/core:framework",
"//tensorflow/core:protos_all_cc",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "ops",
visibility = ["//visibility:public"],
deps = [
":array_ops_op_lib",
":audio_ops_op_lib",
":batch_ops_op_lib",
":bitwise_ops_op_lib",
":boosted_trees_ops_op_lib",
":tensor_forest_ops_op_lib",
":candidate_sampling_ops_op_lib",
":checkpoint_ops_op_lib",
":clustering_ops_op_lib",
":collective_ops_op_lib",
":control_flow_ops_op_lib",
":ctc_ops_op_lib",
":cudnn_rnn_ops_op_lib",
":data_flow_ops_op_lib",
":dataset_ops_op_lib",
":decode_proto_ops_op_lib",
":encode_proto_ops_op_lib",
":experimental_dataset_ops_op_lib",
":function_ops_op_lib",
":functional_ops_op_lib",
":image_ops_op_lib",
":io_ops_op_lib",
":linalg_ops_op_lib",
":list_ops_op_lib",
":logging_ops_op_lib",
":lookup_ops_op_lib",
":manip_ops_op_lib",
":math_ops_op_lib",
":nccl_ops_op_lib",
":nn_ops_op_lib",
":no_op_op_lib",
":parsing_ops_op_lib",
":ragged_ops",
":random_ops_op_lib",
":rnn_ops_op_lib",
":stateful_random_ops_op_lib",
":remote_fused_graph_ops_op_lib",
":resource_variable_ops_op_lib",
":rpc_ops_op_lib",
":scoped_allocator_ops_op_lib",
":script_ops_op_lib",
":sdca_ops_op_lib",
":sendrecv_ops_op_lib",
":set_ops_op_lib",
":sparse_ops_op_lib",
":summary_ops_op_lib",
":spectral_ops_op_lib",
":state_ops_op_lib",
":stateless_random_ops_op_lib",
":string_ops_op_lib",
":tpu_configuration_ops_op_lib",
":tpu_cross_replica_ops_op_lib",
":tpu_embedding_ops_op_lib",
":tpu_functional_ops_op_lib",
":tpu_heartbeat_ops_op_lib",
":tpu_host_compute_ops_op_lib",
":tpu_infeed_ops_op_lib",
":tpu_outfeed_ops_op_lib",
":tpu_ordinal_selector_ops_op_lib",
":tpu_replication_ops_op_lib",
":training_ops_op_lib",
":user_ops_op_lib",
":word2vec_ops",
"//tensorflow/c/kernels:bitcast_op_lib",
] + if_mkl([
":mkl_array_ops_op_lib",
":mkl_nn_ops_op_lib",
]) + if_tensorrt([
"//tensorflow/compiler/tf2tensorrt:trt_engine_resource_ops_op_lib",
"//tensorflow/compiler/tf2tensorrt:trt_op_libs",
]) + tf_additional_cloud_op_deps(),
alwayslink = 1,
)
cc_library(
name = "array_grad",
srcs = ["ops/array_grad.cc"],
linkstatic = 1, # Needed since alwayslink is broken in bazel b/27630669
visibility = ["//visibility:public"],
deps = [
":array_ops_op_lib",
":framework",
":lib",
"//tensorflow/c/kernels:bitcast_op_lib",
],
alwayslink = 1,
)
cc_library(
name = "functional_grad",
srcs = ["ops/functional_grad.cc"],
linkstatic = 1, # Needed since alwayslink is broken in bazel b/27630669
visibility = ["//visibility:public"],
deps = [
":framework",
":functional_ops_op_lib",
":lib",
],
alwayslink = 1,
)
cc_library(
name = "math_grad",
srcs = [
"ops/math_grad.cc",
"ops/random_grad.cc",
"ops/stateless_random_grad.cc",
],
linkstatic = 1, # Needed since alwayslink is broken in bazel b/27630669
visibility = ["//visibility:public"],
deps = [
":framework",
":lib",
":math_ops_op_lib",
":protos_all_cc",
],
alwayslink = 1,
)
cc_library(
name = "nn_grad",
srcs = ["ops/nn_grad.cc"],
linkstatic = 1, # Needed since alwayslink is broken in bazel b/27630669
visibility = ["//visibility:public"],
deps = [
":framework",
":lib",
":nn_ops_op_lib",
] + if_mkl([
":mkl_nn_ops_op_lib",
]),
alwayslink = 1,
)
tf_cuda_library(
name = "core_cpu",
hdrs = [
"common_runtime/device.h",
"common_runtime/device_factory.h",
"common_runtime/function.h",
"common_runtime/optimization_registry.h",
"common_runtime/shape_refiner.h",
"graph/algorithm.h",
"graph/default_device.h",
"graph/gradients.h",
"graph/graph.h",
"graph/graph_constructor.h",
"graph/graph_def_builder.h",
"graph/graph_def_builder_util.h",
"graph/node_builder.h",
"graph/validate.h",
"graph/while_context.h",
"public/session.h",
"public/session_options.h",
],
visibility = ["//visibility:public"],
deps = [
":core_cpu_internal",
],
)
cc_library(
name = "core",
visibility = ["//visibility:public"],
deps = [
":core_cpu",
":gpu_runtime",
":sycl_runtime",
],
)
# This includes implementations of all kernels built into TensorFlow.
cc_library(
name = "all_kernels_impl",
visibility = [":__subpackages__"],
deps = [
"//tensorflow/c/kernels:bitcast_op",
"//tensorflow/core/kernels:array",
"//tensorflow/core/kernels:audio",
"//tensorflow/core/kernels:batch_kernels",
"//tensorflow/core/kernels:bincount_op",
"//tensorflow/core/kernels:boosted_trees_ops",
"//tensorflow/core/kernels:tensor_forest_ops",
"//tensorflow/core/kernels:candidate_sampler_ops",
"//tensorflow/core/kernels:checkpoint_ops",
"//tensorflow/core/kernels:clustering_ops",
"//tensorflow/core/kernels:collective_ops",
"//tensorflow/core/kernels:control_flow_ops",
"//tensorflow/core/kernels:ctc_ops",
"//tensorflow/core/kernels:cudnn_rnn_kernels",
"//tensorflow/core/kernels:data_flow",
"//tensorflow/core/kernels:decode_proto_op",
"//tensorflow/core/kernels:encode_proto_op",
"//tensorflow/core/kernels:fake_quant_ops",
"//tensorflow/core/kernels:function_ops",
"//tensorflow/core/kernels:functional_ops",
"//tensorflow/core/kernels:grappler",
"//tensorflow/core/kernels:histogram_op",
"//tensorflow/core/kernels:image",
"//tensorflow/core/kernels:io",
"//tensorflow/core/kernels:linalg",
"//tensorflow/core/kernels:lookup",
"//tensorflow/core/kernels:logging",
"//tensorflow/core/kernels:manip",
"//tensorflow/core/kernels:math",
"//tensorflow/core/kernels:multinomial_op",
"//tensorflow/core/kernels:mutex_ops",
"//tensorflow/core/kernels:nn",
"//tensorflow/core/kernels:parameterized_truncated_normal_op",
"//tensorflow/core/kernels:parsing",
"//tensorflow/core/kernels:partitioned_function_ops",
"//tensorflow/core/kernels:pooling_ops",
"//tensorflow/core/kernels:ragged_ops",
"//tensorflow/core/kernels:random_ops",
"//tensorflow/core/kernels:stateful_random_ops",
"//tensorflow/core/kernels:random_binomial_op",
"//tensorflow/core/kernels:random_poisson_op",
"//tensorflow/core/kernels:remote_fused_graph_ops",
"//tensorflow/core/kernels:required",
"//tensorflow/core/kernels:resource_variable_ops",
"//tensorflow/core/kernels:rnn_ops",
"//tensorflow/core/kernels:rpc_op",
"//tensorflow/core/kernels:scoped_allocator_ops",
"//tensorflow/core/kernels:sdca_ops",
"//tensorflow/core/kernels:searchsorted_op",
"//tensorflow/core/kernels:set_kernels",
"//tensorflow/core/kernels:sparse",
"//tensorflow/core/kernels:state",
"//tensorflow/core/kernels:stateless_random_ops",
"//tensorflow/core/kernels:string",
"//tensorflow/core/kernels:summary_kernels",
"//tensorflow/core/kernels:training_ops",
"//tensorflow/core/kernels:word2vec_kernels",
] + tf_additional_cloud_kernel_deps() + if_not_windows([
"//tensorflow/core/kernels:fact_op",
"//tensorflow/core/kernels:array_not_windows",
"//tensorflow/core/kernels:math_not_windows",
"//tensorflow/core/kernels:quantized_ops",
"//tensorflow/core/kernels/neon:neon_depthwise_conv_op",
]) + if_mkl([
"//tensorflow/core/kernels:mkl_aggregate_ops",
"//tensorflow/core/kernels:mkl_concat_op",
"//tensorflow/core/kernels:mkl_dequantize_op",
"//tensorflow/core/kernels:mkl_conv_op",
"//tensorflow/core/kernels:mkl_cwise_ops_common",
"//tensorflow/core/kernels:mkl_fused_batch_norm_op",
"//tensorflow/core/kernels:mkl_identity_op",
"//tensorflow/core/kernels:mkl_input_conversion_op",
"//tensorflow/core/kernels:mkl_lrn_op",
"//tensorflow/core/kernels:mkl_pooling_ops",
"//tensorflow/core/kernels:mkl_qmatmul_op",
"//tensorflow/core/kernels:mkl_requantize_ops",
"//tensorflow/core/kernels:mkl_quantize_op",
"//tensorflow/core/kernels:mkl_relu_op",
"//tensorflow/core/kernels:mkl_reshape_op",
"//tensorflow/core/kernels:mkl_slice_op",
"//tensorflow/core/kernels:mkl_softmax_op",
"//tensorflow/core/kernels:mkl_transpose_op",
"//tensorflow/core/kernels:mkl_batch_matmul_op",
"//tensorflow/core/kernels:mkl_matmul_op",
"//tensorflow/core/kernels:mkl_tfconv_op",
]) + if_cuda([
"//tensorflow/core/grappler/optimizers:gpu_swapping_kernels",
"//tensorflow/core/grappler/optimizers:gpu_swapping_ops",
]) + if_nccl([
"//tensorflow/core/kernels:nccl_kernels",
]) + if_tensorrt([
"//tensorflow/compiler/tf2tensorrt:trt_engine_resource_op_kernels",
"//tensorflow/compiler/tf2tensorrt:trt_op_kernels",
]),
)
cc_library(
name = "all_kernels",
visibility = ["//visibility:public"],
deps = if_dynamic_kernels(
[],
otherwise = [":all_kernels_impl"],
) + [
# TODO(gunan): Work on the API between these and rest of TF and make
# these also dynamically loading.
"//tensorflow/core/kernels:dataset_ops", # Depends on grappler
"//tensorflow/core/kernels:list_kernels", # Depends on variant_op_registry.h
],
)
tf_cuda_library(
name = "tensorflow_opensource",
copts = tf_copts(),
visibility = ["//visibility:public"],
deps = [
":all_kernels",
":core",
":direct_session",
":example_parser_configuration",
":gpu_runtime",
":lib",
":ops",
] + tensorflow_opensource_extra_deps(),
)
cc_library(
name = "tensorflow",
visibility = ["//visibility:public"],
deps = [
":tensorflow_opensource",
"//tensorflow/core/platform/default/build_config:tensorflow_platform_specific",
],
)
# Test support library needed for higher-level (TensorFlow-specific) tests
cc_library(
name = "testlib",
testonly = 1,
srcs = [
"common_runtime/function_testlib.cc",
"common_runtime/kernel_benchmark_testlib.cc",
"framework/fake_input.cc",
"framework/function_testlib.cc",
"graph/testlib.cc",
],
hdrs = [
"common_runtime/function_testlib.h",
"common_runtime/kernel_benchmark_testlib.h",
"common_runtime/test_collective_executor_mgr.h",
"framework/fake_input.h",
"framework/function_testlib.h",
"framework/shape_inference_testutil.h",
"framework/tensor_testutil.h",
"graph/benchmark_testlib.h",
"graph/testlib.h",
# TODO(josh11b): Drop this once users are depending on
# kernels:ops_testutil instead.
"//tensorflow/core/kernels:ops_testutil.h",
],
copts = tf_copts(),
visibility = ["//visibility:public"],
deps = [
":core_cpu",
":core_cpu_internal",
":core_cpu_lib",
":framework",
":framework_internal",
":lib",
":lib_internal",
":ops",
":protos_all_cc",
":shape_inference_testutil",
":tensor_testutil",
":test",
":testlib_ops",
"//tensorflow/cc:scope",
"//tensorflow/core/kernels:ops_testutil",
"//tensorflow/core/kernels:ops_util",
] + if_dynamic_kernels(
[],
otherwise = [
"//tensorflow/core/kernels:aggregate_ops",
"//tensorflow/core/kernels:bcast_ops",
"//tensorflow/core/kernels:cast_op",
"//tensorflow/core/kernels:constant_op",
"//tensorflow/core/kernels:identity_op",
"//tensorflow/core/kernels:random_ops",
"//tensorflow/core/kernels:reduction_ops",
"//tensorflow/core/kernels:reshape_op",
],
),
)
cc_library(
name = "testlib_ops",
testonly = 1,
srcs = ["common_runtime/testlib_ops.cc"],
linkstatic = 1, # Seems to be needed since alwayslink is broken in bazel
deps = [
":framework",
":lib",
],
alwayslink = 1,
)
# This is a link-only library to provide a DirectSession
# implementation of the Session interface.
tf_cuda_library(
name = "direct_session",
copts = tf_copts(),
linkstatic = 1,
visibility = ["//visibility:public"],
deps = [
":direct_session_internal",
],
alwayslink = 1,
)
# -----------------------------------------------------------------------------
# MKL targets
cc_library(
name = "mkl_graph_util",
hdrs = ["graph/mkl_graph_util.h"],
)
# -----------------------------------------------------------------------------
# Public Android targets
# List of protos we want on android
filegroup(
name = "android_proto_srcs",
srcs = tf_android_core_proto_sources(CORE_PROTO_SRCS),
visibility = ["//visibility:public"],
)
# Core sources for Android builds.
filegroup(
name = "mobile_srcs_no_runtime",
srcs = [
":protos_all_proto_text_srcs",
":error_codes_proto_text_srcs",
"//tensorflow/core/platform/default/build_config:android_srcs",
"//tensorflow/core/util/ctc:android_srcs",
"//tensorflow/core/platform:legacy_srcs_no_runtime",
"//tensorflow/core/profiler:mobile_srcs",
"//tensorflow/core/lib/bfloat16:bfloat16.h",
"//tensorflow/core/lib/bfloat16:bfloat16.cc",
"//tensorflow/core/lib/gtl:legacy_lib_gtl_all_headers",
] + glob(
[
"client/**/*.cc",
"framework/**/*.h",
"framework/**/*.cc",
"lib/**/*.h",
"lib/**/*.cc",
"public/**/*.h",
"util/**/*.h",
"util/**/*.cc",
],
exclude = [
"**/*test.*",
"**/*testutil*",
"**/*testlib*",
"**/*main.cc",
"debug/**/*",
"framework/op_gen_*",
"framework/node_def_util.*",
"framework/op_kernel.*",
"framework/dataset.*",
"lib/jpeg/**/*",
"lib/png/**/*",
"lib/gif/**/*",
"util/events_writer.*",
"util/stats_calculator.*",
"util/reporter.*",
"user_ops/**/*.cu.cc",
"util/ctc/*.h",
"util/ctc/*.cc",
"util/tensor_bundle/*.h",
"util/tensor_bundle/*.cc",
"common_runtime/gpu/**/*",
"common_runtime/eager/*",
"common_runtime/gpu_device_factory.*",
],
),
visibility = ["//visibility:public"],
)
filegroup(
name = "mobile_srcs_only_runtime",
srcs = [
"//tensorflow/core/common_runtime/eager:srcs",
"//tensorflow/core/kernels:android_srcs",
"//tensorflow/core/util/ctc:android_srcs",
"//tensorflow/core/util/tensor_bundle:android_srcs",
"//tensorflow/c:srcs",
"//tensorflow/c/eager:srcs",
] + glob(
[
"common_runtime/**/*.h",
"common_runtime/**/*.cc",
"graph/**/*.h",
"graph/**/*.cc",
"framework/node_def_util.*",
"framework/op_kernel.*",
"framework/dataset.*",
],
exclude = [
"**/*test.*",
"**/*testutil*",
"**/*testlib*",
"**/*main.cc",
"common_runtime/gpu/**/*",
"common_runtime/gpu_device_factory.*",
"graph/dot.*",
],
),
visibility = ["//visibility:public"],
)
filegroup(
name = "mobile_srcs",
srcs = [
":mobile_srcs_no_runtime",
":mobile_srcs_only_runtime",
],
visibility = ["//visibility:public"],
)
# Native library support for Android applications. Does not contain
# operators, use :android_tensorflow_lib if you want full operator
# support.
#
# If you just need TensorFlow types, e.g. Tensors, use
# :android_tensorflow_lib_lite_no_runtime.
#
# Compiles to a trivial library on non-Android to prevent irrelevant
# build errors. If not building this as part of an android_binary,
# a command such as the following must be used:
# bazel build -c opt tensorflow/core:android_tensorflow_lib \
# --crosstool_top=//external:android/crosstool \
# --cpu=armeabi-v7a \
# --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
cc_library(
name = "android_tensorflow_lib_lite",
srcs = if_android([":android_srcs"]),
copts = tf_copts(android_optimization_level_override = None) + [
"-DSUPPORT_SELECTIVE_REGISTRATION",
],
linkopts = ["-lz"],
tags = [
"manual",
"notap",
],
visibility = ["//visibility:public"],
deps = [
":mobile_additional_lib_deps",
":protos_all_cc_impl",
":stats_calculator_portable",
"//third_party/eigen3",
"@com_google_protobuf//:protobuf",
"@double_conversion//:double-conversion",
"@farmhash_archive//:farmhash",
"@nsync//:nsync_cpp",
],
alwayslink = 1,
)
cc_library(
name = "android_tensorflow_lib_lite_nortti",
srcs = if_android([":android_srcs"]),
copts = tf_copts(android_optimization_level_override = None) + [
"-DSUPPORT_SELECTIVE_REGISTRATION",
] + tf_opts_nortti_if_android(),
linkopts = ["-lz"],
tags = [
"manual",
"notap",
],
visibility = ["//visibility:public"],
deps = [
":mobile_additional_lib_deps",
":protos_all_cc_impl",
":stats_calculator_portable",
"//third_party/eigen3",
"@com_google_protobuf//:protobuf",
"@double_conversion//:double-conversion",
"@farmhash_archive//:farmhash",
"@nsync//:nsync_cpp",
],
alwayslink = 1,
)
cc_library(
name = "mobile_additional_lib_deps",
deps = tf_additional_lib_deps() + [
":platform_base",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/strings",
],
)
cc_library(
name = "emscripten_tensorflow_lib_lite_nortti_lite_protos_no_runtime",
srcs = if_emscripten([":mobile_srcs_no_runtime"]),
copts = ["-DSUPPORT_SELECTIVE_REGISTRATION"] + tf_opts_nortti_if_emscripten(),
defines = ["TENSORFLOW_LITE_PROTOS"],
tags = [
"manual",
"notap",
],
visibility = ["//visibility:public"],
deps = [
":emscripten_proto_lib_no_rtti_lite_runtime",
":mobile_additional_lib_deps",
":stats_calculator_portable",
"//third_party/eigen3",
"@double_conversion//:double-conversion",
"@farmhash_archive//:farmhash",
"@nsync//:nsync_cpp",
"@zlib_archive//:zlib",
],
alwayslink = 1,
)
# Native library support for iOS applications.
#
# bazel build --config=ios_x86_64 \
# :ios_tensorflow_lib
cc_library(
name = "ios_tensorflow_lib",
srcs = if_ios([
":android_op_registrations_and_gradients",
"//tensorflow/core/kernels:android_core_ops",
"//tensorflow/core/kernels:android_extended_ops",
]),
copts = tf_copts() + ["-Os"],
visibility = ["//visibility:public"],
deps = [
":ios_tensorflow_lib_lite",
":protos_all_cc_impl",
"//third_party/eigen3",
"//third_party/fft2d:fft2d_headers",
"@com_google_protobuf//:protobuf",
"@fft2d",
"@gemmlowp",
],
alwayslink = 1,
)
cc_library(
name = "ios_tensorflow_lib_lite",
srcs = if_ios([":android_srcs"]),
copts = tf_copts() + ["-Os"],
visibility = ["//visibility:public"],
deps = [
":mobile_additional_lib_deps",
":protos_all_cc_impl",
":stats_calculator_portable",
"//third_party/eigen3",
"@com_google_protobuf//:protobuf",
"@double_conversion//:double-conversion",
"@farmhash_archive//:farmhash",
"@nsync//:nsync_cpp",
],
alwayslink = 1,
)
cc_library(
name = "ios_tensorflow_test_lib",
testonly = 1,
srcs = if_ios([":android_test_srcs"]),
copts = tf_copts() + ["-Os"],
tags = [
"manual",
"notap",
],
visibility = ["//visibility:public"],
deps = [
":android_test_proto_lib",
":ios_tensorflow_lib",
"//tensorflow/core/platform/default/build_config:gtest",
"//third_party/eigen3",
],
)
# Full TensorFlow library with operator support. Use this unless reducing
# binary size (by packaging a reduced operator set) is a concern.
cc_library(
name = "android_tensorflow_lib",
srcs = if_android([":android_op_registrations_and_gradients"]),
copts = tf_copts(),
tags = [
"manual",
"notap",
],
visibility = ["//visibility:public"],
deps = [
":android_tensorflow_lib_lite",
":protos_all_cc_impl",
"//tensorflow/core/kernels:android_tensorflow_kernels",
"//third_party/eigen3",
"@com_google_protobuf//:protobuf",
],
alwayslink = 1,
)
filegroup(
name = "android_op_registrations_and_gradients",
srcs = ["//tensorflow/c/kernels:android_all_ops"] + glob(
[
"ops/**/*.cc",
"ops/**/*.h",
],
exclude = [
"**/*test.cc",
"**/*testutil*",
"**/*testlib*",
"**/*main.cc",
"**/tpu_*",
],
),
visibility = ["//visibility:public"],
)
filegroup(
name = "android_test_srcs",
# TODO(andrewharp/nhua):
# make more test-related sources portable e.g. "//tensorflow/core/platform:test.cc",
srcs = [
":framework/fake_input.cc",
":framework/fake_input.h",
":framework/shape_inference_testutil.cc",
":framework/shape_inference_testutil.h",
":framework/tensor_testutil.cc",
":framework/tensor_testutil.h",
":util/reporter.cc",
":util/reporter.h",
"//tensorflow/core/platform:test.cc",
"//tensorflow/core/platform:test.h",
],
visibility = ["//visibility:public"],
)
# This is like android_test_srcs, minus the things that are already in android_srcs.
filegroup(
name = "android_test_srcs_no_core",
srcs = [
":framework/shape_inference_testutil.cc",
":framework/shape_inference_testutil.h",
":framework/tensor_testutil.cc",
":framework/tensor_testutil.h",
":util/reporter.cc",
":util/reporter.h",
"//tensorflow/core/platform:test.h",
],
visibility = ["//visibility:public"],
)
# Portable library providing testing functionality for TensorFlow.
cc_library(
name = "android_tensorflow_test_lib",
testonly = 1,
srcs = if_android([":android_test_srcs"]),
hdrs = [
"framework/fake_input.h",
"framework/shape_inference_testutil.h",
"framework/tensor_testutil.h",
"util/reporter.h",
],
copts = tf_copts(android_optimization_level_override = None),
tags = [
"manual",
"notap",
],
visibility = ["//visibility:public"],
deps = [
":android_tensorflow_lib",
":protos_cc",
"//tensorflow/core/platform/default/build_config:gtest",
"//third_party/eigen3",
],
)
# -----------------------------------------------------------------------------
# Libraries with GPU facilities that are useful for writing kernels.
cc_library(
name = "gpu_lib",
srcs = [
"common_runtime/gpu/gpu_event_mgr.cc",
],
hdrs = [
"common_runtime/gpu/gpu_event_mgr.h",
],
copts = tf_copts(),
visibility = ["//visibility:public"],
deps = [
":framework",
":framework_internal",
":lib",
":lib_internal",
":protos_all_cc",
":stream_executor",
],
)
cc_library(
name = "gpu_headers_lib",
hdrs = [
"common_runtime/gpu/gpu_event_mgr.h",
],
visibility = ["//visibility:public"],
)
cc_library(
name = "cuda",
visibility = ["//visibility:public"],
deps = [
"//tensorflow/core/platform/default/build_config:cuda",
],
)
cc_library(
name = "rocm",
visibility = ["//visibility:public"],
deps = [
"//tensorflow/core/platform/default/build_config:rocm",
],
)
# -----------------------------------------------------------------------------
# Clif-related proto libraries.
tf_pyclif_proto_library(
name = "example/example_pyclif",
proto_lib = ":protos_all_cc",
proto_srcfile = "example/example.proto",
visibility = ["//visibility:public"],
)
tf_pyclif_proto_library(
name = "example/feature_pyclif",
proto_lib = ":protos_all_cc",
proto_srcfile = "example/feature.proto",
visibility = ["//visibility:public"],
)
tf_pyclif_proto_library(
name = "framework/cost_graph_pyclif",
proto_lib = ":protos_all_cc",
proto_srcfile = "framework/cost_graph.proto",
visibility = ["//visibility:public"],
)
tf_pyclif_proto_library(
name = "framework/tensor_pyclif",
proto_lib = ":protos_all_cc",
proto_srcfile = "framework/tensor.proto",
visibility = ["//visibility:public"],
)
tf_pyclif_proto_library(
name = "framework/kernel_def_pyclif",
proto_lib = ":protos_all_cc",
proto_srcfile = "framework/kernel_def.proto",
visibility = ["//visibility:public"],
)
tf_pyclif_proto_library(
name = "framework/node_def_pyclif",
proto_lib = ":protos_all_cc",
proto_srcfile = "framework/node_def.proto",
visibility = ["//visibility:public"],
)
tf_pyclif_proto_library(
name = "framework/function_pyclif",
proto_lib = ":protos_all_cc",
proto_srcfile = "framework/function.proto",
visibility = ["//visibility:public"],
)
tf_pyclif_proto_library(
name = "framework/graph_pyclif",
proto_lib = ":protos_all_cc",
proto_srcfile = "framework/graph.proto",
visibility = ["//visibility:public"],
)
tf_pyclif_proto_library(
name = "framework/step_stats_pyclif",
proto_lib = ":protos_all_cc",
proto_srcfile = "framework/step_stats.proto",
visibility = ["//visibility:public"],
)
tf_pyclif_proto_library(
name = "framework/types_pyclif",
proto_lib = ":protos_all_cc",
proto_srcfile = "framework/types.proto",
visibility = ["//visibility:public"],
)
tf_pyclif_proto_library(
name = "protobuf/config_pyclif",
proto_lib = ":protos_all_cc",
proto_srcfile = "protobuf/config.proto",
visibility = ["//visibility:public"],
)
tf_pyclif_proto_library(
name = "protobuf/device_properties_pyclif",
proto_lib = ":protos_all_cc",
proto_srcfile = "protobuf/device_properties.proto",
visibility = ["//visibility:public"],
)
tf_pyclif_proto_library(
name = "protobuf/meta_graph_pyclif",
proto_lib = ":protos_all_cc",
proto_srcfile = "protobuf/meta_graph.proto",
visibility = ["//visibility:public"],
)
tf_pyclif_proto_library(
name = "protobuf/saved_model_pyclif",
proto_lib = ":protos_all_cc",
proto_srcfile = "protobuf/saved_model.proto",
visibility = ["//visibility:public"],
)
tf_pyclif_proto_library(
name = "framework/variable_pyclif",
proto_lib = ":protos_all_cc",
proto_srcfile = "framework/variable.proto",
visibility = ["//visibility:public"],
)
# -----------------------------------------------------------------------------
# Internal targets
tf_proto_library(
name = "autotuning_proto",
srcs = ["protobuf/autotuning.proto"],
cc_api_version = 2,
make_default_target_header_only = True,
provide_cc_alias = True,
visibility = [
"//tensorflow:internal",
],
)
tf_proto_library(
name = "conv_autotuning_proto",
srcs = ["protobuf/conv_autotuning.proto"],
cc_api_version = 2,
make_default_target_header_only = True,
protodeps = [
"//tensorflow/stream_executor:dnn_proto",
],
provide_cc_alias = True,
visibility = [
"//tensorflow:internal",
],
)
tf_proto_library_cc(
name = "worker_proto",
srcs = ["protobuf/worker.proto"],
cc_api_version = 2,
protodeps = tf_additional_all_protos() + [],
visibility = ["//visibility:public"],
)
tf_proto_library_cc(
name = "worker_service_proto",
srcs = ["protobuf/worker_service.proto"],
has_services = 1,
cc_api_version = 2,
cc_stubby_versions = ["2"],
protodeps = [":worker_proto"],
visibility = [
"//tensorflow:internal",
],
)
tf_proto_library_cc(
name = "master_proto",
srcs = ["protobuf/master.proto"],
cc_api_version = 2,
protodeps = tf_additional_all_protos(),
visibility = ["//tensorflow:internal"],
)
tf_proto_library_cc(
name = "master_service_proto",
srcs = ["protobuf/master_service.proto"],
has_services = 1,
cc_api_version = 2,
cc_stubby_versions = ["2"],
protodeps = [":master_proto"],
visibility = [
"//tensorflow:internal",
],
)
tf_proto_library_cc(
name = "eager_service_proto",
srcs = ["protobuf/eager_service.proto"],
has_services = 1,
cc_api_version = 2,
cc_grpc_version = 1,
cc_stubby_versions = ["2"],
protodeps = tf_additional_all_protos(),
visibility = [
"//tensorflow:internal",
],
)
LIB_INTERNAL_PRIVATE_HEADERS = [
"framework/resource_handle.h",
"//tensorflow/core/platform:legacy_lib_internal_headers",
"//tensorflow/core/lib/bfloat16:bfloat16.h",
"//tensorflow/core/lib/gtl:legacy_lib_gtl_all_headers",
] + glob(
[
"lib/**/*.h",
],
exclude = [
"**/*test*",
"lib/gif/**/*",
"lib/jpeg/**/*",
"lib/png/**/*",
],
)
LIB_INTERNAL_PUBLIC_HEADERS = [
"lib/core/blocking_counter.h",
"lib/core/refcount.h",
"//tensorflow/core/lib/gtl:legacy_lib_internal_public_gtl_headers",
"lib/hash/hash.h",
"lib/io/inputbuffer.h",
"lib/io/iterator.h",
"lib/io/snappy/snappy_inputbuffer.h",
"lib/io/snappy/snappy_outputbuffer.h",
"lib/io/zlib_compression_options.h",
"lib/io/zlib_inputstream.h",
"lib/io/zlib_outputbuffer.h",
"lib/monitoring/mobile_counter.h",
"lib/monitoring/mobile_gauge.h",
"lib/monitoring/mobile_sampler.h",
"lib/png/png_io.h",
"lib/random/random.h",
"lib/random/random_distributions.h",
"lib/random/weighted_picker.h",
"lib/strings/base64.h",
"lib/strings/ordered_code.h",
"lib/strings/proto_text_util.h",
"lib/strings/proto_serialization.h",
"lib/strings/scanner.h",
"lib/wav/wav_io.h",
"//tensorflow/core/platform:demangle.h",
"//tensorflow/core/platform:denormal.h",
"//tensorflow/core/platform:host_info.h",
"//tensorflow/core/platform:platform.h",
"//tensorflow/core/platform:monitoring.h",
"//tensorflow/core/platform:protobuf_internal.h",
"//tensorflow/core/platform:setround.h",
"//tensorflow/core/platform:snappy.h",
"//tensorflow/core/platform:tensor_coding.h",
"//tensorflow/core/platform:tracing.h",
"//tensorflow/core/platform:unbounded_work_queue.h",
"//tensorflow/core/platform:legacy_platform_lib_hdrs",
"util/env_var.h",
]
# Replicated for lib_internal and lib_internal_impl.
LIB_INTERNAL_DEFINES = (
tf_additional_lib_defines() + [
"TF_USE_SNAPPY",
] + tf_additional_verbs_lib_defines() +
tf_additional_mpi_lib_defines() +
tf_additional_gdr_lib_defines() +
tf_additional_numa_lib_defines()
)
cc_library(
name = "lib_internal",
srcs = LIB_INTERNAL_PRIVATE_HEADERS,
hdrs = LIB_INTERNAL_PUBLIC_HEADERS,
copts = tf_copts(),
defines = LIB_INTERNAL_DEFINES,
linkopts = select({
"//tensorflow:freebsd": [],
"//tensorflow:windows": [],
"//tensorflow:android": [],
"//conditions:default": [
"-ldl",
"-lpthread",
],
}),
deps = tf_additional_lib_deps() + [
"//tensorflow/core/platform:annotation",
"@com_google_absl//absl/meta:type_traits",
"@com_google_absl//absl/strings",
"//third_party/eigen3",
"@com_google_absl//absl/base:core_headers",
"//tensorflow/core/platform/default/build_config:platformlib",
] + if_static([":lib_internal_impl"]),
)
cc_library(
name = "lib_internal_impl",
srcs = LIB_INTERNAL_PRIVATE_HEADERS + glob(
[
"lib/**/*.cc",
"util/env_var.cc",
],
exclude = [
"**/*test*",
"framework/variant.cc",
"lib/hash/crc32c_accelerate.cc",
"lib/gif/**/*",
"lib/jpeg/**/*",
"lib/png/**/*",
],
) + [
"//tensorflow/core/platform:legacy_monitoring_srcs",
"//tensorflow/core/platform:legacy_platform_lib_srcs",
"//tensorflow/core/platform:legacy_lib_internal_srcs",
],
hdrs = LIB_INTERNAL_PUBLIC_HEADERS,
copts = tf_copts(),
defines = LIB_INTERNAL_DEFINES,
deps = tf_additional_lib_deps() + [
":core_stringpiece",
":lib_hash_crc32c_accelerate_internal",
":lib_proto_parsing",
":platform_strings",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/strings",
"//third_party/eigen3",
"//tensorflow/core/lib/bfloat16",
"//tensorflow/core/platform:abi",
"//tensorflow/core/platform:annotation",
"//tensorflow/core/platform:cpu_info",
"//tensorflow/core/platform:stringprintf",
"//tensorflow/core/platform/default/build_config:platformlib",
"@snappy",
"@zlib_archive//:zlib",
"@double_conversion//:double-conversion",
"@com_google_protobuf//:protobuf",
] + tf_protos_all_impl() + tf_protos_grappler_impl() +
tf_additional_numa_deps(),
)
# File compiled with extra flags to get cpu-specific acceleration.
cc_library(
name = "lib_hash_crc32c_accelerate_internal",
srcs = ["lib/hash/crc32c_accelerate.cc"],
# -msse4.2 enables the use of crc32c compiler builtins.
copts = tf_copts() + if_linux_x86_64(["-msse4.2"]),
)
cc_library(
name = "gif_internal",
srcs = [
"lib/gif/gif_io.cc",
"//tensorflow/core/platform:gif.h",
],
hdrs = ["lib/gif/gif_io.h"],
copts = tf_copts(),
linkopts = select({
"//tensorflow:freebsd": [],
"//tensorflow:windows": [],
"//conditions:default": ["-ldl"],
}),
deps = [
":lib",
":lib_internal",
"//tensorflow/core/platform/default/build_config:gif",
],
)
cc_library(
name = "jpeg_internal",
srcs = [
"lib/jpeg/jpeg_handle.cc",
"lib/jpeg/jpeg_mem.cc",
"//tensorflow/core/platform:jpeg.h",
],
hdrs = [
"lib/jpeg/jpeg_handle.h",
"lib/jpeg/jpeg_mem.h",
],
copts = tf_copts(),
linkopts = select({
"//tensorflow:freebsd": [],
"//tensorflow:windows": [],
"//conditions:default": ["-ldl"],
}),
deps = [
":lib",
":lib_internal",
"//tensorflow/core/platform/default/build_config:jpeg",
],
)
cc_library(
name = "png_internal",
srcs = ["lib/png/png_io.cc"],
hdrs = [
"lib/core/stringpiece.h",
"lib/png/png_io.h",
"//tensorflow/core/lib/bfloat16:bfloat16.h",
"//tensorflow/core/platform:byte_order.h",
"//tensorflow/core/platform:cpu_info.h",
"//tensorflow/core/platform:default/integral_types.h",
"//tensorflow/core/platform:default/logging.h",
"//tensorflow/core/platform:logging.h",
"//tensorflow/core/platform:macros.h",
"//tensorflow/core/platform:platform.h",
"//tensorflow/core/platform:png.h",
"//tensorflow/core/platform:tstring.h",
"//tensorflow/core/platform:types.h",
],
copts = tf_copts(),
linkopts = select({
"//tensorflow:freebsd": [],
"//tensorflow:windows": [],
"//conditions:default": ["-ldl"],
}),
deps = [
":lib",
":lib_internal",
"//tensorflow/core/platform/default/build_config:png",
"@com_google_absl//absl/base",
"@com_google_absl//absl/strings",
"@zlib_archive//:zlib",
],
)
cc_library(
name = "tflite_portable_logging",
hdrs = [
"//tensorflow/core/lib/bfloat16:bfloat16.h",
"//tensorflow/core/platform:default/integral_types.h",
"//tensorflow/core/platform:default/logging.h",
"//tensorflow/core/platform:logging.h",
"//tensorflow/core/platform:macros.h",
"//tensorflow/core/platform:platform.h",
"//tensorflow/core/platform:tstring.h",
"//tensorflow/core/platform:types.h",
],
copts = tf_copts(),
linkopts = ["-ldl"],
deps = [
":platform_base",
"//tensorflow/core/platform/default/build_config:logging",
],
)
cc_library(
name = "android_jpeg_internal",
srcs = if_android([
"lib/jpeg/jpeg_handle.cc",
"lib/jpeg/jpeg_mem.cc",
"//tensorflow/core/platform:jpeg.h",
]),
hdrs = [
"lib/core/stringpiece.h",
"lib/jpeg/jpeg_handle.h",
"lib/jpeg/jpeg_mem.h",
"//tensorflow/core/lib/bfloat16:bfloat16.h",
"//tensorflow/core/platform:default/dynamic_annotations.h",
"//tensorflow/core/platform:default/integral_types.h",
"//tensorflow/core/platform:default/logging.h",
"//tensorflow/core/platform:dynamic_annotations.h",
"//tensorflow/core/platform:logging.h",
"//tensorflow/core/platform:macros.h",
"//tensorflow/core/platform:mem.h",
"//tensorflow/core/platform:platform.h",
"//tensorflow/core/platform:stringpiece.h",
"//tensorflow/core/platform:tstring.h",
"//tensorflow/core/platform:types.h",
],
copts = tf_copts(),
linkopts = ["-ldl"],
deps = [
":core_stringpiece",
"//tensorflow/core/platform:stringpiece",
"//tensorflow/core/platform/default/build_config:jpeg",
"//tensorflow/core/platform/default/build_config:logging",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/strings",
],
)
cc_library(
name = "android_gif_internal",
srcs = if_android([
"lib/gif/gif_io.cc",
"//tensorflow/core/platform:gif.h",
"lib/strings/strcat.h",
"lib/strings/numbers.h",
]),
hdrs = [
"lib/core/stringpiece.h",
"lib/gif/gif_io.h",
"//tensorflow/core/lib/bfloat16:bfloat16.h",
"//tensorflow/core/lib/gtl:legacy_android_gif_internal_headers",
"//tensorflow/core/platform:default/dynamic_annotations.h",
"//tensorflow/core/platform:default/integral_types.h",
"//tensorflow/core/platform:default/logging.h",
"//tensorflow/core/platform:dynamic_annotations.h",
"//tensorflow/core/platform:logging.h",
"//tensorflow/core/platform:macros.h",
"//tensorflow/core/platform:mem.h",
"//tensorflow/core/platform:platform.h",
"//tensorflow/core/platform:tstring.h",
"//tensorflow/core/platform:types.h",
],
copts = tf_copts(),
linkopts = ["-ldl"],
deps = [
"//tensorflow/core/platform/default/build_config:gif",
"//tensorflow/core/platform/default/build_config:logging",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/strings",
],
)
cc_library(
name = "android_png_internal",
srcs = if_android([
"lib/png/png_io.cc",
"//tensorflow/core/platform:png.h",
]),
hdrs = [
"lib/core/stringpiece.h",
"lib/png/png_io.h",
"//tensorflow/core/lib/bfloat16:bfloat16.h",
"//tensorflow/core/platform:byte_order.h",
"//tensorflow/core/platform:cpu_info.h",
"//tensorflow/core/platform:default/integral_types.h",
"//tensorflow/core/platform:default/logging.h",
"//tensorflow/core/platform:logging.h",
"//tensorflow/core/platform:macros.h",
"//tensorflow/core/platform:platform.h",
"//tensorflow/core/platform:tstring.h",
"//tensorflow/core/platform:types.h",
],
copts = tf_copts(),
linkopts = ["-ldl"],
deps = [
"//tensorflow/core/platform/default/build_config:logging",
"@com_google_absl//absl/strings",
"@png_archive//:png",
],
)
tf_proto_library(
name = "error_codes_proto",
srcs = ERROR_CODES_PROTO_SRCS,
cc_api_version = 2,
make_default_target_header_only = True,
provide_cc_alias = True,
)
tf_generate_proto_text_sources(
name = "error_codes_proto_text",
srcs = ERROR_CODES_PROTO_SRCS,
protodeps = [],
srcs_relative_dir = "tensorflow/core/",
deps = [
":error_codes_proto_cc",
":lib_internal",
],
)
tf_proto_library(
name = "protos_all_proto",
srcs = COMMON_PROTO_SRCS + ADDITIONAL_CORE_PROTO_SRCS,
cc_api_version = 2,
make_default_target_header_only = True,
protodeps = [
":error_codes_proto",
],
)
tf_generate_proto_text_sources(
name = "protos_all_proto_text",
srcs = COMMON_PROTO_SRCS,
protodeps = ERROR_CODES_PROTO_SRCS,
srcs_relative_dir = "tensorflow/core/",
visibility = ["//visibility:public"],
deps = [
":error_codes_proto_text",
":lib_internal",
":protos_all_proto_cc",
],
)
cc_library(
name = "proto_text",
hdrs = [
":error_codes_proto_text_hdrs",
":protos_all_proto_text_hdrs",
],
deps = [
":lib",
":lib_internal",
":protos_all_cc",
],
)
tf_version_info_genrule()
cc_library(
name = "version_lib",
srcs = ["util/version_info.cc"],
hdrs = ["public/version.h"],
copts = tf_copts(),
)
FRAMEWORK_INTERNAL_PRIVATE_HEADERS = [
"graph/edgeset.h",
"graph/graph.h",
"graph/graph_def_builder.h",
"graph/node_builder.h",
"graph/tensor_id.h",
] + glob(
[
"example/**/*.h",
"framework/**/*.h",
"util/**/*.h",
],
exclude = [
"**/*test*",
"**/*main.cc",
"example/example_parser_configuration.*",
"util/reporter.h",
"util/reporter.cc",
"framework/fake_input.*",
"framework/op_gen_lib.*",
"framework/reader_base.*",
"util/memmapped_file_system.*",
"util/memmapped_file_system_writer.*",
"util/session_message.*",
"util/version_info.cc",
],
) + select({
"//tensorflow:windows": [],
"//conditions:default": [
"util/memmapped_file_system.h",
"util/memmapped_file_system_writer.h",
],
})
FRAMEWORK_INTERNAL_PUBLIC_HEADERS = [
"framework/model.h", # only needed for tests
"framework/op_segment.h",
"framework/rendezvous.h", # only needed for tests
"framework/resource_var.h",
"framework/run_handler.h",
"framework/run_handler_util.h",
"framework/tensor_reference.h",
"framework/tracking_allocator.h", # only needed for tests
"framework/unique_tensor_references.h",
"framework/variant.h",
"util/command_line_flags.h",
"util/equal_graph_def.h",
"util/presized_cuckoo_map.h",
"util/tensor_slice_set.h",
"util/tensor_slice_util.h",
]
tf_cuda_library(
name = "framework_internal",
srcs = FRAMEWORK_INTERNAL_PRIVATE_HEADERS,
hdrs = FRAMEWORK_INTERNAL_PUBLIC_HEADERS,
deps = [
":framework_internal_headers_lib",
"//third_party/eigen3",
":lib",
] + if_static(
extra_deps = [
":framework_internal_impl",
"@com_google_protobuf//:protobuf",
],
otherwise = [
"@com_google_protobuf//:protobuf_headers",
],
),
alwayslink = 1,
)
cc_header_only_library(
name = "framework_internal_headers_lib",
# Fully depend on external repositories, because identifying the headers
# is fragile.
extra_deps = [
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:span",
],
deps = [
":lib",
":lib_internal",
":version_lib",
"//tensorflow/core/kernels:bounds_check",
"//tensorflow/core/platform/default/build_config:platformlib",
],
)
cc_header_only_library(
name = "core_cpu_headers_lib",
visibility = ["//visibility:public"],
deps = [
":core_cpu_lib",
],
)
tf_cuda_library(
name = "framework_internal_impl",
srcs = FRAMEWORK_INTERNAL_PRIVATE_HEADERS + glob(
[
"example/**/*.cc",
"framework/**/*.cc",
"util/**/*.cc",
"graph/edgeset.cc",
"graph/graph.cc",
"graph/graph_def_builder.cc",
"graph/node_builder.cc",
"graph/tensor_id.cc",
"graph/while_context.h",
"graph/while_context.cc",
],
exclude = [
"**/*test*",
"**/*main.cc",
"framework/allocator.cc",
"framework/cpu_allocator_impl.cc",
"framework/allocator_registry.cc",
"framework/tracking_allocator.cc",
"example/example_parser_configuration.*",
"example/feature_util.cc",
"util/reporter.cc",
"framework/fake_input.*",
"framework/op_gen_lib.*",
"framework/reader_base.*",
"util/memmapped_file_system.*",
"util/memmapped_file_system_writer.*",
"util/stats_calculator.*",
"util/version_info.cc",
"util/env_var.cc",
],
) + select({
"//tensorflow:windows": [],
"//conditions:default": [
"util/memmapped_file_system.cc",
"util/memmapped_file_system_writer.cc",
],
}),
hdrs = FRAMEWORK_INTERNAL_PUBLIC_HEADERS,
copts = tf_copts(),
linkopts = select({
"//tensorflow:freebsd": ["-lm"],
"//tensorflow:windows": [],
"//conditions:default": [
"-ldl",
"-lm",
],
}),
deps = [
":allocator_registry_impl",
":allocator",
":feature_util",
":lib",
":lib_internal",
":protos_all_proto_text",
":error_codes_proto_text",
":protos_all_cc",
":stats_calculator_portable",
":version_lib",
"@com_google_absl//absl/base",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/time",
"//tensorflow/core/platform/default/build_config:platformlib",
"//tensorflow/core/kernels:bounds_check",
"//tensorflow/core/profiler/lib:traceme",
"//third_party/eigen3",
] + if_static(
extra_deps = ["@com_google_protobuf//:protobuf"],
otherwise = ["@com_google_protobuf//:protobuf_headers"],
) + mkl_deps(),
alwayslink = 1,
)
cc_header_only_library(
name = "framework_headers_lib",
# Fully depend on external repositories, because identifying the headers
# is fragile.
extra_deps = [
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:span",
],
visibility = ["//visibility:public"],
deps = [
":framework",
":reader_base",
],
)
cc_header_only_library(
name = "stream_executor_headers_lib",
# Fully depend on external repositories, because identifying the headers
# is fragile.
extra_deps = [
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:span",
],
visibility = ["//visibility:public"],
deps = [
":stream_executor",
],
)
tf_cuda_library(
name = "stream_executor",
srcs = ["//tensorflow/core/platform:stream_executor.h"],
hdrs = [
"//tensorflow/core/platform:cuda.h",
"//tensorflow/core/platform:rocm.h",
"//tensorflow/core/platform:stream_executor.h",
],
deps = [
"//tensorflow/core/platform/default/build_config:stream_executor",
],
)
# Like stream_executor library, but compiles without --config=cuda
# and does not include any cuda dependencies.
cc_library(
name = "stream_executor_no_cuda",
srcs = ["//tensorflow/core/platform:stream_executor.h"],
hdrs = [
"//tensorflow/core/platform:stream_executor_no_cuda.h",
],
visibility = ["//visibility:public"],
deps = [
"//tensorflow/core/platform/default/build_config:stream_executor_no_cuda",
],
)
tf_cuda_library(
name = "cuda_device_functions",
hdrs = [
"util/gpu_device_functions.h",
],
visibility = ["//visibility:public"],
deps = [":framework_lite"],
)
# TODO(josh11b): Is this needed, or can we just use ":protos_all_cc"?
cc_library(
name = "protos_cc",
visibility = ["//visibility:public"],
deps = ["//tensorflow/core/platform/default/build_config:protos_cc"],
)
# Library containing all of the graph construction code that is
# independent of the runtime.
#
# TODO(mrry): Refactor graph_constructor.cc so that it does not depend on code
# in "common_runtime/", and then the entire "graph/" directory can be included
# in this library.
GRAPH_HDRS = [
"graph/algorithm.h",
"graph/collective_order.h",
"graph/colors.h",
"graph/control_flow.h",
"graph/costmodel.h",
"graph/default_device.h",
"graph/edgeset.h",
"graph/graph.h",
"graph/graph_constructor.h", # NOTE(mrry): Don't include the .cc since it depends on common_runtime.
"graph/graph_def_builder.h",
"graph/graph_def_builder_util.h",
"graph/graph_partition.h",
"graph/mkl_layout_pass.h",
"graph/mkl_tfconversion_pass.h",
"graph/node_builder.h",
"graph/optimizer_cse.h",
"graph/subgraph.h",
"graph/tensor_id.h",
"graph/testlib.h",
"graph/types.h",
"graph/validate.h",
"graph/while_context.h",
]
tf_cuda_library(
name = "graph",
srcs = [
"graph/algorithm.cc",
"graph/collective_order.cc",
"graph/colors.cc",
"graph/control_flow.cc",
"graph/costmodel.cc",
"graph/graph_partition.cc",
"graph/optimizer_cse.cc",
"graph/subgraph.cc",
"graph/validate.cc",
],
hdrs = GRAPH_HDRS,
deps = [
":framework",
":framework_internal",
":lib",
":lib_internal",
":proto_text",
":protos_all_cc",
"//third_party/eigen3",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/strings",
],
)
CORE_CPU_BASE_HDRS = GRAPH_HDRS + [
"common_runtime/device.h",
"common_runtime/device_factory.h",
"common_runtime/device_mgr.h",
"common_runtime/device_set.h",
"common_runtime/eval_const_tensor.h",
"common_runtime/graph_runner.h",
"common_runtime/shape_refiner.h",
"framework/versions.h",
"common_runtime/process_function_library_runtime.h",
"common_runtime/function.h",
"common_runtime/scoped_allocator.h",
"common_runtime/scoped_allocator_mgr.h",
]
tf_cuda_library(
name = "core_cpu_base",
hdrs = CORE_CPU_BASE_HDRS + ["public/session.h"],
copts = tf_copts(),
deps = [":core_cpu_base_no_ops"] + if_static([
":function_ops_op_lib",
":functional_grad",
":functional_ops_op_lib",
"//tensorflow/core/kernels:bounds_check",
"//tensorflow/core/kernels:required",
]),
alwayslink = 1,
)
tf_cuda_library(
name = "core_cpu_base_no_ops",
srcs = [
"common_runtime/eval_const_tensor.cc",
"common_runtime/scoped_allocator.cc",
"common_runtime/scoped_allocator_mgr.cc",
"common_runtime/shape_refiner.cc",
"common_runtime/graph_optimizer.h",
"graph/graph_constructor.cc", # Depends on common_runtime.
"graph/graph_def_builder_util.cc", # Depends on common_runtime.
"public/session_options.h",
"public/version.h",
] + CORE_CPU_BASE_HDRS,
hdrs = CORE_CPU_BASE_HDRS + ["public/session.h"],
copts = tf_copts(),
deps = [
":graph",
":framework",
":framework_internal",
":lib",
":lib_internal",
":proto_text",
":protos_all_cc",
"@com_google_absl//absl/container:flat_hash_set",
"//third_party/eigen3",
] + if_static([
"@com_google_absl//absl/algorithm:container",
]),
)
CORE_CPU_LIB_HEADERS = CORE_CPU_BASE_HDRS + [
"common_runtime/allocator_retry.h",
"common_runtime/shared_counter.h",
"common_runtime/base_collective_executor.h",
"common_runtime/bfc_allocator.h",
"common_runtime/hierarchical_tree_broadcaster.h",
"common_runtime/buf_rendezvous.h",
"common_runtime/build_graph_options.h",
"common_runtime/collective_executor_mgr.h",
"common_runtime/collective_param_resolver_local.h",
"common_runtime/collective_rma_local.h",
"common_runtime/collective_util.h",
"common_runtime/colocation_graph.h",
"common_runtime/constant_folding.h",
"common_runtime/copy_tensor.h",
"common_runtime/costmodel_manager.h",
"common_runtime/placer_inspection_required_ops_utils.h",
"common_runtime/debugger_state_interface.h",
"common_runtime/device_resolver_local.h",
"common_runtime/dma_helper.h",
"common_runtime/executor.h",
"common_runtime/executor_factory.h",
"common_runtime/graph_optimizer.h",
"common_runtime/input_colocation_exemption_registry.h",
"common_runtime/isolate_placer_inspection_required_ops_pass.h",
"common_runtime/local_device.h",
"common_runtime/lower_function_call_op.h",
"common_runtime/lower_if_op.h",
"common_runtime/lower_case_op.h",
"common_runtime/lower_functional_ops.h",
"common_runtime/lower_while_op.h",
"common_runtime/memory_types.h",
"common_runtime/metrics.h",
"common_runtime/mkl_cpu_allocator.h",
"common_runtime/optimization_registry.h",
"common_runtime/pending_counts.h",
"common_runtime/partitioning_utils.h",
"common_runtime/placer.h",
"common_runtime/process_util.h",
"common_runtime/inspecting_placer.h",
"common_runtime/profile_handler.h",
"common_runtime/renamed_device.h",
"common_runtime/rendezvous_mgr.h",
"common_runtime/rendezvous_util.h",
"common_runtime/ring_reducer.h",
"common_runtime/ring_alg.h",
"common_runtime/ring_gatherer.h",
"common_runtime/session_factory.h",
"common_runtime/single_threaded_cpu_device.h",
"common_runtime/stats_publisher_interface.h",
"common_runtime/step_stats_collector.h",
"common_runtime/threadpool_device.h",
"common_runtime/process_state.h",
"common_runtime/pool_allocator.h",
"graph/gradients.h",
"graph/quantize_training.h",
] + if_mkl(["graph/mkl_graph_util.h"])
tf_cuda_library(
name = "core_cpu_impl",
srcs = [
"common_runtime/accumulate_n_optimizer.cc",
"common_runtime/base_collective_executor.cc",
"common_runtime/buf_rendezvous.cc",
"common_runtime/build_graph_options.cc",
"common_runtime/collective_executor_mgr.cc",
"common_runtime/collective_param_resolver_local.cc",
"common_runtime/collective_rma_local.cc",
"common_runtime/collective_util.cc",
"common_runtime/colocation_graph.cc",
"common_runtime/constant_folding.cc",
"common_runtime/copy_tensor.cc",
"common_runtime/costmodel_manager.cc",
"common_runtime/debugger_state_interface.cc",
"common_runtime/device.cc",
"common_runtime/device_factory.cc",
"common_runtime/device_mgr.cc",
"common_runtime/device_resolver_local.cc",
"common_runtime/device_set.cc",
"common_runtime/executor.cc",
"common_runtime/executor_factory.cc",
"common_runtime/function.cc",
"common_runtime/graph_optimizer.cc",
"common_runtime/graph_runner.cc",
"common_runtime/hierarchical_tree_broadcaster.cc",
"common_runtime/input_colocation_exemption_registry.cc",
"common_runtime/inspecting_placer.cc",
"common_runtime/isolate_placer_inspection_required_ops_pass.cc",
"common_runtime/local_device.cc",
"common_runtime/lower_case_op.cc",
"common_runtime/lower_function_call_op.cc",
"common_runtime/lower_functional_ops.cc",
"common_runtime/lower_if_op.cc",
"common_runtime/lower_while_op.cc",
"common_runtime/memory_types.cc",
"common_runtime/metrics.cc",
"common_runtime/mkl_cpu_allocator.cc",
"common_runtime/optimization_registry.cc",
"common_runtime/parallel_concat_optimizer.cc",
"common_runtime/partitioning_utils.cc",
"common_runtime/placer.cc",
"common_runtime/placer_inspection_required_ops_utils.cc",
"common_runtime/placer_inspection_required_ops_utils.h",
"common_runtime/pool_allocator.cc",
"common_runtime/process_function_library_runtime.cc",
"common_runtime/process_state.cc",
"common_runtime/process_util.cc",
"common_runtime/renamed_device.cc",
"common_runtime/rendezvous_mgr.cc",
"common_runtime/rendezvous_util.cc",
"common_runtime/ring_alg.cc",
"common_runtime/ring_gatherer.cc",
"common_runtime/ring_reducer.cc",
"common_runtime/session.cc",
"common_runtime/session_factory.cc",
"common_runtime/session_options.cc",
"common_runtime/session_state.cc",
"common_runtime/single_threaded_cpu_device.cc",
"common_runtime/stats_publisher_interface.cc",
"common_runtime/step_stats_collector.cc",
"common_runtime/threadpool_device.cc",
"common_runtime/threadpool_device_factory.cc",
"graph/gradients.cc",
"graph/mkl_layout_pass.cc",
"graph/mkl_tfconversion_pass.cc",
"graph/quantize_training.cc",
"public/session.h",
"public/session_options.h",
"public/version.h",
],
hdrs = CORE_CPU_LIB_HEADERS,
copts = tf_copts(),
deps = [
":bfc_allocator",
":graph",
":framework",
":framework_internal",
":lib",
":lib_internal",
":proto_text",
":protos_all_cc",
"@com_google_absl//absl/algorithm:container",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:optional",
"//third_party/eigen3",
"//tensorflow/core/grappler/utils:functions",
"//tensorflow/core/profiler/lib:traceme",
"//tensorflow/core/profiler/internal:traceme_recorder",
] + mkl_deps(),
alwayslink = 1,
)
tf_cuda_library(
name = "core_cpu_lib",
hdrs = CORE_CPU_LIB_HEADERS,
deps = [
":core_cpu_base",
":proto_text",
"//tensorflow/core/grappler:grappler_item",
] + if_static([":core_cpu_impl"]) + tf_protos_all() + tf_protos_grappler(),
)
tf_cuda_library(
name = "core_cpu_lib_no_ops",
hdrs = CORE_CPU_LIB_HEADERS,
deps = [
":core_cpu_base_no_ops",
":proto_text",
"//tensorflow/core/grappler:grappler_item",
] + tf_protos_all() + tf_protos_grappler(),
)
tf_cuda_library(
name = "core_cpu_internal",
srcs = [
"common_runtime/graph_execution_state.cc",
],
hdrs = [
"common_runtime/graph_execution_state.h",
] + CORE_CPU_LIB_HEADERS,
copts = tf_copts(),
deps = [
":framework",
":graph",
":lib",
":proto_text",
":protos_all_cc",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/strings",
"//tensorflow/core/grappler:grappler_item",
"//tensorflow/core/grappler/clusters:utils",
"//tensorflow/core/grappler/clusters:virtual_cluster",
"//tensorflow/core/grappler/optimizers:meta_optimizer",
"//third_party/eigen3",
] + mkl_deps() + tf_additional_core_deps() + if_static([
":core_cpu_impl",
":function_ops_op_lib",
":functional_grad",
":functional_ops_op_lib",
"//tensorflow/core/kernels:required",
]),
alwayslink = 1,
)
# This is redundant with the "core_cpu_*" targets above. It's useful for
# applications that want to depend on a minimal subset of TensorFlow (e.g. XLA).
cc_library(
name = "bfc_allocator",
srcs = [
"common_runtime/allocator_retry.cc",
"common_runtime/allocator_retry.h",
"common_runtime/bfc_allocator.cc",
],
hdrs = ["common_runtime/bfc_allocator.h"],
features = ["parse_headers"],
visibility = ["//visibility:public"],
deps = [
":allocator",
":lib",
":lib_internal",
":shared_counter",
"@com_google_absl//absl/container:flat_hash_set",
],
)
cc_library(
name = "shared_counter",
hdrs = ["common_runtime/shared_counter.h"],
features = ["parse_headers"],
visibility = ["//visibility:public"],
deps = [
":lib",
],
)
cc_library(
name = "regexp_internal",
hdrs = [
"//tensorflow/core/platform:regexp.h",
],
visibility = [
"//tensorflow/compiler:__subpackages__",
"//tensorflow/core/kernels:__subpackages__",
"//tensorflow/core/profiler:__subpackages__",
"//tensorflow/stream_executor:__subpackages__",
],
deps = [":lib_internal"],
)
tf_cuda_library(
name = "direct_session_internal",
srcs = ["common_runtime/direct_session.cc"],
hdrs = [
"common_runtime/direct_session.h",
"util/env_var.h",
],
copts = tf_copts(),
deps = [
":core_cpu_internal",
":framework",
":framework_internal",
":graph",
":lib",
":lib_experimental",
":lib_internal",
":proto_text",
":protos_all_cc",
"//tensorflow/core/debug:debug_graph_utils",
"//tensorflow/core/kernels:function_ops",
"//tensorflow/core/profiler/lib:profiler_lib",
"//tensorflow/core/profiler/lib:profiler_session",
"//tensorflow/core/profiler/lib:traceme",
"@com_google_absl//absl/container:flat_hash_set",
],
alwayslink = 1,
)
cc_library(
name = "example_parser_configuration",
srcs = ["example/example_parser_configuration.cc"],
hdrs = ["example/example_parser_configuration.h"],
copts = tf_copts(),
linkstatic = 1,
visibility = ["//visibility:public"],
deps = [
":core_cpu",
":core_cpu_internal",
":framework",
":lib",
":lib_internal",
":proto_text",
":protos_all_cc",
],
alwayslink = 1,
)
tf_cuda_library(
name = "device_tracer",
srcs = [
"//tensorflow/core/platform:legacy_device_tracer_srcs",
],
copts = tf_copts(),
cuda_deps = tf_additional_cupti_wrapper_deps() + tf_additional_device_tracer_cuda_deps(),
visibility = [
"//tensorflow:internal",
],
deps = [
":core_cpu_internal",
":lib",
":protos_all_cc",
"@com_google_absl//absl/flags:flag",
"//tensorflow/core/profiler/internal:profiler_interface",
] + tf_additional_device_tracer_deps(),
alwayslink = True,
)
tf_proto_library_cc(
name = "replay_log_proto",
srcs = ["protobuf/replay_log.proto"],
cc_api_version = 2,
protodeps = [
":master_proto",
] + tf_additional_all_protos(),
visibility = [
"//tensorflow:internal",
],
)
cc_library(
name = "gpu_id",
hdrs = [
"common_runtime/gpu/gpu_id.h",
"common_runtime/gpu/gpu_id_manager.h",
],
deps = [