Skip to content

Commit

Permalink
fftw_lock_test: add comments to source describing why
Browse files Browse the repository at this point in the history
  • Loading branch information
blackwer committed Sep 17, 2024
1 parent 4dd9ad7 commit 0dd134c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/fftw_lock_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@
#include <finufft.h>
#include <omp.h>

// This file tests the user locking mechanism for multi-threaded FFTW. This
// demonstrates a user lock to prevent FFTW plan calls from interfering with
// finufft plan calls (make/destroy).
// Robert Blackwell. Based on bug identified by Jonas Krimmer (9/17/24)
// See discussion at https://github.com/ludvigak/FINUFFT.jl/issues/62

constexpr int N = 65384;

// Example user lock functions
void locker(void *lck) { reinterpret_cast<std::mutex *>(lck)->lock(); }
void unlocker(void *lck) { reinterpret_cast<std::mutex *>(lck)->unlock(); }

Expand Down

0 comments on commit 0dd134c

Please sign in to comment.