| 512 | |
| 513 | template <typename FuncT, typename InputT, typename OutputT> |
| 514 | bool ROCMFft::DoFftInternal(Stream *stream, fft::Plan *plan, FuncT hipfftExec, |
| 515 | const DeviceMemory<InputT> &input, |
| 516 | DeviceMemory<OutputT> *output) { |
| 517 | ROCMFftPlan *rocm_fft_plan = dynamic_cast<ROCMFftPlan *>(plan); |
| 518 | if (rocm_fft_plan == nullptr) { |
| 519 | LOG(ERROR) << "the passed-in plan is not a ROCMFftPlan object."; |
| 520 | return false; |
| 521 | } |
| 522 | |
| 523 | if (!SetStream(parent_, rocm_fft_plan->GetPlan(), stream)) { |
| 524 | return false; |
| 525 | } |
| 526 | |
| 527 | auto ret = hipfftExec(parent_, rocm_fft_plan->GetPlan(), |
| 528 | GpuComplex(const_cast<InputT *>(GpuMemory(input))), |
| 529 | GpuComplex(GpuMemoryMutable(output))); |
| 530 | |
| 531 | if (ret != HIPFFT_SUCCESS) { |
| 532 | LOG(ERROR) << "failed to run rocFFT routine: " << ret; |
| 533 | return false; |
| 534 | } |
| 535 | |
| 536 | return true; |
| 537 | } |
| 538 | |
| 539 | template <typename FuncT, typename InputT, typename OutputT> |
| 540 | bool ROCMFft::DoFftWithDirectionInternal(Stream *stream, fft::Plan *plan, |
nothing calls this directly
no test coverage detected