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

Method DoFftInternal

tensorflow/stream_executor/cuda/cuda_fft.cc:454–478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

452
453template <typename FuncT, typename InputT, typename OutputT>
454bool CUDAFft::DoFftInternal(Stream *stream, fft::Plan *plan, FuncT cufftExec,
455 const DeviceMemory<InputT> &input,
456 DeviceMemory<OutputT> *output) {
457 CUDAFftPlan *cuda_fft_plan = dynamic_cast<CUDAFftPlan *>(plan);
458 if (cuda_fft_plan == nullptr) {
459 LOG(ERROR) << "the passed-in plan is not a CUDAFftPlan object.";
460 return false;
461 }
462
463 if (!SetStream(parent_, cuda_fft_plan->GetPlan(), stream)) {
464 return false;
465 }
466
467 cuda::ScopedActivateExecutorContext sac(parent_);
468 auto ret = cufftExec(cuda_fft_plan->GetPlan(),
469 GpuComplex(const_cast<InputT *>(GpuMemory(input))),
470 GpuComplex(GpuMemoryMutable(output)));
471
472 if (ret != CUFFT_SUCCESS) {
473 LOG(ERROR) << "failed to run cuFFT routine: " << ret;
474 return false;
475 }
476
477 return true;
478}
479
480template <typename FuncT, typename InputT, typename OutputT>
481bool CUDAFft::DoFftWithDirectionInternal(Stream *stream, fft::Plan *plan,

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected