0
votes

I am using the anaconda suite with ipython 3.6.1 and their accelerate package. There is a 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 project but that doesn't seem available in anaconda.

The thing I am doing (and would like to do efficiently on gpu) is in short shown here using 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)

Thanks in advance!

1

1 Answers

0
votes

So I found Arrayfire which seems rather easy to work with.