1/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is distributed on an "AS IS" BASIS,
11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15
16#ifndef TENSORFLOW_CORE_COMMON_RUNTIME_EXECUTOR_FACTORY_H_
17#define TENSORFLOW_CORE_COMMON_RUNTIME_EXECUTOR_FACTORY_H_
18
19#include <string>
20
21#include "tensorflow/core/lib/core/errors.h"
22#include "tensorflow/core/lib/core/status.h"
23#include "tensorflow/core/lib/gtl/array_slice.h"
24#include "tensorflow/core/platform/types.h"
25
26namespace tensorflow {
27
28class Executor;
29class Graph;
30struct LocalExecutorParams;
31
32class ExecutorFactory {
33 public:
34 virtual Status NewExecutor(const LocalExecutorParams& params,
35 const Graph& graph,
36 std::unique_ptr<Executor>* out_executor) = 0;
37 virtual ~ExecutorFactory() {}
38
39 static void Register(const string& executor_type, ExecutorFactory* factory);
40 static Status GetFactory(const string& executor_type,
41 ExecutorFactory** out_factory);
42};
43
44Status NewExecutor(const string& executor_type,
45 const LocalExecutorParams& params, const Graph& graph,
46 std::unique_ptr<Executor>* out_executor);
47
48} // namespace tensorflow
49
50#endif // TENSORFLOW_CORE_COMMON_RUNTIME_EXECUTOR_FACTORY_H_
51