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)20ExecutableRunOptions& ExecutableRunOptions::set_device_ordinal( 21 int device_ordinal) { 22 device_ordinal_ = device_ordinal; 23 return *this; 24 } 25 device_ordinal() const26int ExecutableRunOptions::device_ordinal() const { return device_ordinal_; } 27 set_allocator(DeviceMemoryAllocator * allocator)28ExecutableRunOptions& ExecutableRunOptions::set_allocator( 29 DeviceMemoryAllocator* allocator) { 30 allocator_ = allocator; 31 return *this; 32 } 33 allocator() const34DeviceMemoryAllocator* ExecutableRunOptions::allocator() const { 35 return allocator_; 36 } 37 set_stream(stream_executor::Stream * stream)38ExecutableRunOptions& ExecutableRunOptions::set_stream( 39 stream_executor::Stream* stream) { 40 stream_ = stream; 41 return *this; 42 } 43 stream() const44stream_executor::Stream* ExecutableRunOptions::stream() const { 45 return stream_; 46 } 47 set_host_to_device_stream(stream_executor::Stream * stream)48ExecutableRunOptions& 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() const54stream_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)58ExecutableRunOptions& 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() const64const Eigen::ThreadPoolDevice* ExecutableRunOptions::intra_op_thread_pool() 65 const { 66 return intra_op_thread_pool_; 67 } 68 set_execution_profile(ExecutionProfile * profile)69ExecutableRunOptions& ExecutableRunOptions::set_execution_profile( 70 ExecutionProfile* profile) { 71 execution_profile_ = profile; 72 return *this; 73 } 74 execution_profile() const75ExecutionProfile* ExecutableRunOptions::execution_profile() const { 76 return execution_profile_; 77 } 78 set_device_assignment(const DeviceAssignment * device_assignment)79ExecutableRunOptions& ExecutableRunOptions::set_device_assignment( 80 const DeviceAssignment* device_assignment) { 81 device_assignment_ = device_assignment; 82 return *this; 83 } 84 device_assignment() const85const DeviceAssignment* ExecutableRunOptions::device_assignment() const { 86 return device_assignment_; 87 } 88 set_rng_seed(int rng_seed)89ExecutableRunOptions& ExecutableRunOptions::set_rng_seed(int rng_seed) { 90 rng_seed_ = rng_seed; 91 return *this; 92 } 93 rng_seed() const94int ExecutableRunOptions::rng_seed() const { return rng_seed_; } 95 96 } // namespace xla 97