Skip to content

Commit 214f4b9

Browse files
committed
Fix build failure due to ambiguous PI and cleanup namespaces
1 parent 6e86af6 commit 214f4b9

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

include/finufft_common/kernel.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
#include <finufft_common/utils.h>
1010
#include <finufft_spread_opts.h>
1111

12-
using namespace finufft::common;
13-
1412
namespace finufft::kernel {
1513

1614
template<class T, class F> std::vector<T> fit_monomials(F &&f, int n, T a, T b) noexcept {
@@ -90,8 +88,8 @@ template<typename T> T evaluate_kernel(T x, T beta, T c, int kerformula = 0) {
9088
if (c * x * x >= T(1)) return T(0.0); // prevent nonpositive sqrts
9189
const T inner = std::sqrt(T(1) - c * x * x);
9290
const T arg = beta * inner;
93-
const double i0_arg = ::finufft::common::cyl_bessel_i(0, static_cast<double>(arg));
94-
const double i0_beta = ::finufft::common::cyl_bessel_i(0, static_cast<double>(beta));
91+
const double i0_arg = common::cyl_bessel_i(0, static_cast<double>(arg));
92+
const double i0_beta = common::cyl_bessel_i(0, static_cast<double>(beta));
9593
return static_cast<T>(i0_arg / i0_beta);
9694
}
9795
return T(0.0);
@@ -107,10 +105,10 @@ FINUFFT_EXPORT double sigma_max_tol(double upsampfac, int kerformula, int max_ns
107105

108106
// min and max number of poly coeffs allowed (compiled) for a given spread width ns
109107
inline constexpr int min_nc_given_ns(int ns) {
110-
return std::max(MIN_NC, ns - 1); // note must stay in bounds from constants.h
108+
return std::max(common::MIN_NC, ns - 1); // note must stay in bounds from constants.h
111109
}
112110
inline constexpr int max_nc_given_ns(int ns) {
113-
return std::min(MAX_NC, ns + 3); // "
111+
return std::min(common::MAX_NC, ns + 3); // "
114112
}
115113

116114
template<int NS, int NC> inline constexpr bool ValidKernelParams() noexcept {

perftest/cuda/cuperftest.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <thrust/device_vector.h>
1515
#include <thrust/host_vector.h>
1616

17-
static const double PI = 3.141592653589793238462643383279502884;
17+
using finufft::common::PI;
1818

1919
std::string get_or(const std::unordered_map<std::string, std::string> &m,
2020
const std::string &key, const std::string &default_value) {

0 commit comments

Comments
 (0)