Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
Update names in convolution
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarkall committed Jan 4, 2016
1 parent 150c75d commit 1528259
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions convolution/fftconvolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
from scipy.signal import fftconvolve
from scipy import misc, ndimage
from matplotlib import pyplot as plt
from numbapro.cudalib import cufft
from numbapro import cuda
from accelerate.cuda.fft import FFTPlan
from numba import cuda
from timeit import default_timer as timer

@cuda.jit('void(complex64[:,:], complex64[:,:])')
Expand Down Expand Up @@ -83,7 +83,7 @@ def main():
# Trigger initialization the cuFFT system.
# This takes significant time for small dataset.
# We should not be including the time wasted here
cufft.FFTPlan(shape=image.shape, itype=np.complex64, otype=np.complex64)
FFTPlan(shape=image.shape, itype=np.complex64, otype=np.complex64)

# Start GPU timer
ts = timer()
Expand All @@ -93,9 +93,9 @@ def main():
stream1 = cuda.stream()
stream2 = cuda.stream()

fftplan1 = cufft.FFTPlan(shape=image.shape, itype=np.complex64,
fftplan1 = FFTPlan(shape=image.shape, itype=np.complex64,
otype=np.complex64, stream=stream1)
fftplan2 = cufft.FFTPlan(shape=image.shape, itype=np.complex64,
fftplan2 = FFTPlan(shape=image.shape, itype=np.complex64,
otype=np.complex64, stream=stream2)

# pagelock memory
Expand Down
14 changes: 7 additions & 7 deletions convolution/fftsimple.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
from scipy.signal import fftconvolve
from scipy import misc, ndimage
from matplotlib import pyplot as plt
from numbapro.cudalib import cufft
from numbapro import cuda, vectorize
from accelerate.cuda.fft import FFTPlan, fft_inplace, ifft_inplace
from numba import cuda, vectorize
from timeit import default_timer as timer

@vectorize(['complex64(complex64, complex64)'], target='gpu')
@vectorize(['complex64(complex64, complex64)'], target='cuda')
def vmult(a, b):
return a * b

Expand Down Expand Up @@ -81,7 +81,7 @@ def main():
# Trigger initialization the cuFFT system.
# This takes significant time for small dataset.
# We should not be including the time wasted here
cufft.FFTPlan(shape=image.shape, itype=np.complex64, otype=np.complex64)
FFTPlan(shape=image.shape, itype=np.complex64, otype=np.complex64)

# Start GPU timer
ts = timer()
Expand All @@ -91,12 +91,12 @@ def main():
d_image_complex = cuda.to_device(image_complex)
d_response_complex = cuda.to_device(response_complex)

cufft.fft_inplace(d_image_complex)
cufft.fft_inplace(d_response_complex)
fft_inplace(d_image_complex)
fft_inplace(d_response_complex)

vmult(d_image_complex, d_response_complex, out=d_image_complex)

cufft.ifft_inplace(d_image_complex)
ifft_inplace(d_image_complex)

cvimage_gpu = d_image_complex.copy_to_host().real / np.prod(image.shape)

Expand Down

0 comments on commit 1528259

Please sign in to comment.