Vector API factories
Graves, Ian L
ian.l.graves at intel.com
Mon Jul 17 23:55:27 UTC 2017
Hi Paul,
I love it!
I think you're right that it makes a lot of sense to offload instantiation routines to species and make them semi-concrete by element type. This solves the issue of our element types being too unconstrained. This approach lets us fix the instantiatable-element-types by exposing allowed ones through this semi-concrete species. I think it also makes sense to refactor the vector construction methods to the Species class because instantiation is unique per-species and not per-vector. That's a good play.
> Also i am wondering about the horizontal reductions now returning a Vector.
> I can see why you did this, we really don’t want the primitive boxes being
> exposed and you can easily reuse the result in further calculations.
>
> This works well for the fixed sized small vectors but what if we have different
> kinds of shape that signify a larger size?
>
> An alternative is to move those reductions into the semi-concrete species. If
> there is a method to construct a new vector with an element at the first
> position then i bet the JIT can optimize to avoid register shuffling.
>
Reductions are somewhat sensitive to species. I can see how some operations that are more amenable to floating point (div, etc) would be better served to be placed in a more precise location. Right now I think you're right that it makes sense to limit this placement to species and not Vector.
Would species form the basis of a future templated feature-set of Vector that could be dropped in? Something that could come out of the enhanced generics work in Valhalla?
--Ian
More information about the panama-dev
mailing list