提交 ea0c4e61 编写于 作者: A A. Unique TensorFlower 提交者: TensorFlower Gardener

Stop exporting tensorflow/core/util:*.cc files and move framework

targets and tests from tensorflow/core to tensorflow/core/util.

PiperOrigin-RevId: 285843378
Change-Id: Ibeece4c1d3ab69cb6805790f369d6fc04ac434e3
上级 388e27d7
......@@ -79,7 +79,6 @@ load(
"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",
......@@ -492,7 +491,7 @@ cc_library(
"//tensorflow/core/lib/monitoring:legacy_lib_monitoring_lib_headers",
"//tensorflow/core/lib/random:legacy_lib_random_headers",
"//tensorflow/core/lib/strings:legacy_lib_string_headers",
"//tensorflow/core/util:gpu_cuda_alias.h",
"//tensorflow/core/util:lib_hdrs",
],
visibility = ["//visibility:public"],
deps = [
......@@ -556,7 +555,7 @@ cc_library(
"//tensorflow/core/lib/core:legacy_lib_core_status_test_util_header",
"//tensorflow/core/platform:test.h",
"//tensorflow/core/platform:test_benchmark.h",
"//tensorflow/core/util:reporter.h",
"//tensorflow/core/util:test_hdrs",
],
copts = tf_copts(),
linkopts = select({
......@@ -644,38 +643,7 @@ tf_cuda_library(
"//tensorflow/core/framework:variant_op_registry.h",
"//tensorflow/core/framework:variant_tensor_data.h",
"//tensorflow/core/util/sparse:framework_group",
"//tensorflow/core/util:activation_mode.h",
"//tensorflow/core/util:batch_util.h",
"//tensorflow/core/util:bcast.h",
"//tensorflow/core/util:debug_events_writer.h",
"//tensorflow/core/util:device_name_utils.h",
"//tensorflow/core/util:dump_graph.h",
"//tensorflow/core/util:einsum_op_util.h",
"//tensorflow/core/util:events_writer.h",
"//tensorflow/core/util:example_proto_fast_parsing.h",
"//tensorflow/core/util:example_proto_helper.h",
"//tensorflow/core/util:gpu_kernel_helper.h",
"//tensorflow/core/util:guarded_philox_random.h",
"//tensorflow/core/util:matmul_autotune.h",
"//tensorflow/core/util:matmul_bcast.h",
"//tensorflow/core/util:mirror_pad_mode.h",
"//tensorflow/core/util:padding.h",
"//tensorflow/core/util:port.h",
"//tensorflow/core/util:ptr_util.h",
"//tensorflow/core/util:reffed_status_callback.h",
"//tensorflow/core/util:saved_tensor_slice_util.h",
"//tensorflow/core/util:stat_summarizer.h",
"//tensorflow/core/util:stat_summarizer_options.h",
"//tensorflow/core/util:stream_executor_util.h",
"//tensorflow/core/util:strided_slice_op.h",
"//tensorflow/core/util:tensor_format.h",
"//tensorflow/core/util:tensor_ops_util.h",
"//tensorflow/core/util:tensor_slice_reader.h",
"//tensorflow/core/util:tensor_slice_reader_cache.h",
"//tensorflow/core/util:tensor_slice_writer.h",
"//tensorflow/core/util:use_cudnn.h",
"//tensorflow/core/util:util.h",
"//tensorflow/core/util:work_sharder.h",
"//tensorflow/core/util:framework_srcs",
"public/version.h",
] + select({
"//tensorflow:windows": [],
......@@ -683,7 +651,7 @@ tf_cuda_library(
"//tensorflow/core/util:memmapped_file_system_hdrs",
],
}) + if_mkl([
"//tensorflow/core/util:mkl_util.h",
"//tensorflow/core/util:mkl_util_hdrs",
]),
visibility = ["//visibility:public"],
deps = [
......@@ -706,24 +674,19 @@ alias(
visibility = ["//visibility:public"],
)
cc_library(
alias(
name = "overflow",
hdrs = ["//tensorflow/core/util:overflow.h"],
deps = [
":framework_lite",
":lib",
],
actual = "//tensorflow/core/util:overflow",
)
cc_library(
alias(
name = "exec_on_stall",
hdrs = ["//tensorflow/core/util:exec_on_stall.h"],
deps = [":framework_lite"],
actual = "//tensorflow/core/util:exec_on_stall",
)
cc_library(
alias(
name = "ptr_util",
hdrs = ["//tensorflow/core/util:ptr_util.h"],
actual = "//tensorflow/core/util:ptr_util",
)
# TODO(gonnet): Remove this alias once all users have been moved to the actual target.
......@@ -1748,8 +1711,7 @@ filegroup(
"//tensorflow/core/framework:android_test_hdrs",
"//tensorflow/core/framework:android_test_srcs",
"//tensorflow/core/platform:test.h",
"//tensorflow/core/util:reporter.cc",
"//tensorflow/core/util:reporter.h",
"//tensorflow/core/util:android_test_srcs",
],
visibility = ["//visibility:public"],
)
......@@ -1761,8 +1723,7 @@ filegroup(
"//tensorflow/core/framework:android_test_hdrs",
"//tensorflow/core/framework:android_test_srcs_no_core",
"//tensorflow/core/platform:test.h",
"//tensorflow/core/util:reporter.cc",
"//tensorflow/core/util:reporter.h",
"//tensorflow/core/util:android_test_srcs",
],
visibility = ["//visibility:public"],
)
......@@ -1774,6 +1735,7 @@ cc_library(
srcs = if_android([":android_test_srcs"]),
hdrs = [
"//tensorflow/core/framework:android_test_hdrs",
"//tensorflow/core/util:android_test_hdrs",
],
copts = tf_copts(android_optimization_level_override = None),
tags = [
......@@ -2012,7 +1974,7 @@ LIB_INTERNAL_PUBLIC_HEADERS = [
"//tensorflow/core/platform:tracing.h",
"//tensorflow/core/platform:unbounded_work_queue.h",
"//tensorflow/core/platform:legacy_platform_lib_hdrs",
"//tensorflow/core/util:env_var.h",
"//tensorflow/core/util:lib_internal_public_hdrs",
]
cc_library(
......@@ -2402,11 +2364,9 @@ alias(
actual = "//tensorflow/core/lib/core:error_codes_proto_cc",
)
cc_library(
alias(
name = "version_lib",
srcs = ["//tensorflow/core/util:version_info.cc"],
hdrs = ["public/version.h"],
copts = tf_copts(),
actual = "//tensorflow/core/util:version_info",
)
FRAMEWORK_INTERNAL_PRIVATE_HEADERS = [
......@@ -2621,13 +2581,10 @@ cc_library(
],
)
tf_cuda_library(
alias(
name = "cuda_device_functions",
hdrs = [
"//tensorflow/core/util:gpu_device_functions.h",
],
actual = "//tensorflow/core/util:gpu_device_functions",
visibility = ["//visibility:public"],
deps = [":framework_lite"],
)
# TODO(josh11b): Is this needed, or can we just use ":protos_all_cc"?
......@@ -3006,7 +2963,7 @@ tf_cuda_library(
srcs = ["common_runtime/direct_session.cc"],
hdrs = [
"common_runtime/direct_session.h",
"//tensorflow/core/util:env_var.h",
"//tensorflow/core/util:lib_internal_public_hdrs",
],
copts = tf_copts(),
deps = [
......@@ -3513,30 +3470,6 @@ tf_cc_test(
],
)
tf_cc_test(
name = "util_overflow_test",
size = "small",
srcs = ["//tensorflow/core/util:overflow_test.cc"],
deps = [
":framework_lite",
":overflow",
":test",
":test_main",
],
)
tf_cc_test(
name = "exec_on_stall_test",
size = "small",
srcs = ["//tensorflow/core/util:exec_on_stall_test.cc"],
deps = [
":exec_on_stall",
":framework_lite",
":test",
":test_main",
],
)
tf_cc_test(
name = "lib_jpeg_jpeg_mem_unittest",
srcs = ["lib/jpeg/jpeg_mem_unittest.cc"],
......@@ -3628,6 +3561,7 @@ test_suite(
tests = [
":core_higher_level_tests",
"//tensorflow/core/framework:higher_level_tests",
"//tensorflow/core/util:higher_level_tests",
],
)
......@@ -3660,29 +3594,6 @@ tf_cc_tests(
"graph/subgraph_test.cc",
"graph/tensor_id_test.cc",
"graph/validate_test.cc",
"//tensorflow/core/util:bcast_test.cc",
"//tensorflow/core/util:command_line_flags_test.cc",
"//tensorflow/core/util:debug_events_writer_test.cc",
"//tensorflow/core/util:device_name_utils_test.cc",
"//tensorflow/core/util:dump_graph_test.cc",
"//tensorflow/core/util:equal_graph_def_test.cc",
"//tensorflow/core/util:events_writer_test.cc",
"//tensorflow/core/util:example_proto_fast_parsing_test.cc",
"//tensorflow/core/util:example_proto_helper_test.cc",
"//tensorflow/core/util:matmul_bcast_test.cc",
"//tensorflow/core/util:memmapped_file_system_test.cc",
"//tensorflow/core/util:presized_cuckoo_map_test.cc",
"//tensorflow/core/util:reffed_status_callback_test.cc",
"//tensorflow/core/util:reporter_test.cc",
"//tensorflow/core/util:saved_tensor_slice_util_test.cc",
"//tensorflow/core/util:semver_test.cc",
"//tensorflow/core/util:stat_summarizer_test.cc",
"//tensorflow/core/util:tensor_format_test.cc",
"//tensorflow/core/util:tensor_slice_reader_test.cc",
"//tensorflow/core/util:tensor_slice_set_test.cc",
"//tensorflow/core/util:tensor_slice_util_test.cc",
"//tensorflow/core/util:tensor_slice_writer_test.cc",
"//tensorflow/core/util:work_sharder_test.cc",
"//tensorflow/core/util/sparse:higher_level_tests_group",
],
create_named_test_suite = True,
......@@ -3910,7 +3821,7 @@ tf_cc_test_mkl(
srcs = [
"graph/mkl_layout_pass_test.cc",
"graph/mkl_tfconversion_pass_test.cc",
"//tensorflow/core/util:mkl_util_test.cc",
"//tensorflow/core/util:mkl_util_test_srcs",
],
linkstatic = 1,
deps = [
......@@ -4063,18 +3974,6 @@ tf_cc_test_gpu(
],
)
tf_cuda_only_cc_test(
name = "util_gpu_kernel_helper_test",
srcs = [
"//tensorflow/core/util:gpu_kernel_helper_test.cu.cc",
],
deps = [
":test",
":test_main",
"//third_party/eigen3",
] + mkl_deps(),
)
tf_cc_test_gpu(
name = "memory_types_test",
size = "small",
......
load(
"//tensorflow/core/platform:build_config.bzl",
"tf_kernel_tests_linkstatic",
"tf_proto_library",
)
load(
"//tensorflow:tensorflow.bzl",
"tf_cc_test",
"tf_cc_tests",
"tf_copts",
"tf_cuda_library",
"tf_cuda_only_cc_test",
)
load("//tensorflow:tensorflow.bzl", "tf_version_info_genrule")
load(
"//third_party/mkl:build_defs.bzl",
"mkl_deps",
)
package(
default_visibility = [
......@@ -20,132 +28,51 @@ package(
# This avoids breading all the rules in tensorflow/core/BUILD.
exports_files(
srcs = [
"activation_mode.cc",
"activation_mode.h",
"batch_util.cc",
"batch_util.h",
"bcast.cc",
"bcast.h",
"command_line_flags.cc",
"command_line_flags.h",
"debug_events_writer.cc",
"debug_events_writer.h",
"device_name_utils.cc",
"device_name_utils.h",
"dump_graph.cc",
"dump_graph.h",
"einsum_op_util.cc",
"einsum_op_util.h",
"env_var.cc",
"env_var.h",
"equal_graph_def.cc",
"equal_graph_def.h",
"events_writer.cc",
"events_writer.h",
"example_proto_fast_parsing.cc",
"example_proto_fast_parsing.h",
"example_proto_helper.cc",
"example_proto_helper.h",
"exec_on_stall.h",
"gpu_cuda_alias.h",
"gpu_device_functions.h",
"gpu_kernel_helper.h",
"gpu_kernel_helper_test.cu.cc",
"gpu_launch_config.h",
"guarded_philox_random.cc",
"guarded_philox_random.h",
"matmul_autotune.cc",
"matmul_autotune.h",
"matmul_bcast.cc",
"matmul_bcast.h",
"memmapped_file_system.cc",
"memmapped_file_system.h",
"memmapped_file_system_writer.cc",
"memmapped_file_system_writer.h",
"mirror_pad_mode.cc",
"mirror_pad_mode.h",
"mkl_util.h",
"overflow.h",
"padding.cc",
"padding.h",
"permutation_input_iterator.h",
"permutation_output_iterator.h",
"port.cc",
"port.h",
"presized_cuckoo_map.h",
"ptr_util.h",
"reffed_status_callback.h",
"reporter.cc",
"reporter.h",
"saved_tensor_slice_util.cc",
"saved_tensor_slice_util.h",
"stat_summarizer.cc",
"stat_summarizer.h",
"stat_summarizer_options.h",
"stats_calculator.cc",
"stats_calculator.h",
"stream_executor_util.h",
"strided_slice_op.cc",
"strided_slice_op.h",
"tensor_format.cc",
"tensor_format.h",
"tensor_ops_util.h",
"tensor_slice_reader.cc",
"tensor_slice_reader.h",
"tensor_slice_reader_cache.cc",
"tensor_slice_reader_cache.h",
"tensor_slice_set.cc",
"tensor_slice_set.h",
"tensor_slice_util.h",
"tensor_slice_writer.cc",
"tensor_slice_writer.h",
"transform_output_iterator.h",
"use_cudnn.cc",
"use_cudnn.h",
"util.cc",
"util.h",
"work_sharder.cc",
"work_sharder.h",
"xla_config_registry.cc",
"xla_config_registry.h",
],
visibility = ["//tensorflow/core:__pkg__"],
)
# List of exported test source files that do not yet have local build rules.
exports_files(
srcs = [
"bcast_test.cc",
"command_line_flags_test.cc",
"debug_events_writer_test.cc",
"device_name_utils_test.cc",
"dump_graph_test.cc",
"equal_graph_def_test.cc",
"events_writer_test.cc",
"example_proto_fast_parsing_test.cc",
"example_proto_helper_test.cc",
"exec_on_stall_test.cc",
"matmul_bcast_test.cc",
"memmapped_file_system_test.cc",
"mkl_util_test.cc",
"overflow_test.cc",
"presized_cuckoo_map_test.cc",
"reffed_status_callback_test.cc",
"reporter_test.cc",
"saved_tensor_slice_util_test.cc",
"semver_test.cc",
"stat_summarizer_test.cc",
"stats_calculator_test.cc",
"tensor_format_test.cc",
"tensor_slice_reader_test.cc",
"tensor_slice_set_test.cc",
"tensor_slice_util_test.cc",
"tensor_slice_writer_test.cc",
"work_sharder_test.cc",
],
visibility = ["//tensorflow/core:__pkg__"],
)
# List of exported proto source files.
exports_files(
srcs = [
......@@ -234,6 +161,22 @@ filegroup(
),
)
filegroup(
name = "lib_internal_public_hdrs",
srcs = [
"env_var.h",
],
visibility = ["//tensorflow/core:__pkg__"],
)
filegroup(
name = "lib_hdrs",
srcs = [
"gpu_cuda_alias.h",
],
visibility = ["//tensorflow/core:__pkg__"],
)
filegroup(
name = "memmapped_file_system_hdrs",
srcs = [
......@@ -261,6 +204,85 @@ filegroup(
],
)
filegroup(
name = "test_hdrs",
srcs = [
"reporter.h",
],
visibility = ["//tensorflow/core:__pkg__"],
)
filegroup(
name = "mkl_util_hdrs",
srcs = [
"mkl_util.h",
],
visibility = ["//tensorflow/core:__pkg__"],
)
filegroup(
name = "mkl_util_test_srcs",
srcs = [
"mkl_util_test.cc",
],
visibility = ["//tensorflow/core:__pkg__"],
)
filegroup(
name = "android_test_hdrs",
srcs = [
"reporter.h",
],
visibility = ["//tensorflow/core:__pkg__"],
)
filegroup(
name = "android_test_srcs",
srcs = [
"reporter.cc",
":android_test_hdrs",
],
visibility = ["//tensorflow/core:__pkg__"],
)
filegroup(
name = "framework_srcs",
srcs = [
"activation_mode.h",
"batch_util.h",
"bcast.h",
"debug_events_writer.h",
"device_name_utils.h",
"dump_graph.h",
"einsum_op_util.h",
"events_writer.h",
"example_proto_fast_parsing.h",
"example_proto_helper.h",
"gpu_kernel_helper.h",
"guarded_philox_random.h",
"matmul_autotune.h",
"matmul_bcast.h",
"mirror_pad_mode.h",
"padding.h",
"port.h",
"ptr_util.h",
"reffed_status_callback.h",
"saved_tensor_slice_util.h",
"stat_summarizer.h",
"stat_summarizer_options.h",
"stream_executor_util.h",
"strided_slice_op.h",
"tensor_format.h",
"tensor_ops_util.h",
"tensor_slice_reader.h",
"tensor_slice_reader_cache.h",
"tensor_slice_writer.h",
"use_cudnn.h",
"util.h",
"work_sharder.h",
],
)
# Version info generation needs to be generated in the same package where it
# is written.
tf_version_info_genrule(
......@@ -321,6 +343,158 @@ cc_library(
alwayslink = 1,
)
tf_cuda_library(
name = "gpu_cuda_alias",
hdrs = ["gpu_cuda_alias.h"],
)
tf_cuda_library(
name = "gpu_device_functions",
hdrs = ["gpu_device_functions.h"],
deps = [
":gpu_cuda_alias",
"//tensorflow/core/platform:types",
"//third_party/eigen3",
],
)
cc_library(
name = "overflow",
hdrs = ["overflow.h"],
deps = [
"//tensorflow/core/platform:logging",
"//tensorflow/core/platform:macros",
"//tensorflow/core/platform:types",
],
)
cc_library(
name = "exec_on_stall",
hdrs = ["exec_on_stall.h"],
deps = [
"//tensorflow/core/platform:env",
"//tensorflow/core/platform:mutex",
],
)
cc_library(
name = "ptr_util",
hdrs = ["ptr_util.h"],
)
cc_library(
name = "version_info",
srcs = ["version_info.cc"],
hdrs = ["//tensorflow/core:public/version.h"],
copts = tf_copts(),
)
# Tests.
tf_cc_test(
name = "overflow_test",
size = "small",
srcs = ["overflow_test.cc"],
deps = [
":overflow",
"//tensorflow/core:framework_lite",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
],
)
tf_cc_test(
name = "exec_on_stall_test",
size = "small",
srcs = ["exec_on_stall_test.cc"],
deps = [
":exec_on_stall",
"//tensorflow/core:framework_lite",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
],
)
tf_cuda_only_cc_test(
name = "gpu_kernel_helper_test",
srcs = [
"gpu_kernel_helper_test.cu.cc",
],
deps = [
"//tensorflow/core:test",
"//tensorflow/core:test_main",
"//third_party/eigen3",
] + mkl_deps(),
)
tf_cc_tests(
name = "higher_level_tests",
size = "small",
srcs = [
"bcast_test.cc",
"command_line_flags_test.cc",
"debug_events_writer_test.cc",
"device_name_utils_test.cc",
"dump_graph_test.cc",
"equal_graph_def_test.cc",
"events_writer_test.cc",
"example_proto_fast_parsing_test.cc",
"example_proto_helper_test.cc",
"matmul_bcast_test.cc",
"memmapped_file_system_test.cc",
"presized_cuckoo_map_test.cc",
"reffed_status_callback_test.cc",
"reporter_test.cc",
"saved_tensor_slice_util_test.cc",
"semver_test.cc",
"stat_summarizer_test.cc",
"tensor_format_test.cc",
"tensor_slice_reader_test.cc",
"tensor_slice_set_test.cc",
"tensor_slice_util_test.cc",
"tensor_slice_writer_test.cc",
"work_sharder_test.cc",
],
create_named_test_suite = True,
linkopts = select({
"//tensorflow:macos": ["-headerpad_max_install_names"],
"//conditions:default": [],
}),
linkstatic = tf_kernel_tests_linkstatic(),
visibility = [
"//tensorflow/core:__pkg__",
],
deps = [
":protos_test_cc",
"//tensorflow/cc:cc_ops",
"//tensorflow/cc:cc_ops_internal",
"//tensorflow/cc:function_ops",
"//tensorflow/cc:ops",
"//tensorflow/cc:scope",
"//tensorflow/cc:sendrecv_ops",
"//tensorflow/cc:while_loop",
"//tensorflow/core",
"//tensorflow/core:core_cpu",
"//tensorflow/core:core_cpu_internal",
"//tensorflow/core:direct_session_internal",
"//tensorflow/core:framework",
"//tensorflow/core:framework_internal",
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"//tensorflow/core:ops",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
"//tensorflow/core:testlib",
"//tensorflow/core/kernels:ops_util",
"//tensorflow/core/platform:regexp",
"//third_party/eigen3",
"@com_google_absl//absl/base",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/strings",
],
)
# Proto libraries.
tf_proto_library(
name = "test_log_proto_impl",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册