Add "allocator", "bfc_allocator", and "gpu_bfc_allocator" BUILD targets.

Also cleans up some unneeded headers.

PiperOrigin-RevId: 247650191
This commit is contained in:
Skye Wanderman-Milne 2019-05-10 11:51:31 -07:00 committed by TensorFlower Gardener
parent d1d9ba9dbe
commit 7624faff5b
8 changed files with 77 additions and 6 deletions

View File

@ -995,6 +995,26 @@ tf_cuda_library(
],
)
# 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.cc",
"framework/allocator_registry.h",
"framework/tracking_allocator.cc",
"framework/tracking_allocator.h",
],
hdrs = ["framework/allocator.h"],
features = ["parse_headers"],
visibility = ["//visibility:public"],
deps = [
":lib",
"@com_google_absl//absl/types:optional",
],
)
cc_library(
name = "stats_calculator_portable",
srcs = [
@ -3275,6 +3295,36 @@ tf_cuda_library(
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",
],
)
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 = [
@ -3455,6 +3505,25 @@ tf_cuda_library(
] + if_static([":gpu_runtime_impl"]),
)
# This is redundant with the "gpu_runtime_*" targets above. It's useful for
# applications that want to depend on a minimal subset of TensorFlow (e.g. XLA).
tf_cuda_library(
name = "gpu_bfc_allocator",
srcs = [
"common_runtime/gpu/gpu_bfc_allocator.cc",
"common_runtime/gpu/gpu_id.h",
],
hdrs = ["common_runtime/gpu/gpu_bfc_allocator.h"],
features = ["parse_headers"],
visibility = ["//visibility:public"],
deps = [
":bfc_allocator",
":lib",
":lib_internal",
":stream_executor",
],
)
tf_cuda_library(
name = "gpu_init",
hdrs = [

View File

@ -18,7 +18,6 @@ limitations under the License.
#include <atomic>
#include "tensorflow/core/common_runtime/allocator_retry.h"
#include "tensorflow/core/framework/device_base.h"
#include "tensorflow/core/lib/core/bits.h"
#include "tensorflow/core/lib/gtl/stl_util.h"
#include "tensorflow/core/lib/strings/numbers.h"

View File

@ -32,7 +32,6 @@ limitations under the License.
#include "tensorflow/core/platform/mutex.h"
#include "tensorflow/core/platform/thread_annotations.h"
#include "tensorflow/core/platform/types.h"
#include "tensorflow/core/protobuf/config.pb.h"
namespace tensorflow {

View File

@ -16,8 +16,6 @@ limitations under the License.
#include "tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.h"
#include "tensorflow/core/common_runtime/gpu/gpu_id.h"
#include "tensorflow/core/common_runtime/gpu/gpu_id_utils.h"
#include "tensorflow/core/common_runtime/gpu/gpu_init.h"
#include "tensorflow/core/lib/strings/strcat.h"
namespace tensorflow {

View File

@ -15,6 +15,10 @@ limitations under the License.
#ifndef TENSORFLOW_CORE_COMMON_RUNTIME_SHARED_COUNTER_H_
#define TENSORFLOW_CORE_COMMON_RUNTIME_SHARED_COUNTER_H_
#include <atomic>
#include "tensorflow/core/platform/types.h"
namespace tensorflow {
// A lightweight thread-safe monotone counter for establishing
// temporal ordering.

View File

@ -15,9 +15,11 @@ limitations under the License.
#include "tensorflow/core/framework/allocator.h"
#include <atomic>
#include "tensorflow/core/framework/allocator_registry.h"
#include "tensorflow/core/framework/log_memory.h"
#include "tensorflow/core/framework/tracking_allocator.h"
#include "tensorflow/core/lib/strings/strcat.h"
#include "tensorflow/core/lib/strings/stringprintf.h"
#include "tensorflow/core/platform/mem.h"
#include "tensorflow/core/platform/mutex.h"

View File

@ -18,7 +18,6 @@ limitations under the License.
#include <unordered_map>
#include "tensorflow/core/framework/allocator.h"
#include "tensorflow/core/lib/core/refcount.h"
#include "tensorflow/core/lib/gtl/inlined_vector.h"
#include "tensorflow/core/platform/mutex.h"
#include "tensorflow/core/platform/thread_annotations.h"

View File

@ -20,6 +20,7 @@ limitations under the License.
#include "tensorflow/core/framework/allocator.h"
#include "tensorflow/core/framework/resource_handle.h"
#include "tensorflow/core/framework/type_traits.h"
#include "tensorflow/core/platform/types.h"
namespace tensorflow {