From 2b03e28d480714f42b950468752fb6a99030fcf8 Mon Sep 17 00:00:00 2001 From: Nick Desaulniers Date: Thu, 17 May 2018 14:22:49 -0700 Subject: [PATCH] [TF:STREAM_EXECUTOR] move declaration of multi_platform_manager to header PiperOrigin-RevId: 197051272 --- tensorflow/compiler/xla/service/interpreter/platform.cc | 2 -- tensorflow/stream_executor/cuda/cuda_platform.cc | 1 - tensorflow/stream_executor/host/host_platform.cc | 1 - tensorflow/stream_executor/multi_platform_manager.h | 6 ++++++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tensorflow/compiler/xla/service/interpreter/platform.cc b/tensorflow/compiler/xla/service/interpreter/platform.cc index 92e069a..b52fdc2 100644 --- a/tensorflow/compiler/xla/service/interpreter/platform.cc +++ b/tensorflow/compiler/xla/service/interpreter/platform.cc @@ -106,8 +106,6 @@ REGISTER_MODULE_INITIALIZER( interpreter_platform, stream_executor::interpreter::InitializeXlaInterpreterPlatform()); -DECLARE_MODULE_INITIALIZER(multi_platform_manager); - // Note that module initialization sequencing is not supported in the // open-source project, so this will be a no-op there. REGISTER_MODULE_INITIALIZER_SEQUENCE(interpreter_platform, diff --git a/tensorflow/stream_executor/cuda/cuda_platform.cc b/tensorflow/stream_executor/cuda/cuda_platform.cc index ebe4dcc..622a4a4 100644 --- a/tensorflow/stream_executor/cuda/cuda_platform.cc +++ b/tensorflow/stream_executor/cuda/cuda_platform.cc @@ -206,7 +206,6 @@ static void InitializeCudaPlatform() { REGISTER_MODULE_INITIALIZER(cuda_platform, stream_executor::InitializeCudaPlatform()); -DECLARE_MODULE_INITIALIZER(multi_platform_manager); // Note that module initialization sequencing is not supported in the // open-source project, so this will be a no-op there. REGISTER_MODULE_INITIALIZER_SEQUENCE(cuda_platform, multi_platform_manager); diff --git a/tensorflow/stream_executor/host/host_platform.cc b/tensorflow/stream_executor/host/host_platform.cc index eeb6a06..410dc9d 100644 --- a/tensorflow/stream_executor/host/host_platform.cc +++ b/tensorflow/stream_executor/host/host_platform.cc @@ -100,7 +100,6 @@ static void InitializeHostPlatform() { REGISTER_MODULE_INITIALIZER(host_platform, stream_executor::host::InitializeHostPlatform()); -DECLARE_MODULE_INITIALIZER(multi_platform_manager); // Note that module initialization sequencing is not supported in the // open-source project, so this will be a no-op there. REGISTER_MODULE_INITIALIZER_SEQUENCE(host_platform, multi_platform_manager); diff --git a/tensorflow/stream_executor/multi_platform_manager.h b/tensorflow/stream_executor/multi_platform_manager.h index 7e31687..146a128 100644 --- a/tensorflow/stream_executor/multi_platform_manager.h +++ b/tensorflow/stream_executor/multi_platform_manager.h @@ -68,6 +68,7 @@ limitations under the License. #include #include +#include "tensorflow/stream_executor/lib/initialize.h" #include "tensorflow/stream_executor/lib/status.h" #include "tensorflow/stream_executor/lib/statusor.h" #include "tensorflow/stream_executor/platform.h" @@ -182,4 +183,9 @@ class MultiPlatformManager { } // namespace stream_executor +// multi_platform_manager.cc will define this instance. Includers of this header +// should use +// REGISTER_MODULE_INITIALIZER_SEQUENCE(my_platform, multi_platform_manager); +DECLARE_MODULE_INITIALIZER(multi_platform_manager); + #endif // TENSORFLOW_STREAM_EXECUTOR_MULTI_PLATFORM_MANAGER_H_ -- 2.7.4