Skip to content

Commit

Permalink
Make cufinufft compiles with CUDA 12 on Windows (#604)
Browse files Browse the repository at this point in the history
* Make cufinufft compiles with CUDA 12 on Windows

* Ensure cufinufft exports symbols on Windows to use with Python

* some cleanup & removed linux headers on windows

* reducing size of cufinufft tests

* fixing windows include issue

* fixing makefile

* committed missing include

* fixed rand_r windows

* removed unused include

---------

Co-authored-by: metab0t <[email protected]>
  • Loading branch information
DiamonDinoia and metab0t authored Jan 27, 2025
1 parent 4c949c6 commit c28744a
Show file tree
Hide file tree
Showing 31 changed files with 230 additions and 310 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
29 changes: 10 additions & 19 deletions include/cufinufft/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@
#include <cuComplex.h>
#include <cufinufft/types.h>

#include <cuda_runtime.h>

#include <sys/time.h>

#include <cuda.h>
#include <cuda_runtime.h>
#include <type_traits>

#include <thrust/extrema.h>

#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#include <cmath>

#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 600 || defined(__clang__)
#else
__inline__ __device__ double atomicAdd(double *address, double val) {
Expand Down Expand Up @@ -87,17 +89,6 @@ class WithCudaDevice {
}
};

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

private:
struct timeval initial;
};

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

Expand All @@ -118,8 +109,8 @@ template<typename T> T infnorm(int n, std::complex<T> *a) {
*/

template<typename T>
static __forceinline__ __device__ void atomicAddComplexShared(cuda_complex<T> *address,
cuda_complex<T> res) {
static __forceinline__ __device__ void atomicAddComplexShared(
cuda_complex<T> *address, cuda_complex<T> res) {
const auto raw_address = reinterpret_cast<T *>(address);
atomicAdd(raw_address, res.x);
atomicAdd(raw_address + 1, res.y);
Expand All @@ -131,8 +122,8 @@ static __forceinline__ __device__ void atomicAddComplexShared(cuda_complex<T> *a
* on shared memory are supported so we leverage them
*/
template<typename T>
static __forceinline__ __device__ void atomicAddComplexGlobal(cuda_complex<T> *address,
cuda_complex<T> res) {
static __forceinline__ __device__ void atomicAddComplexGlobal(
cuda_complex<T> *address, cuda_complex<T> res) {
if constexpr (
std::is_same_v<cuda_complex<T>, float2> && COMPUTE_CAPABILITY_90_OR_HIGHER) {
atomicAdd(address, res);
Expand Down
36 changes: 0 additions & 36 deletions include/finufft/dirft.h

This file was deleted.

75 changes: 75 additions & 0 deletions include/finufft/finufft_utils.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// 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_EXPORT FINUFFT_ALWAYS_INLINE void FINUFFT_CDECL arrayrange(BIGINT n, const T *a,

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, /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: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, 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, 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: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, /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, 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, 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, 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: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, /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, 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

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
T *lo, T *hi)
// 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_EXPORT FINUFFT_ALWAYS_INLINE void FINUFFT_CDECL arraywidcen(BIGINT n, const T *a,

Check warning on line 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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 31 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
T *w, T *c)
// 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;
}
}

FINUFFT_EXPORT 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 utils {
FINUFFT_EXPORT int FINUFFT_CDECL rand_r(unsigned int *seedp);
} // namespace utils
} // 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
Loading

0 comments on commit c28744a

Please sign in to comment.