Skip to content

Commit 577c69f

Browse files
committed
fixed compiler warnings
1 parent 7904eef commit 577c69f

File tree

4 files changed

+15
-21
lines changed

4 files changed

+15
-21
lines changed

include/finufft/spreadinterp.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ template<typename T>
3535
FINUFFT_EXPORT int FINUFFT_CDECL spreadinterp(
3636
UBIGINT N1, UBIGINT N2, UBIGINT N3, T *data_uniform, UBIGINT M, T *kx, T *ky, T *kz,
3737
T *data_nonuniform, const finufft_spread_opts &opts);
38-
template<typename T>
38+
3939
FINUFFT_EXPORT int FINUFFT_CDECL spreadcheck(UBIGINT N1, UBIGINT N2, UBIGINT N3,
40-
UBIGINT N, T *kx, T *ky, T *kz,
4140
const finufft_spread_opts &opts);
4241
template<typename T>
4342
FINUFFT_EXPORT int FINUFFT_CDECL indexSort(std::vector<BIGINT> &sort_indices, UBIGINT N1,

src/fft.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ template std::vector<int> gridsize_for_fft<float>(const FINUFFT_PLAN_T<float> &p
1919
template std::vector<int> gridsize_for_fft<double>(const FINUFFT_PLAN_T<double> &p);
2020

2121
template<typename TF>
22-
void do_fft(const FINUFFT_PLAN_T<TF> &p, std::complex<TF> *fwBatch, int ntrans_actual,
23-
bool adjoint) {
22+
void do_fft(const FINUFFT_PLAN_T<TF> &p, std::complex<TF> *fwBatch,
23+
int ntrans_actual [[maybe_unused]], bool adjoint) {
2424
#ifdef FINUFFT_USE_DUCC0
2525
size_t nthreads = min<size_t>(MY_OMP_GET_MAX_THREADS(), p.opts.nthreads);
2626
const auto ns = gridsize_for_fft(p);

src/finufft_core.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ int FINUFFT_PLAN_T<TF>::setpts(BIGINT nj, TF *xj, TF *yj, TF *zj, BIGINT nk, TF
815815
if (type != 3) { // ------------------ TYPE 1,2 SETPTS -------------------
816816
// (all we can do is check and maybe bin-sort the NU pts)
817817
XYZ = {xj, yj, zj}; // plan must keep pointers to user's fixed NU pts
818-
int ier = spreadcheck(nfdim[0], nfdim[1], nfdim[2], nj, xj, yj, zj, spopts);
818+
int ier = spreadcheck(nfdim[0], nfdim[1], nfdim[2], spopts);
819819
if (ier) // no warnings allowed here
820820
return ier;
821821
timer.restart();

src/spreadinterp.cpp

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct zip_hi {
3434
}
3535
};
3636
template<unsigned cap> struct reverse_index {
37-
static constexpr unsigned get(unsigned index, const unsigned size) {
37+
static constexpr unsigned get(unsigned index, const unsigned /*size*/) {
3838
return index < cap ? (cap - 1 - index) : index;
3939
}
4040
};
@@ -280,7 +280,8 @@ template<typename T, uint8_t w, uint8_t upsampfact,
280280
class simd_type =
281281
xsimd::make_sized_batch_t<T, find_optimal_simd_width<T, w>()>> // aka ns
282282
static FINUFFT_ALWAYS_INLINE void eval_kernel_vec_Horner(
283-
T *FINUFFT_RESTRICT ker, T x, const finufft_spread_opts &opts) noexcept
283+
T *FINUFFT_RESTRICT ker, T x,
284+
const finufft_spread_opts &opts [[maybe_unused]]) noexcept
284285
/* Fill ker[] with Horner piecewise poly approx to [-w/2,w/2] ES kernel eval at
285286
x_j = x + j, for j=0,..,w-1. Thus x in [-w/2,-w/2+1]. w is aka ns.
286287
This is the current evaluation method, since it's faster (except i7 w=16).
@@ -1394,7 +1395,7 @@ template<typename T>
13941395
static void bin_sort_singlethread(std::vector<BIGINT> &ret, UBIGINT M, const T *kx,
13951396
const T *ky, const T *kz, UBIGINT N1, UBIGINT N2,
13961397
UBIGINT N3, double bin_size_x, double bin_size_y,
1397-
double bin_size_z, int debug)
1398+
double bin_size_z, int debug [[maybe_unused]])
13981399
/* Returns permutation of all nonuniform points with good RAM access,
13991400
* ie less cache misses for spreading, in 1D, 2D, or 3D. Single-threaded version
14001401
*
@@ -1466,9 +1467,10 @@ static void bin_sort_singlethread(std::vector<BIGINT> &ret, UBIGINT M, const T *
14661467
}
14671468

14681469
template<typename T>
1469-
static void bin_sort_multithread(std::vector<BIGINT> &ret, UBIGINT M, T *kx, T *ky, T *kz,
1470-
UBIGINT N1, UBIGINT N2, UBIGINT N3, double bin_size_x,
1471-
double bin_size_y, double bin_size_z, int debug,
1470+
static void bin_sort_multithread(std::vector<BIGINT> &ret, UBIGINT M, T *kx, T *ky,
1471+
T *kz, UBIGINT N1, UBIGINT N2, UBIGINT N3,
1472+
double bin_size_x, double bin_size_y,
1473+
double bin_size_z, int debug [[maybe_unused]],
14721474
int nthr)
14731475
/* Mostly-OpenMP'ed version of bin_sort.
14741476
For documentation see: bin_sort_singlethread.
@@ -1680,7 +1682,7 @@ FINUFFT_EXPORT int FINUFFT_CDECL spreadinterp(
16801682
Tidy, Barnett 5/20/20. Tidy doc, Barnett 10/22/20.
16811683
*/
16821684
{
1683-
int ier = spreadcheck(N1, N2, N3, M, kx, ky, kz, opts);
1685+
int ier = spreadcheck(N1, N2, N3, opts);
16841686
if (ier) return ier;
16851687
std::vector<BIGINT> sort_indices(M);
16861688
int did_sort = indexSort(sort_indices, N1, N2, N3, M, kx, ky, kz, opts);
@@ -1696,7 +1698,7 @@ template FINUFFT_EXPORT int FINUFFT_CDECL spreadinterp<double>(
16961698
UBIGINT N1, UBIGINT N2, UBIGINT N3, double *data_uniform, UBIGINT M, double *kx,
16971699
double *ky, double *kz, double *data_nonuniform, const finufft_spread_opts &opts);
16981700

1699-
static constexpr uint8_t ndims_from_Ns(const UBIGINT N1, const UBIGINT N2,
1701+
static constexpr uint8_t ndims_from_Ns(const UBIGINT /*N1*/, const UBIGINT N2,
17001702
const UBIGINT N3)
17011703
/* rule for getting number of spreading dimensions from the list of Ns per dim.
17021704
Split out, Barnett 7/26/18
@@ -1705,9 +1707,7 @@ static constexpr uint8_t ndims_from_Ns(const UBIGINT N1, const UBIGINT N2,
17051707
return 1 + (N2 > 1) + (N3 > 1);
17061708
}
17071709

1708-
template<typename T>
1709-
int spreadcheck(UBIGINT N1, UBIGINT N2, UBIGINT N3, UBIGINT M, T *kx, T *ky, T *kz,
1710-
const finufft_spread_opts &opts)
1710+
int spreadcheck(UBIGINT N1, UBIGINT N2, UBIGINT N3, const finufft_spread_opts &opts)
17111711
/* This does just the input checking and reporting for the spreader.
17121712
See spreadinterp() for input arguments and meaning of returned value.
17131713
Split out by Melody Shih, Jun 2018. Finiteness chk Barnett 7/30/18.
@@ -1729,11 +1729,6 @@ int spreadcheck(UBIGINT N1, UBIGINT N2, UBIGINT N3, UBIGINT M, T *kx, T *ky, T *
17291729
}
17301730
return 0;
17311731
}
1732-
template int spreadcheck<float>(UBIGINT N1, UBIGINT N2, UBIGINT N3, UBIGINT M, float *kx,
1733-
float *ky, float *kz, const finufft_spread_opts &opts);
1734-
template int spreadcheck<double>(UBIGINT N1, UBIGINT N2, UBIGINT N3, UBIGINT M,
1735-
double *kx, double *ky, double *kz,
1736-
const finufft_spread_opts &opts);
17371732

17381733
template<typename T>
17391734
int indexSort(std::vector<BIGINT> &sort_indices, UBIGINT N1, UBIGINT N2, UBIGINT N3,

0 commit comments

Comments
 (0)