Skip to content

Commit

Permalink
some cleanup & removed linux headers on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamonDinoia committed Jan 23, 2025
1 parent 29f2e71 commit cdefccc
Show file tree
Hide file tree
Showing 28 changed files with 162 additions and 277 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fortran/examples/nufft2dmany_demof
fortran/examples/nufft3d_demof
test/dumbinputs
test/finufft1d_basicpassfail
test/testutils
test/testlib
__pycache__*

docs/_build
Expand Down
20 changes: 6 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -248,27 +248,19 @@ function(set_finufft_options target)
endfunction()

if(FINUFFT_USE_CPU)
# Main finufft libraries
if(NOT FINUFFT_STATIC_LINKING)
add_library(
finufft SHARED
set(FINUFFT_SOURCES
src/spreadinterp.cpp
src/utils.cpp
contrib/legendre_rule_fast.cpp
src/fft.cpp
src/finufft_core.cpp
src/c_interface.cpp
src/finufft_utils.cpp
fortran/finufftfort.cpp)
# Main finufft libraries
if(NOT FINUFFT_STATIC_LINKING)
add_library(finufft SHARED ${FINUFFT_SOURCES})
else()
add_library(
finufft STATIC
src/spreadinterp.cpp
src/utils.cpp
contrib/legendre_rule_fast.cpp
src/fft.cpp
src/finufft_core.cpp
src/c_interface.cpp
fortran/finufftfort.cpp)
add_library(finufft STATIC ${FINUFFT_SOURCES})
endif()
set_finufft_options(finufft)

Expand Down
19 changes: 8 additions & 11 deletions devel/foldrescale.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "finufft/defs.h"
#include "finufft/test_defs.h"
#include <benchmark/benchmark.h>
#include <cmath>
#include <immintrin.h>
#include <iostream>
#include <random>
// no vectorize
Expand All @@ -17,22 +16,22 @@
This should be done in C++ not as a macro, someday.
*/
#define FOLDRESCALE(x, N, p) \
(p ? (x + (x >= -PI ? (x < PI ? PI : -PI) : 3 * PI)) * ((FLT)M_1_2PI * N) \
(p ? (x + (x >= -PI ? (x < PI ? PI : -PI) : 3 * PI)) * ((FLT)INV_2PI * N) \
: (x >= 0.0 ? (x < (FLT)N ? x : x - (FLT)N) : x + (FLT)N))

#define FOLDRESCALE04(x, N, p) \
(p ? ((x * FLT(M_1_2PI) + FLT(0.5)) - floor(x * FLT(M_1_2PI) + FLT(0.5))) * FLT(N) \
(p ? ((x * FLT(INV_2PI) + FLT(0.5)) - floor(x * FLT(INV_2PI) + FLT(0.5))) * FLT(N) \
: ((x / FLT(N)) - floor(x / FLT(N))) * FLT(N))

#define FOLDRESCALE05(x, N, p) \
FLT(N) * (p ? ((x * FLT(M_1_2PI) + FLT(0.5)) - floor(x * FLT(M_1_2PI) + FLT(0.5))) \
FLT(N) * (p ? ((x * FLT(INV_2PI) + FLT(0.5)) - floor(x * FLT(INV_2PI) + FLT(0.5))) \
: ((x / FLT(N)) - floor(x / FLT(N))))

inline __attribute__((always_inline)) FLT foldRescale00(FLT x, BIGINT N, bool p) {
FLT result;
FLT fN = FLT(N);
if (p) {
static constexpr FLT x2pi = FLT(M_1_2PI);
static constexpr FLT x2pi = FLT(INV_2PI);
result = x * x2pi + FLT(0.5);
result -= floor(result);
} else {
Expand All @@ -44,14 +43,14 @@ inline __attribute__((always_inline)) FLT foldRescale00(FLT x, BIGINT N, bool p)
}

inline __attribute__((always_inline)) FLT foldRescale01(FLT x, BIGINT N, bool p) {
return p ? (x + (x >= -PI ? (x < PI ? PI : -PI) : 3 * PI)) * ((FLT)M_1_2PI * N)
return p ? (x + (x >= -PI ? (x < PI ? PI : -PI) : 3 * PI)) * ((FLT)INV_2PI * N)
: (x >= 0.0 ? (x < (FLT)N ? x : x - (FLT)N) : x + (FLT)N);
}

template<bool p>
inline __attribute__((always_inline)) FLT foldRescale02(FLT x, BIGINT N) {
if constexpr (p) {
return (x + (x >= -PI ? (x < PI ? PI : -PI) : 3 * PI)) * ((FLT)M_1_2PI * N);
return (x + (x >= -PI ? (x < PI ? PI : -PI) : 3 * PI)) * ((FLT)INV_2PI * N);
} else {
return (x >= 0.0 ? (x < (FLT)N ? x : x - (FLT)N) : x + (FLT)N);
}
Expand All @@ -62,7 +61,7 @@ inline __attribute__((always_inline)) FLT foldRescale03(FLT x, BIGINT N) {
FLT result;
FLT fN = FLT(N);
if constexpr (p) {
static constexpr FLT x2pi = FLT(M_1_2PI);
static constexpr FLT x2pi = FLT(INV_2PI);
result = std::fma(x, x2pi, FLT(0.5));
result -= floor(result);
} else {
Expand All @@ -73,7 +72,6 @@ inline __attribute__((always_inline)) FLT foldRescale03(FLT x, BIGINT N) {
return result * fN;
}


static std::mt19937_64 gen;
static std::uniform_real_distribution<> dis(-10, 10);
static const auto N = std::uniform_int_distribution<>{0, 1000}(gen);
Expand Down Expand Up @@ -185,7 +183,6 @@ static void BM_FoldRescale05N(benchmark::State &state) {
}
}


BENCHMARK(BM_BASELINE)->Iterations(10000000);
BENCHMARK(BM_FoldRescaleMacro)->Iterations(1000000);
BENCHMARK(BM_FoldRescale00)->Iterations(1000000);
Expand Down
19 changes: 3 additions & 16 deletions include/cufinufft/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@

#include <thrust/extrema.h>

#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#include <math.h>
#endif
#include <cmath>

#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 600 || defined(__clang__)
#else
Expand Down Expand Up @@ -96,21 +98,6 @@ class WithCudaDevice {
}
};

// jfm timer class
class CNTime {
public:
void start();
double restart();
double elapsedsec();

private:
#ifdef _WIN32
LARGE_INTEGER initial, frequency;
#else
struct timeval initial;
#endif
};

// ahb math helpers
CUFINUFFT_BIGINT next235beven(CUFINUFFT_BIGINT n, CUFINUFFT_BIGINT b);

Expand Down
36 changes: 0 additions & 36 deletions include/finufft/dirft.h

This file was deleted.

73 changes: 73 additions & 0 deletions include/finufft/finufft_utils.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// Header for utils.cpp, a little library of low-level array stuff.
// These are just the functions which depend on single/double precision (FLT)

#pragma once

#include <chrono>
#include <cmath>

#include "finufft_core.h"

// for CNTime...
// using chrono since the interface is portable between linux and windows

namespace finufft::utils {

template<typename T>
FINUFFT_ALWAYS_INLINE void arrayrange(BIGINT n, const T *a, T *lo, T *hi)

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, Off, Release, cl, cl, On)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, Off, Release, cl, cl, On)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, Off, Release, cl, cl, On)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, Off, Release, cl, cl, On)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, On, Release, cl, cl, On)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, On, Release, cl, cl, On)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, On, Release, cl, cl, On)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, On, Release, cl, cl, On)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, On, Release, cl, cl, On)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, On, Release, cl, cl, On)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, On, Release, cl, cl, On)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, On, Release, cl, cl, On)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, On, Release, cl, cl, On)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, On, Release, cl, cl, On)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, Off, Release, cl, cl, On)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, Off, Release, cl, cl, On)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, Off, Release, cl, cl, On)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, Off, Release, cl, cl, On)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, Off, Release, cl, cl, On)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, Off, Release, cl, cl, On)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 17 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, Off, Release, cl, cl, Off)

