Skip to content

Commit

Permalink
fftw_lock: fix issue when null opts passed
Browse files Browse the repository at this point in the history
  • Loading branch information
blackwer committed Sep 4, 2024
1 parent 754800f commit c39d17b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/finufft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ int FINUFFT_MAKEPLAN(int type, int dim, BIGINT *n_modes, int iflag, int ntrans,
fprintf(stderr, "[%s] ntrans (%d) should be at least 1.\n", __func__, ntrans);
return FINUFFT_ERR_NTRANS_NOTVALID;
}
if (!opts->fftw_lock_fun != !opts->fftw_unlock_fun) {
if (!p->opts.fftw_lock_fun != !p->opts.fftw_unlock_fun) {
fprintf(stderr, "[%s] fftw_(un)lock functions should be both null or both set\n",
__func__);
return FINUFFT_ERR_LOCK_FUNS_INVALID;
Expand Down Expand Up @@ -692,8 +692,8 @@ int FINUFFT_MAKEPLAN(int type, int dim, BIGINT *n_modes, int iflag, int ntrans,
// thread-safe (can be called inside OMP)
{
static bool did_fftw_init = false; // the only global state of FINUFFT
FFTWLockGuard lock(opts->fftw_lock_fun, opts->fftw_unlock_fun,
opts->fftw_lock_data);
FFTWLockGuard lock(p->opts.fftw_lock_fun, p->opts.fftw_unlock_fun,
p->opts.fftw_lock_data);
if (!did_fftw_init) {
FFTW_INIT(); // setup FFTW global state; should only do once
did_fftw_init = true; // ensure other FINUFFT threads don't clash
Expand Down

0 comments on commit c39d17b

Please sign in to comment.