| 452 | |
| 453 | template <typename FuncT, typename InputT, typename OutputT> |
| 454 | bool 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 | |
| 480 | template <typename FuncT, typename InputT, typename OutputT> |
| 481 | bool CUDAFft::DoFftWithDirectionInternal(Stream *stream, fft::Plan *plan, |
nothing calls this directly
no test coverage detected