Turn the op_performance_data proto lib into a header only library by default

PiperOrigin-RevId: 182621348
This commit is contained in:
Benoit Steiner 2018-01-19 19:13:43 -08:00 committed by TensorFlower Gardener
parent 1ebcfc1da1
commit 76d33554c7
4 changed files with 26 additions and 16 deletions

View File

@ -136,6 +136,8 @@ load(
"tf_nano_proto_library",
"tf_protos_all",
"tf_protos_all_impl",
"tf_protos_grappler",
"tf_protos_grappler_impl",
)
load(
"//tensorflow/core:platform/default/build_config_root.bzl",
@ -1534,7 +1536,7 @@ cc_library(
"@snappy",
"@zlib_archive//:zlib",
"@protobuf_archive//:protobuf",
] + tf_protos_all_impl(),
] + tf_protos_all_impl() + tf_protos_grappler_impl(),
)
# File compiled with extra flags to get cpu-specific acceleration.
@ -2099,7 +2101,7 @@ tf_cuda_library(
":core_cpu_base",
":proto_text",
"//tensorflow/core/grappler:grappler_item",
] + if_static([":core_cpu_impl"]) + tf_protos_all(),
] + if_static([":core_cpu_impl"]) + tf_protos_all() + tf_protos_grappler(),
)
tf_cuda_library(

View File

@ -1,6 +1,10 @@
licenses(["notice"]) # Apache 2.0
load("//tensorflow:tensorflow.bzl", "tf_cuda_library", "tf_cc_test")
load(
"//tensorflow/core:platform/default/build_config.bzl",
"tf_protos_grappler",
)
filegroup(
name = "all_files",
@ -37,6 +41,7 @@ tf_proto_library(
name = "op_performance_data",
srcs = ["op_performance_data.proto"],
cc_api_version = 2,
default_header = True,
protodeps = tf_additional_all_protos(),
visibility = ["//visibility:public"],
)
@ -47,7 +52,6 @@ cc_library(
hdrs = ["graph_properties.h"],
visibility = ["//visibility:public"],
deps = [
":op_performance_data_cc",
":utils",
"//tensorflow/core:core_cpu_base",
"//tensorflow/core:framework",
@ -55,7 +59,7 @@ cc_library(
"//tensorflow/core/grappler:grappler_item",
"//tensorflow/core/grappler:utils",
"//tensorflow/core/grappler/clusters:cluster",
],
] + tf_protos_grappler(),
)
tf_cc_test(
@ -135,7 +139,7 @@ tf_cuda_library(
hdrs = ["utils.h"],
visibility = ["//visibility:public"],
deps = [
":op_performance_data_cc",
"//third_party/eigen3",
"//tensorflow/core:framework",
"//tensorflow/core:graph",
"//tensorflow/core:lib",
@ -143,8 +147,7 @@ tf_cuda_library(
"//tensorflow/core:protos_all_cc",
"//tensorflow/core/grappler:utils",
"//tensorflow/core/grappler/clusters:utils",
"//third_party/eigen3",
],
] + tf_protos_grappler(),
)
tf_cc_test(
@ -207,9 +210,8 @@ cc_library(
hdrs = ["op_context.h"],
visibility = ["//visibility:public"],
deps = [
":op_performance_data_cc",
"//tensorflow/core:protos_all_cc",
],
] + tf_protos_grappler(),
)
cc_library(
@ -276,12 +278,11 @@ cc_library(
deps = [
":cost_estimator",
":op_context",
":op_performance_data_cc",
"//third_party/eigen3",
"//tensorflow/core:framework",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core/grappler/clusters:utils",
"//third_party/eigen3",
],
] + tf_protos_grappler(),
)
tf_cc_test(
@ -305,7 +306,6 @@ cc_library(
":cost_estimator",
":graph_properties",
":op_level_cost_estimator",
":op_performance_data_cc",
":utils",
":virtual_placer",
":virtual_scheduler",
@ -314,7 +314,7 @@ cc_library(
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core/grappler:grappler_item",
],
] + tf_protos_grappler(),
)
tf_cc_test(

View File

@ -378,6 +378,14 @@ def tf_protos_all():
extra_deps=tf_protos_all_impl(),
otherwise=["//tensorflow/core:protos_all_cc"])
def tf_protos_grappler_impl():
return ["//tensorflow/core/grappler/costs:op_performance_data_cc_impl"]
def tf_protos_grappler():
return if_static(
extra_deps=tf_protos_grappler_impl(),
otherwise=["//tensorflow/core/grappler/costs:op_performance_data_cc"])
def tf_env_time_hdrs():
return [
"platform/env_time.h",

View File

@ -32,6 +32,7 @@ load("//tensorflow/core:platform/default/build_config.bzl", "tf_proto_library")
load("//tensorflow/core:platform/default/build_config.bzl", "tf_proto_library_py")
load("//tensorflow/core:platform/default/build_config.bzl", "tf_additional_lib_deps")
load("//tensorflow/core:platform/default/build_config.bzl", "tf_additional_all_protos")
load("//tensorflow/core:platform/default/build_config.bzl", "tf_protos_grappler")
load("//tensorflow/core:platform/default/build_config_root.bzl", "tf_additional_plugin_deps")
load("//tensorflow/python:build_defs.bzl", "tf_gen_op_wrapper_private_py")
load("//tensorflow/core:platform/default/build_config_root.bzl", "tf_additional_verbs_deps")
@ -209,9 +210,8 @@ cc_library(
"//tensorflow/core/grappler/costs:analytical_cost_estimator",
"//tensorflow/core/grappler/costs:cost_estimator",
"//tensorflow/core/grappler/costs:measuring_cost_estimator",
"//tensorflow/core/grappler/costs:op_performance_data_cc",
"//tensorflow/core/grappler/costs:utils",
],
] + tf_protos_grappler(),
)
cc_library(