• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright 2017 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 #include "tensorflow/compiler/xla/executable_run_options.h"
17 
18 namespace xla {
19 
set_device_ordinal(int device_ordinal)20 ExecutableRunOptions& ExecutableRunOptions::set_device_ordinal(
21     int device_ordinal) {
22   device_ordinal_ = device_ordinal;
23   return *this;
24 }
25 
device_ordinal() const26 int ExecutableRunOptions::device_ordinal() const { return device_ordinal_; }
27 
set_allocator(DeviceMemoryAllocator * allocator)28 ExecutableRunOptions& ExecutableRunOptions::set_allocator(
29     DeviceMemoryAllocator* allocator) {
30   allocator_ = allocator;
31   return *this;
32 }
33 
allocator() const34 DeviceMemoryAllocator* ExecutableRunOptions::allocator() const {
35   return allocator_;
36 }
37 
set_stream(perftools::gputools::Stream * stream)38 ExecutableRunOptions& ExecutableRunOptions::set_stream(
39     perftools::gputools::Stream* stream) {
40   stream_ = stream;
41   return *this;
42 }
43 
stream() const44 perftools::gputools::Stream* ExecutableRunOptions::stream() const {
45   return stream_;
46 }
47 
set_inter_op_thread_pool(tensorflow::thread::ThreadPool * inter_op_thread_pool)48 ExecutableRunOptions& ExecutableRunOptions::set_inter_op_thread_pool(
49     tensorflow::thread::ThreadPool* inter_op_thread_pool) {
50   inter_op_thread_pool_ = inter_op_thread_pool;
51   return *this;
52 }
53 
inter_op_thread_pool() const54 tensorflow::thread::ThreadPool* ExecutableRunOptions::inter_op_thread_pool()
55     const {
56   return inter_op_thread_pool_;
57 }
58 
set_intra_op_thread_pool(const Eigen::ThreadPoolDevice * intra_op_thread_pool)59 ExecutableRunOptions& ExecutableRunOptions::set_intra_op_thread_pool(
60     const Eigen::ThreadPoolDevice* intra_op_thread_pool) {
61   intra_op_thread_pool_ = intra_op_thread_pool;
62   return *this;
63 }
64 
intra_op_thread_pool() const65 const Eigen::ThreadPoolDevice* ExecutableRunOptions::intra_op_thread_pool()
66     const {
67   return intra_op_thread_pool_;
68 }
69 
set_execution_profile(ExecutionProfile * profile)70 ExecutableRunOptions& ExecutableRunOptions::set_execution_profile(
71     ExecutionProfile* profile) {
72   execution_profile_ = profile;
73   return *this;
74 }
75 
execution_profile() const76 ExecutionProfile* ExecutableRunOptions::execution_profile() const {
77   return execution_profile_;
78 }
79 
set_device_assignment(DeviceAssignment * device_assignment)80 ExecutableRunOptions& ExecutableRunOptions::set_device_assignment(
81     DeviceAssignment* device_assignment) {
82   device_assignment_ = device_assignment;
83   return *this;
84 }
85 
device_assignment() const86 const DeviceAssignment* ExecutableRunOptions::device_assignment() const {
87   return device_assignment_;
88 }
89 
90 }  // namespace xla
91