Posts: 3
Joined: Sat Feb 23, 2019 10:40 pm

Using C code on python: GPU_FFT

Wed May 22, 2019 4:22 pm


I'll like to know if there is possoble to use a c library like GPU_FFT in python I read about Cython but i dont know how to install it or run a C code with it, can someone explain me please how to use it and also pass a numpy array to a C array.

The GPU_FFT page

User avatar
Posts: 2309
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Using C code on python: GPU_FFT

Wed May 22, 2019 5:12 pm

Hi, I don't know about that library specifically but, generally speaking, linking shared objects (i.e. C functions compiled to executable code) from python is pretty easy using ctypes seem some examples of linking in different versions of the same code in different ways https://github.com/paddywwoof/atkinson/ ... ests.py#L7

But I must stress that is the easy bit. Passing info to and from C functions is a bit of a minefield which will possibly drive you mad unless you are reasonably happy with pointers and different data types
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

Return to “Python”