MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / DoFftWithDirectionInternal

Method DoFftWithDirectionInternal

tensorflow/stream_executor/cuda/cuda_fft.cc:481–507  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

479
480template <typename FuncT, typename InputT, typename OutputT>
481bool CUDAFft::DoFftWithDirectionInternal(Stream *stream, fft::Plan *plan,
482 FuncT cufftExec,
483 const DeviceMemory<InputT> &input,
484 DeviceMemory<OutputT> *output) {
485 CUDAFftPlan *cuda_fft_plan = dynamic_cast<CUDAFftPlan *>(plan);
486 if (cuda_fft_plan == nullptr) {
487 LOG(ERROR) << "the passed-in plan is not a CUDAFftPlan object.";
488 return false;
489 }
490
491 if (!SetStream(parent_, cuda_fft_plan->GetPlan(), stream)) {
492 return false;
493 }
494
495 cuda::ScopedActivateExecutorContext sac(parent_);
496 auto ret = cufftExec(cuda_fft_plan->GetPlan(),
497 GpuComplex(const_cast<InputT *>(GpuMemory(input))),
498 GpuComplex(GpuMemoryMutable(output)),
499 cuda_fft_plan->GetFftDirection());
500
501 if (ret != CUFFT_SUCCESS) {
502 LOG(ERROR) << "failed to run cuFFT routine: " << ret;
503 return false;
504 }
505
506 return true;
507}
508
509#define STREAM_EXECUTOR_CUDA_DEFINE_FFT(__type, __fft_type1, __fft_type2, \
510 __fft_type3) \

Callers

nothing calls this directly

Calls 6

GpuComplexFunction · 0.85
GpuMemoryFunction · 0.85
GpuMemoryMutableFunction · 0.85
SetStreamFunction · 0.70
GetPlanMethod · 0.45
GetFftDirectionMethod · 0.45

Tested by

no test coverage detected