| 533 | } // namespace gpu |
| 534 | |
| 535 | void initialize_cufft() { |
| 536 | port::Status status = |
| 537 | PluginRegistry::Instance()->RegisterFactory<PluginRegistry::FftFactory>( |
| 538 | cuda::kCudaPlatformId, gpu::kCuFftPlugin, "cuFFT", |
| 539 | [](internal::StreamExecutorInterface *parent) -> fft::FftSupport * { |
| 540 | gpu::GpuExecutor *cuda_executor = |
| 541 | dynamic_cast<gpu::GpuExecutor *>(parent); |
| 542 | if (cuda_executor == nullptr) { |
| 543 | LOG(ERROR) << "Attempting to initialize an instance of the cuFFT " |
| 544 | << "support library with a non-CUDA StreamExecutor"; |
| 545 | return nullptr; |
| 546 | } |
| 547 | |
| 548 | return new gpu::CUDAFft(cuda_executor); |
| 549 | }); |
| 550 | if (!status.ok()) { |
| 551 | LOG(ERROR) << "Unable to register cuFFT factory: " |
| 552 | << status.error_message(); |
| 553 | } |
| 554 | |
| 555 | PluginRegistry::Instance()->SetDefaultFactory( |
| 556 | cuda::kCudaPlatformId, PluginKind::kFft, gpu::kCuFftPlugin); |
| 557 | } |
| 558 | |
| 559 | } // namespace stream_executor |
| 560 |
no test coverage detected