tf_1.8_xla_doc
compile_only_client.h
Go to the documentation of this file.
1 
3 /* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7  http://www.apache.org/licenses/LICENSE-2.0
8 Unless required by applicable law or agreed to in writing, software
9 distributed under the License is distributed on an "AS IS" BASIS,
10 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 See the License for the specific language governing permissions and
12 limitations under the License.
13 ==============================================================================*/
14 #ifndef TENSORFLOW_COMPILER_XLA_CLIENT_COMPILE_ONLY_CLIENT_H_
15 #define TENSORFLOW_COMPILER_XLA_CLIENT_COMPILE_ONLY_CLIENT_H_
16 #include "tensorflow/compiler/xla/client/client.h"
17 #include "tensorflow/compiler/xla/client/computation.h"
20 #include "tensorflow/compiler/xla/statusor.h"
21 #include "tensorflow/compiler/xla/xla_data.pb.h"
22 #include "tensorflow/core/platform/stream_executor_no_cuda.h"
26 namespace xla {
33 class CompileOnlyClient : public Client {
34  public:
35  explicit CompileOnlyClient(CompileOnlyService* service)
36  : Client(service), compiler_service_(service) {}
37  CompileOnlyClient(const CompileOnlyClient&) = delete;
38  void operator=(const CompileOnlyClient&) = delete;
39  // A description of a computation to compile using CompileAheadOfTime.
40  struct AotComputationInstance {
41  const Computation* computation;
42  // Inform the compiler of the expected layout for arguments.
43  std::vector<const Shape*> argument_layouts;
44  // Specifies the expected result layout.
45  const Shape* result_layout;
46  };
47  // Compiles a list of computations for ahead-of-time execution. This is
48  // intended for use in static compilation. The |options| parameter describes
49  // the target for which the compiler should emit code.
50  StatusOr<std::vector<std::unique_ptr<AotCompilationResult>>>
52  const tensorflow::gtl::ArraySlice<AotComputationInstance> computations,
53  const AotCompilationOptions& options);
54  // Returns the size of a pointer in bytes for a given triple.
55  static int64 PointerSizeForTriple(tensorflow::StringPiece triple);
56  private:
57  CompileOnlyService* compiler_service_;
58 };
59 } // namespace xla
60 #endif // TENSORFLOW_COMPILER_XLA_CLIENT_COMPILE_ONLY_CLIENT_H_
61 
Definition: compile_only_service.h:29
StatusOr< std::vector< std::unique_ptr< AotCompilationResult > > > CompileAheadOfTime(const tensorflow::gtl::ArraySlice< AotComputationInstance > computations, const AotCompilationOptions &options)
Compiles a list of computations for ahead-of-time execution. This is intended for use in static compi...
Definition: compile_only_client.cc:28
namespace for xla
Definition: client_library.cc:26
Definition: compile_only_client.h:33