vincefn / pyvkfft

Python interface to VkFFT
MIT License
51 stars 6 forks source link

error #2

Closed ZJG0 closed 3 years ago

ZJG0 commented 3 years ago

The error is "The prime numbers of the FFT size is larger than 13". how to solve

vincefn commented 3 years ago

Look at the prime factors decomposition of the FFT dimensions and make sure that the only factors are 2,3,5,7,11 or 13.

For example use the primes function in either cuda or opencl:

from pyvkfft.cuda import primes
print(primes(57))  # -> [1, 3, 19], not OK
print(primes(56))  # -> [1, 2, 2, 2, 7], OK
ZJG0 commented 3 years ago

I do not get the solution. The error appear when i run app = VkFFTApp(x_c.shape, x_c.dtype, ndim=1), i need to edit the x_c.shape ?

vincefn commented 3 years ago

Yes the shape is the problem. What are the dimensions used ?

ZJG0 commented 3 years ago

I want to calculate convolution by FFT,so the dimension is 1. what should i do to calculate it ?

vincefn commented 3 years ago

I was talking about the size of the array, what is its shape ?

ZJG0 commented 3 years ago

The shape is 65537

vincefn commented 3 years ago

primes(65537) = [1, 65537] so 65537 is a prime number... So cut you data to 65536 and you'll be fine.