1 /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 3 Licensed under the Apache License, Version 2.0 (the "License"); 4 you may not use this file except in compliance with the License. 5 You may obtain a copy of the License at 6 7 http://www.apache.org/licenses/LICENSE-2.0 8 9 Unless required by applicable law or agreed to in writing, software 10 distributed under the License is distributed on an "AS IS" BASIS, 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 See the License for the specific language governing permissions and 13 limitations under the License. 14 ==============================================================================*/ 15 16 #ifndef TENSORFLOW_CORE_COMMON_RUNTIME_PLUGGABLE_DEVICE_PLUGGABLE_DEVICE_INIT_H_ 17 #define TENSORFLOW_CORE_COMMON_RUNTIME_PLUGGABLE_DEVICE_PLUGGABLE_DEVICE_INIT_H_ 18 19 #include <string> 20 21 #include "tensorflow/core/lib/core/status.h" 22 23 namespace stream_executor { 24 class Platform; 25 } // namespace stream_executor 26 27 namespace tensorflow { 28 29 // Initializes the PluggableDevice platform and returns OK if the 30 // PluggableDevice platform could be initialized. 31 Status ValidatePluggableDeviceMachineManager(const string& platform_name); 32 33 // Returns the PluggableDevice machine manager singleton, creating it and 34 // initializing the PluggableDevices on the machine if needed the first time it 35 // is called. Must only be called when there is a valid PluggableDevice 36 // environment in the process (e.g., ValidatePluggableDeviceMachineManager() 37 // returns OK). 38 stream_executor::Platform* PluggableDeviceMachineManager( 39 const string& platform_name); 40 41 } // namespace tensorflow 42 43 #endif // TENSORFLOW_CORE_COMMON_RUNTIME_PLUGGABLE_DEVICE_PLUGGABLE_DEVICE_INIT_H_ 44