Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cufftHandle is created twice #211

Closed
tpadioleau opened this issue Dec 5, 2024 · 1 comment · Fixed by #212
Closed

cufftHandle is created twice #211

tpadioleau opened this issue Dec 5, 2024 · 1 comment · Fixed by #212

Comments

@tpadioleau
Copy link
Member

I suspect we create twice the CUDA plan, once with cufftCreate and again with cufftPlan1d

cufftResult cufft_rt = cufftCreate(&(*plan));
KOKKOSFFT_THROW_IF(cufft_rt != CUFFT_SUCCESS, "cufftCreate failed");
cudaStream_t stream = exec_space.cuda_stream();
cufftSetStream((*plan), stream);
auto type = KokkosFFT::Impl::transform_type<ExecutionSpace, in_value_type,
out_value_type>::type();
auto [in_extents, out_extents, fft_extents, howmany] =
KokkosFFT::Impl::get_extents(in, out, axes, s, is_inplace);
const int nx = fft_extents.at(0);
int fft_size = std::accumulate(fft_extents.begin(), fft_extents.end(), 1,
std::multiplies<>());
cufft_rt = cufftPlan1d(&(*plan), nx, type, howmany);
KOKKOSFFT_THROW_IF(cufft_rt != CUFFT_SUCCESS, "cufftPlan1d failed");

From what I understand in the cuFFT documentation, we should either

Notice that both cufftCreate and cufftPlan1d take the plan by pointer whereas cufftMakePlan1d takes it by copy.

@yasahi-hpc
Copy link
Collaborator

That is true. I will make a fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants