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/service/cpu/runtime_fft.h"
17
18 #define EIGEN_USE_THREADS
19
20 #include "absl/base/dynamic_annotations.h"
21 #include "tensorflow/compiler/xla/executable_run_options.h"
22 #include "tensorflow/compiler/xla/service/cpu/runtime_fft_impl.h"
23 #include "tensorflow/compiler/xla/service/cpu/runtime_lightweight_check.h"
24
__xla_cpu_runtime_EigenFft(const void * run_options_ptr,void * out,void * operand,int32_t fft_type,int32_t double_precision,int32_t fft_rank,int64_t input_batch,int64_t fft_length0,int64_t fft_length1,int64_t fft_length2)25 ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY void __xla_cpu_runtime_EigenFft(
26 const void* run_options_ptr, void* out, void* operand, int32_t fft_type,
27 int32_t double_precision, int32_t fft_rank, int64_t input_batch,
28 int64_t fft_length0, int64_t fft_length1, int64_t fft_length2) {
29 const xla::ExecutableRunOptions* run_options =
30 static_cast<const xla::ExecutableRunOptions*>(run_options_ptr);
31 XLA_LIGHTWEIGHT_CHECK(run_options->intra_op_thread_pool() != nullptr);
32 xla::EigenFftImpl(*run_options->intra_op_thread_pool(), out, operand,
33 static_cast<xla::internal::FftType>(fft_type),
34 static_cast<bool>(double_precision), fft_rank, input_batch,
35 fft_length0, fft_length1, fft_length2);
36 }
37