[TF:STREAM_EXECUTOR] move declaration of multi_platform_manager to header
authorNick Desaulniers <ndesaulniers@google.com>
Thu, 17 May 2018 21:22:49 +0000 (14:22 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Thu, 17 May 2018 21:25:26 +0000 (14:25 -0700)
PiperOrigin-RevId: 197051272

tensorflow/compiler/xla/service/interpreter/platform.cc
tensorflow/stream_executor/cuda/cuda_platform.cc
tensorflow/stream_executor/host/host_platform.cc
tensorflow/stream_executor/multi_platform_manager.h

index 92e069a..b52fdc2 100644 (file)
@@ -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,
index ebe4dcc..622a4a4 100644 (file)
@@ -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);
index eeb6a06..410dc9d 100644 (file)
@@ -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);
index 7e31687..146a128 100644 (file)
@@ -68,6 +68,7 @@ limitations under the License.
 #include <map>
 #include <memory>
 
+#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_