[OT] pass a C callback function to a cythom module via python

Nadav Horesh nadavh.horesh at gmail.com
Mon Apr 2 14:29:48 EDT 2012


I do not have a benchmark code yet. I am working now on unpythonising the
in-loop buffer copy (the line "neigh[:] = self.padded[i:i+ks0,
j:j+ks1].ravel()" in filter_iter.pyx)/ When I'll finish this and include
your suggestion, I'll be ready for the benchmarking.

 My experience with the bilateral filter showed that yellowish lines do not
comply with nogil, but it is easy to verify again.

   Nadav.


בתאריך 1 באפריל 2012 19:47, מאת Stéfan van der Walt <stefan at sun.ac.za>:

> Hi Nadav
>
> On Sun, Apr 1, 2012 at 6:42 AM, Nadav Horesh <nadavh.horesh at gmail.com>
> wrote:
> > A nice idea. As is, it can not replace the link to C code linking
> because it
> > contains to much yellow lines ("cython -a" output) in the main loop, so
> > there is a speed penalty, and also I suspect it wouldn't be possible to
> > parallelise that function call. Anyway I plan to add this option.
>
> Could you share your benchmark code?  This should be very nearly as
> fast as the C pointer call.  And with an appropriate "with nogil"
> statement, I think it should parallelize?
>
> Stéfan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20120402/e262390d/attachment.html>


More information about the scikit-image mailing list