Skip to content

Commit e5979a4

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 8235d0c commit e5979a4

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

mne/cuda.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import numpy as np
66
from scipy.fft import irfft, rfft
77

8-
98
from .utils import (
109
_check_option,
1110
_explain_exception,
@@ -19,6 +18,7 @@
1918

2019
_cuda_capable = False
2120

21+
2222
def get_shared_mem(
2323
shape,
2424
dtype=np.float64,
@@ -45,10 +45,11 @@ def get_shared_mem(
4545
4646
Returns
4747
-------
48-
a mapped array: np.ndarray
48+
a mapped array: np.ndarray
4949
An array to be passed into cupy.asarray, which does not copy if shared memory is already allocated.
5050
"""
5151
from numba import cuda
52+
5253
return cuda.mapped_array(
5354
shape,
5455
dtype=dtype,
@@ -59,6 +60,7 @@ def get_shared_mem(
5960
wc=wc,
6061
)
6162

63+
6264
def get_cuda_memory(kind="available"):
6365
"""Get the amount of free memory for CUDA operations.
6466

mne/tests/test_filter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
from scipy.signal import resample as sp_resample
1717

1818
from mne import Epochs, create_info
19-
from mne.cuda import get_shared_mem
2019
from mne._fiff.pick import _DATA_CH_TYPES_SPLIT
20+
from mne.cuda import get_shared_mem
2121
from mne.filter import (
2222
_length_factors,
2323
_overlap_add_filter,
@@ -858,7 +858,7 @@ def test_cuda_resampling():
858858
for fro, to in ((1, 2), (2, 1), (1, 3), (3, 1)):
859859
a1 = resample(a, fro, to, n_jobs=None, npad="auto", window=window)
860860
x = get_shared_mem(a.shape)
861-
x[:] = a
861+
x[:] = a
862862
a2 = resample(a, fro, to, n_jobs="cuda", npad="auto", window=window)
863863
assert_allclose(a1, a2, rtol=1e-7, atol=1e-14)
864864
assert_array_almost_equal(a1, a2, 14)

0 commit comments

Comments
 (0)