Skip to content
Merged
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
15 changes: 15 additions & 0 deletions pystarshade/diffraction/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@

def gpu_available():
"""
Check whether GPU-accelerated Bluestein FFT is available.

Returns
-------
bool
True if PyTorch is installed and a CUDA device is detected.
"""
try:
from pystarshade.diffraction.bluestein_fft_gpu import (
_TORCH_AVAILABLE, _CUDA_AVAILABLE)
return _TORCH_AVAILABLE and _CUDA_AVAILABLE
except ImportError:
return False
Loading
Loading