[pythran] Re: ndarray

  • From: Neal Becker <ndbecker2@xxxxxxxxx>
  • To: pythran@xxxxxxxxxxxxx
  • Date: Sun, 31 Aug 2014 07:34:49 -0400

perhaps export could add some syntax to indicate #contiguous dimensions?

Rather than
ndarray<long,2>, contiguous_slice, slice

I do like the other ndarray syntax of <type, #dim, #contiguous dim>


On Sun, Aug 31, 2014 at 1:58 AM, serge Guelton <sguelton@xxxxxxxxxxxxx>
wrote:

> On Sat, Aug 30, 2014 at 08:25:38PM -0700, Mehdi Amini wrote:
> > Hi,
> >
> > I'm unsure how we can produce efficient code for a function that would
> accept
> > both a dense array and a strided one. It means that it should either be
> > expressed in the interface (pythran export ....), or disallowed.
> >
> > Mehdi
>
> Yo all,
>
> I think that when we register a specialization for an ndarray, we should
> automatically register a version for each possible slicing. For instance
> foo(int[][]) now generates:
>
> void foo(ndarray<long,2> const&);
>
> but it should also generate something like
>
> void foo(numpy_gexpr<ndarray<long,2>, slice, slice> const&);
> void foo(numpy_gexpr<ndarray<long,2>, contiguous_slice, slice> const&);
> void foo(numpy_gexpr<ndarray<long,2>, slice, contiguous_slice> const&);
> void foo(numpy_gexpr<ndarray<long,2>, contiguous_slice, contiguous_slice>
> const&);
>
>
> some meta-programming fun on the way :-)
>
>


-- 
*Those who don't understand recursion are doomed to repeat it*

Other related posts: