E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches

◆ compress_copy

auto eve::compress_copy = detail::compress_callable<compress_copy_core> {}
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

If this function doesn't work for you, maybe you are looking for eve::compress_store or eve::compress. However this function is faster.

You can think about this function as std::copy_if but instead of a predicate, you pass in logical_simd_value. Similar to std::copy_if it returns you a pointer to where the output ended.

Note
: you might be missing information about the last selected element written, but unfortunately that adds overhead we couldn't fix (#1656)

There are the following two modifiers:

  • safe/unsafe - unsafe version is allowed to write up to mask.size() elements, even if not all are selected. Those values are undefined. safe is not allowed to perform those writes, at the price of being slower for certain usecases.
  • dense/sparse - wether or not you expect a lot of selected elements.
Note
safe version only touch selected elements. So, for example, other threads can read/write them without a race condition.

Preloaded values

Very often the mask is computed based on the values loaded from input. We would expect the optimizer to eliminate duplicated loads, but for some very complex pointer-like it might not be able to.

So we provide overloads where you can pass an already preloaded value. It should match loaded value from in, otherwise the behaviour is unspecified.

Masked Calls

You can pass up to two eve::relative_conditional_expr ignore modifiers. 1st is the input side ignore:

  • the ignored elements can are not loaded (same as load[ignore])
  • they are treated as not selected, regardless of the mask value 2nd is the output side ignore:
  • elements that are ignored, will not be written. having initial offset is equivalent to offseting the o + offset. followed by keep_first(count) Example: if the eve::ignore_extrema(1, L::size() - 2) is passed,