Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mreineck committed Dec 30, 2024
1 parent 64d1565 commit c6232d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions include/finufft/finufft_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ template<typename TF> struct FINUFFT_PLAN_T { // the main plan class, fully C++

std::array<UBIGINT, 3> mstu; // number of modes in x/y/z dir (historical CMCL name) =
// N1/N2/N3
UBIGINT N; // total # modes (prod of above three)
inline UBIGINT N() { return mstu[0]*mstu[1]*mstu[2]; } // total # modes (prod of above three)

std::array<UBIGINT, 3> nf123 = {1, 1, 1}; // size of internal fine grid in x/y/z
// direction
std::array<UBIGINT, 3> nf123{1, 1, 1}; // size of internal fine grid in x/y/z
// direction
UBIGINT nf = 1; // total # fine grid points (product of the above three)

int fftSign; // sign in exponential for NUFFT defn, guaranteed to be +-1
Expand Down
10 changes: 4 additions & 6 deletions src/finufft_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ static int deconvolveBatch(int batchSize, FINUFFT_PLAN_T<T> *p, std::complex<T>
for (int i = 0; i < batchSize; i++) {
std::complex<T> *fwi = p->fwBatch.data() + i * p->nf; // start of i'th fw array in
// wkspace
std::complex<T> *fki = fkBatch + i * p->N; // start of i'th fk array in fkBatch
std::complex<T> *fki = fkBatch + i * p->N(); // start of i'th fk array in fkBatch

// Call routine from common.cpp for the dim; prefactors hardcoded to 1.0...
if (p->dim == 1)
Expand Down Expand Up @@ -625,10 +625,8 @@ FINUFFT_PLAN_T<TF>::FINUFFT_PLAN_T(int type_, int dim_, const BIGINT *n_modes, i
}

if (type != 3) { // read in user Fourier mode array sizes...
N = 1;
for (int idim = 0; idim < 3; ++idim) {
mstu[idim] = (idim < dim) ? n_modes[idim] : 1;
N *= mstu[idim];
}
}

Expand All @@ -638,8 +636,8 @@ FINUFFT_PLAN_T<TF>::FINUFFT_PLAN_T(int type_, int dim_, const BIGINT *n_modes, i
if (tol >= (TF)1E-9) { // the tol sigma=5/4 can reach
if (type == 3) // could move to setpts, more known?
opts.upsampfac = 1.25; // faster b/c smaller RAM & FFT
else if ((dim == 1 && N > 10000000) || (dim == 2 && N > 300000) ||
(dim == 3 && N > 3000000)) // type 1,2 heuristic cutoffs, double,
else if ((dim == 1 && N() > 10000000) || (dim == 2 && N() > 300000) ||
(dim == 3 && N() > 3000000)) // type 1,2 heuristic cutoffs, double,
// typ tol, 12-core xeon
opts.upsampfac = 1.25;
}
Expand Down Expand Up @@ -993,7 +991,7 @@ int FINUFFT_PLAN_T<TF>::execute(std::complex<TF> *cj, std::complex<TF> *fk) {
int thisBatchSize = std::min(ntrans - b * batchSize, batchSize);
int bB = b * batchSize; // index of vector, since batchsizes same
std::complex<TF> *cjb = cj + bB * nj; // point to batch of weights
std::complex<TF> *fkb = fk + bB * N; // point to batch of mode coeffs
std::complex<TF> *fkb = fk + bB * N(); // point to batch of mode coeffs
if (opts.debug > 1)
printf("[%s] start batch %d (size %d):\n", __func__, b, thisBatchSize);

Expand Down

0 comments on commit c6232d9

Please sign in to comment.