1 /* Copyright 2016 The TensorFlow Authors. All Rights Reserved. 2 Licensed under the Apache License, Version 2.0 (the "License"); 3 you may not use this file except in compliance with the License. 4 You may obtain a copy of the License at 5 6 http://www.apache.org/licenses/LICENSE-2.0 7 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 15 #if GOOGLE_CUDA 16 17 #define EIGEN_USE_GPU 18 19 #include "tensorflow/core/kernels/adjust_hsv_gpu.cu.h" 20 #include "tensorflow/core/kernels/adjust_hue_op.h" 21 #include "tensorflow/core/util/cuda_kernel_helper.h" 22 23 namespace tensorflow { 24 25 namespace functor { 26 27 void AdjustHueGPU::operator()(GPUDevice* device, const int64 number_of_elements, 28 const float* const input, 29 const float* const delta, float* const output) { 30 const auto stream = device->stream(); 31 const CudaLaunchConfig config = 32 GetCudaLaunchConfig(number_of_elements, *device); 33 const int threads_per_block = config.thread_per_block; 34 const int block_count = 35 (number_of_elements + threads_per_block - 1) / threads_per_block; 36 internal::adjust_hsv_nhwc<true, false, false> 37 <<<block_count, threads_per_block, 0, stream>>>( 38 number_of_elements, input, output, delta, nullptr, nullptr); 39 } 40 } // namespace functor 41 } // namespace tensorflow 42 #endif // GOOGLE_CUDA 43