• 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(stream_executor::Stream * stream)38 ExecutableRunOptions& ExecutableRunOptions::set_stream(
39     stream_executor::Stream* stream) {
40   stream_ = stream;
41   return *this;
42 }
43 
stream() const44 stream_executor::Stream* ExecutableRunOptions::stream() const {
45   return stream_;
46 }
47 
set_host_to_device_stream(stream_executor::Stream * stream)48 ExecutableRunOptions& ExecutableRunOptions::set_host_to_device_stream(
49     stream_executor::Stream* stream) {
50   host_to_device_stream_ = stream;
51   return *this;
52 }
53 
host_to_device_stream() const54 stream_executor::Stream* ExecutableRunOptions::host_to_device_stream() const {
55   return host_to_device_stream_;
56 }
57 
set_intra_op_thread_pool(const Eigen::ThreadPoolDevice * intra_op_thread_pool)58 ExecutableRunOptions& ExecutableRunOptions::set_intra_op_thread_pool(
59     const Eigen::ThreadPoolDevice* intra_op_thread_pool) {
60   intra_op_thread_pool_ = intra_op_thread_pool;
61   return *this;
62 }
63 
intra_op_thread_pool() const64 const Eigen::ThreadPoolDevice* ExecutableRunOptions::intra_op_thread_pool()
65     const {
66   return intra_op_thread_pool_;
67 }
68 
set_execution_profile(ExecutionProfile * profile)69 ExecutableRunOptions& ExecutableRunOptions::set_execution_profile(
70     ExecutionProfile* profile) {
71   execution_profile_ = profile;
72   return *this;
73 }
74 
execution_profile() const75 ExecutionProfile* ExecutableRunOptions::execution_profile() const {
76   return execution_profile_;
77 }
78 
set_device_assignment(const DeviceAssignment * device_assignment)79 ExecutableRunOptions& ExecutableRunOptions::set_device_assignment(
80     const DeviceAssignment* device_assignment) {
81   device_assignment_ = device_assignment;
82   return *this;
83 }
84 
device_assignment() const85 const DeviceAssignment* ExecutableRunOptions::device_assignment() const {
86   return device_assignment_;
87 }
88 
set_rng_seed(int rng_seed)89 ExecutableRunOptions& ExecutableRunOptions::set_rng_seed(int rng_seed) {
90   rng_seed_ = rng_seed;
91   return *this;
92 }
93 
rng_seed() const94 int ExecutableRunOptions::rng_seed() const { return rng_seed_; }
95 
96 }  // namespace xla
97