TensorFlow Serving C++ API Documentation
device_runner_init_stub.cc
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 #include "tensorflow_serving/model_servers/device_runner_init_stub.h"
16 
17 #include "absl/base/attributes.h"
18 #include "tensorflow/core/platform/errors.h"
19 #include "tensorflow/core/platform/status.h"
20 #include "tensorflow/core/tfrt/runtime/runtime.h"
21 
22 namespace tensorflow::serving {
23 
24 namespace {
25 Status InitializeDeviceRunnerAndTopologyStub(tfrt_stub::Runtime&, int*, int*,
26  const DeviceRunnerOptions&) {
27  return tensorflow::errors::Internal(
28  "device_runner_init_impl is not linked into this binary");
29 }
30 } // namespace
31 
32 Status InitializeDeviceRunnerAndTopology(tfrt_stub::Runtime& runtime,
33  int* num_local_devices,
34  int* cores_per_chip,
35  const DeviceRunnerOptions& options) {
36  return InitializeDeviceRunnerAndTopologyFunc(runtime, num_local_devices,
37  cores_per_chip, options);
38 }
39 
40 ABSL_CONST_INIT InitializeDeviceRunnerAndTopologyFuncType
41  InitializeDeviceRunnerAndTopologyFunc =
42  InitializeDeviceRunnerAndTopologyStub;
43 
44 } // namespace tensorflow::serving