| 538 | |
| 539 | template <typename FuncT, typename InputT, typename OutputT> |
| 540 | bool ROCMFft::DoFftWithDirectionInternal(Stream *stream, fft::Plan *plan, |
| 541 | FuncT hipfftExec, |
| 542 | const DeviceMemory<InputT> &input, |
| 543 | DeviceMemory<OutputT> *output) { |
| 544 | ROCMFftPlan *rocm_fft_plan = dynamic_cast<ROCMFftPlan *>(plan); |
| 545 | if (rocm_fft_plan == nullptr) { |
| 546 | LOG(ERROR) << "the passed-in plan is not a ROCMFftPlan object."; |
| 547 | return false; |
| 548 | } |
| 549 | |
| 550 | if (!SetStream(parent_, rocm_fft_plan->GetPlan(), stream)) { |
| 551 | return false; |
| 552 | } |
| 553 | |
| 554 | auto ret = hipfftExec(parent_, rocm_fft_plan->GetPlan(), |
| 555 | GpuComplex(const_cast<InputT *>(GpuMemory(input))), |
| 556 | GpuComplex(GpuMemoryMutable(output)), |
| 557 | rocm_fft_plan->GetFftDirection()); |
| 558 | |
| 559 | if (ret != HIPFFT_SUCCESS) { |
| 560 | LOG(ERROR) << "failed to run rocFFT routine: " << ret; |
| 561 | return false; |
| 562 | } |
| 563 | |
| 564 | return true; |
| 565 | } |
| 566 | |
| 567 | #define STREAM_EXECUTOR_ROCM_DEFINE_FFT(__type, __fft_type1, __fft_type2, \ |
| 568 | __fft_type3) \ |
nothing calls this directly
no test coverage detected