用于在 fft / ifft 调用之间将数组保存在 gpu 内存中的 Anaconda 包

Anaconda package for cufft keeping arrays in gpu memory between fft / ifft calls

我正在使用带有 ipython 3.6.1 及其加速包的 anaconda 套件。有一个 cufft sub-package in this two functions fft and ifft. These, as far as I understand, takes in a numpy array and outputs to a numpy array, both in system ram, i.e. all gpu-memory and transfer between system and gpu memory is handled automatically and gpu memory is releaseed as function is ended. This seems all very nice and seems to work for me. However, I would like to run multiple fft/ifft calls on the same array and for each time extract just one number from the array. It would be nice to keep the array in the gpu memory to minimize system <-> gpu transfer. Am I correct that this is not possible using this package? If so, is there another package that would do the same. I have noticed the reikna 项目,但在 anaconda 中似乎不可用。

我正在做的事情(并且想在 gpu 上有效地做)在这里使用 numpy.fft

简而言之
import math as m
import numpy as np
import numpy.fft as dft

nr = 100
nh = 2**16
h = np.random.rand(nh)*1j
H = np.zeros(nh,dtype='complex64')
h[10] = 1
r = np.zeros(nr,dtype='complex64')


fftscale = m.sqrt(nh)
corr = 0.12j
for i in np.arange(nr):
    r[i] = h[10]
    H = dft.fft(h,nh)/fftscale
    h = dft.ifft(h*corr)*fftscale
r[nr-1] = h[10]
print(r)

提前致谢!

所以我发现 Arrayfire 似乎很容易使用。