brian2 icon indicating copy to clipboard operation
brian2 copied to clipboard

Investigate implementing rand/randn in pure Cython

Open mstimberg opened this issue 4 years ago • 0 comments

The current Cython implementation for Cython (i.e. rand() and randn()) jumps through some hoops to call numpy's random functions via Python, buffering it in a numpy array. Since numpy 1.8, numpy.random has a dedicated Cython/C API, so we might be able to replace this with an easier and more efficient solution.

https://numpy.org/doc/stable/reference/random/c-api.html

This is mostly a note for my future self, I have not yet looked into this in detail.

mstimberg avatar Jan 13 '21 17:01 mstimberg