| 479 | |
| 480 | template <typename FuncT, typename InputT, typename OutputT> |
| 481 | bool 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) \ |
nothing calls this directly
no test coverage detected