1 /* Copyright 2018 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/service/gpu/gpu_constants.h" 17 #include "tensorflow/core/framework/allocator.h" 18 19 namespace xla { 20 namespace gpu { 21 22 // kEntryParameterAlignBytes is equal to EIGEN_MAX_ALIGN_BYTES, though including 23 // Eigen headers here to get that symbol may not be a good idea. 24 // EIGEN_MAX_ALIGN_BYTES may differ between CUDA-enabled builds vs CUDA-disabled 25 // builds and we don't want the IR generated by XLA:GPU to depend on that. 26 // 27 // TODO(b/111767313): Consider raising EIGEN_MAX_ALIGN_BYTES if it helps. 28 const int64 kEntryParameterAlignBytes = 16; 29 30 const int64 kXlaAllocatedBufferAlignBytes = 31 tensorflow::Allocator::kAllocatorAlignment; 32 33 const int64 kConstantBufferAlignBytes = kXlaAllocatedBufferAlignBytes; 34 35 } // namespace gpu 36 } // namespace xla 37