Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ gpu_102 = ["pycuda", "cupy-cuda102", "cufinufft==1.3"]
gpu_110 = ["pycuda", "cupy-cuda110", "cufinufft==1.3"]
gpu_111 = ["pycuda", "cupy-cuda111", "cufinufft==1.3"]
gpu_11x = ["pycuda", "cupy-cuda11x", "cufinufft==1.3"]
gpu_12x = ["pycuda", "cupy-cuda12x", "cufinufft==1.3"]
gpu_12x = ["pycuda", "cupy-cuda12x", "cufinufft==2.2.0"]
dev = [
"black",
"bumpversion",
Expand Down
16 changes: 2 additions & 14 deletions src/aspire/nufft/cufinufft.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ def __init__(self, sz, fourier_pts, epsilon=1e-8, ntransforms=1, **kwargs):
# Passing "ntransforms" > 1 expects one large higher dimensional array later.
self.ntransforms = ntransforms

# Workaround cufinufft A100 singles issue
# ASPIRE-Python/703
# Cast to doubles.
self._original_dtype = fourier_pts.dtype
fourier_pts = fourier_pts.astype(np.float64, copy=False)

# Basic dtype passthough.
dtype = fourier_pts.dtype
if dtype == np.float64 or dtype == np.complex128:
Expand Down Expand Up @@ -102,12 +96,8 @@ def transform(self, signal):
`(ntransforms, num_pts)`.
"""

# Check we're not forcing a dtype workaround for ASPIRE-Python/703,
# then check if we have a dtype mismatch.
# This avoids false positive complaint for the workaround.
if (self._original_dtype == self.dtype) and not (
signal.dtype == self.dtype or signal.dtype == self.complex_dtype
):
# Check dtype mismatch.
if not (signal.dtype == self.dtype or signal.dtype == self.complex_dtype):
logger.warning(
"Incorrect dtypes passed to (a)nufft."
" In the future this will be an error."
Expand Down Expand Up @@ -143,8 +133,6 @@ def transform(self, signal):
self._transform_plan.execute(result_gpu, signal_gpu)

result = result_gpu.get()
# ASPIRE-Python/703
result = result.astype(complex_type(self._original_dtype), copy=False)

return result

Expand Down