| 593 | } // namespace gpu |
| 594 | |
| 595 | void initialize_rocfft() { |
| 596 | auto rocFftAlreadyRegistered = PluginRegistry::Instance()->HasFactory( |
| 597 | rocm::kROCmPlatformId, PluginKind::kFft, gpu::kRocFftPlugin); |
| 598 | |
| 599 | if (!rocFftAlreadyRegistered) { |
| 600 | port::Status status = |
| 601 | PluginRegistry::Instance()->RegisterFactory<PluginRegistry::FftFactory>( |
| 602 | rocm::kROCmPlatformId, gpu::kRocFftPlugin, "rocFFT", |
| 603 | [](internal::StreamExecutorInterface *parent) -> fft::FftSupport * { |
| 604 | gpu::GpuExecutor *rocm_executor = |
| 605 | dynamic_cast<gpu::GpuExecutor *>(parent); |
| 606 | if (rocm_executor == nullptr) { |
| 607 | LOG(ERROR) |
| 608 | << "Attempting to initialize an instance of the rocFFT " |
| 609 | << "support library with a non-ROCM StreamExecutor"; |
| 610 | return nullptr; |
| 611 | } |
| 612 | |
| 613 | return new gpu::ROCMFft(rocm_executor); |
| 614 | }); |
| 615 | if (!status.ok()) { |
| 616 | LOG(ERROR) << "Unable to register rocFFT factory: " |
| 617 | << status.error_message(); |
| 618 | } |
| 619 | |
| 620 | PluginRegistry::Instance()->SetDefaultFactory( |
| 621 | rocm::kROCmPlatformId, PluginKind::kFft, gpu::kRocFftPlugin); |
| 622 | } |
| 623 | } |
| 624 | |
| 625 | } // namespace stream_executor |
| 626 |
no test coverage detected