Skip to content

Commit

Permalink
Fixed my previous fix for release builds
Browse files Browse the repository at this point in the history
  • Loading branch information
JJPPeters committed Jun 23, 2021
1 parent d48b10e commit b2a19b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/Strain/gpa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ GPA::GPA(Eigen::MatrixXcd img)

// I think I had an error when using NULL before as technically they are the same and FFTW tries to optimise
// for in-place FFTs..., These are just temporary to avoid that
fftw_complex* temp_1;
fftw_complex* temp_2;
// can't just make pointer as it gets compiled out in release builds?
fftw_complex temp_1 [1] = {};
fftw_complex temp_2 [1] = {};

_FFTplan = std::make_shared<fftw_plan>(fftw_plan_dft_2d(static_cast<int>(_Image->rows()),
static_cast<int>(_Image->cols()), temp_1, temp_2, FFTW_FORWARD, FFTW_ESTIMATE));
Expand Down
4 changes: 2 additions & 2 deletions src/Strain/phase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Phase::Phase(std::shared_ptr<Eigen::MatrixXcd> inputFFT, double gx, double gy, d
_FFTplan = std::move(forwardPlan);
_IFFTplan = std::move(inversePlan);

fftw_complex* temp_1;
fftw_complex* temp_2;
fftw_complex temp_1 [1] = {};
fftw_complex temp_2 [1] = {};

_FFTdiffplan = std::make_shared<fftw_plan>(fftw_plan_dft_2d(static_cast<int>(_FFT->rows() + 2),
static_cast<int>(_FFT->cols() + 2), temp_1, temp_2, FFTW_FORWARD, FFTW_ESTIMATE));
Expand Down

0 comments on commit b2a19b3

Please sign in to comment.