This is, this is harder largely because, if you have the resources anyway, say if
you have multiple lanes, it might just make sense to go execute a sort of a null
operation later. Some other things that are pretty common
in vectors is you want to have reductions. What I mean by reduction is let's say, you
have this array and you want to add all the elements in the array into a variable.
There's a sort of a vector to scalar operation You can't really do this on what
we discussed so far. You can't do a vector operation which will
actually operate on all of these values and, and try to do something useful with
it. But, what you can do is you can try and do
some software tricks. So, one of the software tricks is, you
take a whole vector, and instead, call it two vectors.
Sort of, cut it in half, and then overlap them and do parallel adds.
And then, you take the results of that. You take, it was someplace else in there,
And you take those two parts and you overlap them, you do adds.
So, you could do lots of parallel adds and effectively build a reduction operation,
by building a tree of adds. So, if we have our vector here, we would
cut it in half and add this part with this part, and then the result would be half
the size. If we cut in half we had this, part of that part, the result is half the
size and cut again, we do, we keep doing adds. So, we can use our vector arithmetic
to effectively do a reduction. So we're about out of time here.