Skip to content

Update the upstream version of finufft #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.15...3.27)
cmake_minimum_required(VERSION 3.19...3.30)
project(${SKBUILD_PROJECT_NAME} LANGUAGES C CXX)
message(STATUS "Using CMake version: " ${CMAKE_VERSION})

Expand All @@ -19,6 +19,7 @@ if(JAX_FINUFFT_USE_OPENMP)
set(FINUFFT_USE_OPENMP OFF)
endif()
else()
message(STATUS "jax_finufft: OpenMP support was not requested")
set(FINUFFT_USE_OPENMP OFF)
endif()

Expand All @@ -44,6 +45,8 @@ else()
set(FINUFFT_USE_CUDA OFF)
endif()

set(FINUFFT_POSITION_INDEPENDENT_CODE ON)

# Add the FINUFFT project using the vendored version
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/vendor/finufft")

Expand All @@ -58,7 +61,8 @@ endif()

# Build the CPU XLA bindings
nanobind_add_module(jax_finufft_cpu ${CMAKE_CURRENT_LIST_DIR}/lib/jax_finufft_cpu.cc)
target_link_libraries(jax_finufft_cpu PRIVATE finufft_static)
target_link_libraries(jax_finufft_cpu PRIVATE finufft)
target_include_directories(jax_finufft_cpu PRIVATE ${FFTW_INCLUDE_DIRS})
install(TARGETS jax_finufft_cpu LIBRARY DESTINATION .)

if(FINUFFT_USE_OPENMP)
Expand All @@ -85,6 +89,6 @@ if(FINUFFT_USE_CUDA)
${CMAKE_CURRENT_LIST_DIR}/lib/kernels.cc.cu)
target_include_directories(jax_finufft_gpu PUBLIC ${CUFINUFFT_INCLUDE_DIRS})
target_include_directories(jax_finufft_gpu PUBLIC ${CUFINUFFT_VENDORED_INCLUDE_DIRS})
target_link_libraries(jax_finufft_gpu PRIVATE cufinufft_static)
target_link_libraries(jax_finufft_gpu PRIVATE cufinufft)
install(TARGETS jax_finufft_gpu LIBRARY DESTINATION .)
endif()
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ version_file = "src/jax_finufft/jax_finufft_version.py"
[tool.cibuildwheel]
skip = "pp* *-musllinux_* *-manylinux_i686"
build-verbosity = 1
config-settings = {"cmake.define.FINUFFT_ARCH_FLAGS" = ""}

[tool.cibuildwheel.linux]
before-all = "yum install -y fftw-devel"
Expand Down
15 changes: 9 additions & 6 deletions src/jax_finufft/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ class GpuMethod(IntEnum):

@dataclass(frozen=True)
class Opts:

# These correspond to the default cufinufft options
# set in vendor/finufft/src/cuda/cufinufft.cu
modeord: bool = False
chkbnds: bool = True
debug: DebugLevel = DebugLevel.Silent
Expand All @@ -59,12 +62,12 @@ class Opts:
gpu_upsampfac: float = 2.0
gpu_method: GpuMethod = 0
gpu_sort: bool = True
gpu_binsizex: int = -1
gpu_binsizey: int = -1
gpu_binsizez: int = -1
gpu_obinsizex: int = -1
gpu_obinsizey: int = -1
gpu_obinsizez: int = -1
gpu_binsizex: int = 0
gpu_binsizey: int = 0
gpu_binsizez: int = 0
gpu_obinsizex: int = 0
gpu_obinsizey: int = 0
gpu_obinsizez: int = 0
gpu_maxsubprobsize: int = 1024
gpu_kerevalmeth: bool = True
gpu_spreadinterponly: bool = False
Expand Down
2 changes: 1 addition & 1 deletion vendor/finufft
Submodule finufft updated 311 files