Re: [Cython] Too many instantiations with fused type memoryviews

2014-03-22 Thread Pauli Virtanen
22.03.2014 14:48, Pauli Virtanen kirjoitti: [clip] > I can take a look at this today... Here's one attempt: https://github.com/cython/cython/pull/284 In the long run, I'd like to be able to write code like this: https://github.com/pv/scipy-work/blob/csparsetools-nocrud/scipy/sparse/_csparse

Re: [Cython] Too many instantiations with fused type memoryviews

2014-03-22 Thread Pauli Virtanen
Hi, 22.03.2014 12:08, Stefan Behnel kirjoitti: [clip] >> Re: arguments in the previous thread --- I think it would indeed be >> better if memoryviews would not invoke cross-product behavior. If >> scalars work in one way, also arrays should work in the same way. > > I'm not a fused types user mys

Re: [Cython] Too many instantiations with fused type memoryviews

2014-03-22 Thread Stefan Behnel
Pauli Virtanen, 08.03.2014 21:59: > 08.03.2014 22:40, Stefan Behnel kirjoitti: > [clip] >> Yes, this is a known problem. The work-around is to ctypedef the >> memory view type, not just the dtype. >> >> http://thread.gmane.org/gmane.comp.python.cython.user/10437 > > Thanks, I missed that. > > Re:

Re: [Cython] Too many instantiations with fused type memoryviews

2014-03-22 Thread Sturla Molden
Pauli Virtanen wrote: > The n**m explosion starts to hurt quite quickly when there are several > array arguments and more than one fused type. I think this issue is > also accompanied by some signature resolution bugs (I'll try to come > up with an example case). I warned that fused types would

Re: [Cython] Too many instantiations with fused type memoryviews

2014-03-08 Thread Pauli Virtanen
08.03.2014 22:40, Stefan Behnel kirjoitti: [clip] > Yes, this is a known problem. The work-around is to ctypedef the > memory view type, not just the dtype. > > http://thread.gmane.org/gmane.comp.python.cython.user/10437 Thanks, I missed that. Re: arguments in the previous thread --- I think it

Re: [Cython] Too many instantiations with fused type memoryviews

2014-03-08 Thread Stefan Behnel
Pauli Virtanen, 08.03.2014 21:11: > FYI: Cython instantiates fused type routines with memoryview arguments > unnecessarily many times. > > Example: > ``` > ctypedef fused idx_t: > short > long > > # Cython 0.20.1 instantiates this function 128 times, > # even though only 2 would be needed