import random
import cupy as cp
import numpy as np
from cupy import fft as fft

n = 4096
image = np.empty((n, n), dtype=np.complex64)

for y in range(n):
	for x in range(n):
		image[x, y] = random.random() 
		
# CPU -> GPU
cImage = cp.asarray(image)

# FFT -> IFFT
cSpectrum = fft.fft2(cImage)
cImage = fft.ifft2(cSpectrum)

# GPU -> CPU
image = cp.asnumpy(cImage)