'inline': used more than once
// With a a length-n array, writes out min(a) to lo and max(a) to hi,
// so that all a values lie in [lo,hi].
// If n==0, lo and hi are not finite.
{
*lo = INFINITY;
*hi = -INFINITY;
for (BIGINT m = 0; m < n; ++m) {
if (a[m] < *lo) *lo = a[m];
if (a[m] > *hi) *hi = a[m];
}
}
template<typename T>
FINUFFT_ALWAYS_INLINE void arraywidcen(BIGINT n, const T *a, T *w, T *c)

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, Off, Release, cl, cl, On)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, Off, Release, cl, cl, On)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, Off, Release, cl, cl, On)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, Off, Release, cl, cl, On)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, On, Release, cl, cl, On)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, On, Release, cl, cl, On)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, On, Release, cl, cl, On)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, On, Release, cl, cl, On)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, On, Release, cl, cl, On)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, On, Release, cl, cl, On)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, On, Release, cl, cl, On)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, On, Release, cl, cl, On)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, On, Release, cl, cl, On)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, On, Release, cl, cl, On)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, Off, Release, cl, cl, On)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, Off, Release, cl, cl, On)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, Off, Release, cl, cl, On)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, Off, Release, cl, cl, On)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, Off, Release, cl, cl, On)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, Off, Release, cl, cl, On)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, On, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:SSE2, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, /arch:AVX2, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, Off, Release, cl, cl, Off)

'inline': used more than once

Check warning on line 30 in include/finufft/finufft_utils.hpp

View workflow job for this annotation

GitHub Actions / cmake-ci (windows-2022, msvc, native, Off, Release, cl, cl, Off)

'inline': used more than once
// Writes out w = half-width and c = center of an interval enclosing all a[n]'s
// Only chooses a nonzero center if this increases w by less than fraction
// ARRAYWIDCEN_GROWFRAC defined in finufft_core.h.
// This prevents rephasings which don't grow nf by much. 6/8/17
// If n==0, w and c are not finite.
{
T lo, hi;
arrayrange(n, a, &lo, &hi);
*w = (hi - lo) / 2;
*c = (hi + lo) / 2;
if (std::abs(*c) < ARRAYWIDCEN_GROWFRAC * (*w)) {
*w += std::abs(*c);
*c = 0.0;
}
}

BIGINT next235even(BIGINT n);

// jfm's timer class
class FINUFFT_EXPORT CNTime {
public:
FINUFFT_NEVER_INLINE void start();
FINUFFT_NEVER_INLINE double restart();
FINUFFT_NEVER_INLINE double elapsedsec() const;

private:
double initial;
};

// openmp helpers
int get_num_threads_parallel_block();

} // namespace finufft::utils

// thread-safe rand number generator for Windows platform
#ifdef _WIN32
#include <random>
namespace finufft {
namespace common {
int rand_r(unsigned int *seedp);
} // namespace common
} // namespace finufft
#endif
1 change: 0 additions & 1 deletion include/finufft/test_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

// convenient private finufft internals
#include <finufft/finufft_core.h>
#include <finufft/utils.h>
#include <memory>

// --------------- Private data types for compilation in either prec ---------
Expand Down
114 changes: 0 additions & 114 deletions include/finufft/utils.h

This file was deleted.

Loading

0 comments on commit cdefccc

Please sign in to comment.