Hi -

I don't feel like I know the answers to all of your questions
but I might be able to help with some of them. (Meaning - I don't
want to stop others from replying with better information).

> Are there better ways to pull an array's domain apart? I
> not only need the upper and lower limits, but also the
> dimensions (as is) and then a slice thereof, i.e. the
> slice being the dimensions but shrunk by 1 at the start.

I find domain.dim(d) and domain.dims really valuable for
this sort of thing

https://chapel-lang.org/docs/master/builtins/ChapelArray.html#ChapelArray.dims

> The recursive inner loop looks like it will cause grief
> to an optimizer.  Is there a smarter way to write it?

It's true that the inner loop won't be vectorizable on its own.
However since it is within a forall loop, this would be a good
candidate for outer-loop vectorization with LLVM and RV. I'd like to
investigate that as part of my upcoming efforts on vectorization.

> Is there an optimal way of tupelizing the components of a
> complex number?  See my grubby attempt!

Your complexAsTuple function looks OK to me
(although I would have left out the type argument and let
 the whole thing infer types, like

  inline proc complexAsTuple(t) return (t.re, t.im);

but that is a style thing).

The language currently supports casting from a tuple to
a complex, e.g. 

  var b = (1.0, 2.0):complex;

but the inverse operation is not implemented. (Adding
it would be a reasonable feature request in my opinion;
one would just need to add a _cast overload in ChapelTuple):

  var tup = (1.0+2.0i):(real, real); // doesn't compile today

Best,

-michael 


_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to