diff --git a/tensorflow/compiler/xla/BUILD b/tensorflow/compiler/xla/BUILD index b0da5e9d0fc..7d0428d9666 100644 --- a/tensorflow/compiler/xla/BUILD +++ b/tensorflow/compiler/xla/BUILD @@ -130,7 +130,6 @@ cc_library( deps = [ "//tensorflow/core:framework_lite", "//third_party/eigen3", - "@com_google_absl//absl/types:variant", ], ) diff --git a/tensorflow/compiler/xla/service/gpu/BUILD b/tensorflow/compiler/xla/service/gpu/BUILD index f0b3f4d8a9c..aff2fed8f58 100644 --- a/tensorflow/compiler/xla/service/gpu/BUILD +++ b/tensorflow/compiler/xla/service/gpu/BUILD @@ -47,6 +47,14 @@ cc_library( ], ) +cc_library( + name = "gpu_types", + hdrs = ["gpu_types.h"], + deps = [ + "@com_google_absl//absl/types:variant", + ], +) + cc_library( name = "partition_assignment", srcs = [ @@ -453,6 +461,7 @@ cc_library( ":cudnn_conv_runner", ":cusolver_context", ":gpu_debug_info_manager", + ":gpu_types", ":hlo_execution_profiler", ":infeed_manager", ":ir_emission_utils", diff --git a/tensorflow/compiler/xla/service/gpu/gpu_executable.cc b/tensorflow/compiler/xla/service/gpu/gpu_executable.cc index 6b09f95026c..cf435d36bed 100644 --- a/tensorflow/compiler/xla/service/gpu/gpu_executable.cc +++ b/tensorflow/compiler/xla/service/gpu/gpu_executable.cc @@ -24,6 +24,7 @@ limitations under the License. #include "tensorflow/compiler/xla/map_util.h" #include "tensorflow/compiler/xla/service/gpu/buffer_allocations.h" #include "tensorflow/compiler/xla/service/gpu/gpu_debug_info_manager.h" +#include "tensorflow/compiler/xla/service/gpu/gpu_types.h" #include "tensorflow/compiler/xla/service/gpu/hlo_execution_profiler.h" #include "tensorflow/compiler/xla/service/hlo_instruction.h" #include "tensorflow/compiler/xla/service/llvm_ir/buffer_assignment_util.h" @@ -36,7 +37,6 @@ limitations under the License. #include "tensorflow/compiler/xla/util.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/tracing.h" -#include "tensorflow/core/platform/types.h" #include "tensorflow/core/profiler/lib/traceme.h" #include "tensorflow/stream_executor/platform.h" diff --git a/tensorflow/compiler/xla/service/gpu/gpu_executable.h b/tensorflow/compiler/xla/service/gpu/gpu_executable.h index 64debf95994..f58c219e7c9 100644 --- a/tensorflow/compiler/xla/service/gpu/gpu_executable.h +++ b/tensorflow/compiler/xla/service/gpu/gpu_executable.h @@ -26,6 +26,7 @@ limitations under the License. #include "tensorflow/compiler/xla/service/buffer_assignment.h" #include "tensorflow/compiler/xla/service/executable.h" #include "tensorflow/compiler/xla/service/gpu/buffer_allocations.h" +#include "tensorflow/compiler/xla/service/gpu/gpu_types.h" #include "tensorflow/compiler/xla/service/gpu/stream_assignment.h" #include "tensorflow/compiler/xla/service/gpu/thunk.h" #include "tensorflow/compiler/xla/service/gpu/thunk_schedule.h" @@ -34,7 +35,6 @@ limitations under the License. #include "tensorflow/compiler/xla/service/shaped_buffer.h" #include "tensorflow/compiler/xla/service/tuple_points_to_analysis.h" #include "tensorflow/compiler/xla/statusor.h" -#include "tensorflow/compiler/xla/types.h" #include "tensorflow/core/platform/macros.h" #include "tensorflow/core/platform/stream_executor_no_cuda.h" #include "tensorflow/stream_executor/device_memory_allocator.h" diff --git a/tensorflow/compiler/xla/service/gpu/gpu_types.h b/tensorflow/compiler/xla/service/gpu/gpu_types.h new file mode 100644 index 00000000000..f9add7d8c00 --- /dev/null +++ b/tensorflow/compiler/xla/service/gpu/gpu_types.h @@ -0,0 +1,31 @@ +/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#ifndef TENSORFLOW_COMPILER_XLA_SERVICE_GPU_TYPES_H_ +#define TENSORFLOW_COMPILER_XLA_SERVICE_GPU_TYPES_H_ + +#include "absl/types/variant.h" + +namespace xla { +namespace gpu { + +// GpuVersion is used to abstract Gpu hardware version. On Cuda platform, +// it comprises a pair of integers denoting major and minor version. +// On ROCm platform, it comprises one integer for AMD GCN ISA version. +using GpuVersion = absl::variant, int>; +} // namespace gpu +} // namespace xla + +#endif // TENSORFLOW_COMPILER_XLA_SERVICE_GPU_TYPES_H_ diff --git a/tensorflow/compiler/xla/types.h b/tensorflow/compiler/xla/types.h index b08a44bbb5b..07154891b82 100644 --- a/tensorflow/compiler/xla/types.h +++ b/tensorflow/compiler/xla/types.h @@ -19,7 +19,6 @@ limitations under the License. #include #include -#include "absl/types/variant.h" #include "tensorflow/core/framework/numeric_types.h" #include "tensorflow/core/platform/types.h" #include "third_party/eigen3/Eigen/Core" @@ -44,13 +43,6 @@ using complex64 = std::complex; using complex128 = std::complex; using ::Eigen::half; - -namespace gpu { -// GpuVersion is used to abstract Gpu hardware version. On Cuda platform, -// it comprises a pair of integers denoting major and minor version. -// On ROCm platform, it comprises one integer for AMD GCN ISA version. -using GpuVersion = absl::variant, int>; -} // namespace gpu } // namespace xla // Alias namespace ::stream_executor as ::xla::se.