C++ Logo

std-discussion

Advanced search

Re: a standard way to tell the compiler to choose an implementation version following policies ?

From: Vishal Oza <vickoza_at_[hidden]>
Date: Sat, 13 Jun 2020 10:01:11 -0500
Dear Cessar:

I would look at the 2D graphics for any type of custom iterator being built
into the language

sincerely,
Vishal Oza

On Fri, Jun 12, 2020 at 4:02 PM c.ohanessian via Std-Discussion <
std-discussion_at_[hidden]> wrote:

> ‌‌Hi,
>
> My name is Cesar OHANESSIAN, a C++ enthusiast. I am currently working on
> the implementation of a multidimensional array, the purpose being to extend
> std::array while being adaptable to most of the usual conventions (row/col
> vector, row/col major). I would like to allow people to mix the
> conventions, not only for compatibility reasons but also for local
> optimization purposes, for example:
>
> - the matrix-vector product in col vector/row major gives 3 independent
> std::inner_product with contiguous iterators
> - the recopy of a specific basis vector is a simple memcpy in col
> vector/col major (or in row vector/row major).
>
> With that in mind, iterating over two arrays with different conventions is
> intrinsically sub optimal in memory and is a deciding factor to keep or
> reject a local optimization regarding its compatibility impact (when doing
> std::copy, std::equal).
>
> I would like to tell the compiler to choose between different iterator
> implementations (all the stride order permutations) which are all
> equivalent in their defined behavior, following some policies (memory
> space/execution speed). It's a low level decision, depending on various
> fixed costs including the iterator implementation itself (dealing with for
> loops and counters). It would be pleasant to have a standard way for taking
> benefit of the compiler decisions, allowing more flexibility at compile
> time => each template instantiation has a unique solution so we shouldn't
> have to perform infinite experimental plans ! Does such a feature exist ?
>
> Thank you in advance, you people are doing a formidable work and I owe you
> so much !
>
> Best Regards,
>
>
> Cesar OHANESSIAN
> --
> Std-Discussion mailing list
> Std-Discussion_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion
>

Received on 2020-06-13 10:07:03