vir-simd 0.4.189
Parallelism TS 2 extensions and simd fallback implementation
Loading...
Searching...
No Matches
simd_execution.h File Reference

SIMD execution policy for standard algorithms. More...

#include "simd_concepts.h"
#include "simd_cvt.h"
#include "simdize.h"
#include <ranges>
#include <cstdint>
#include <utility>

Go to the source code of this file.

Classes

struct  vir::execution::simd_policy< Options >
 Type of the vir::execution::simd execution policy. More...
 

Namespaces

namespace  vir
 This namespace collects libraries and tools authored by Matthias Kretz.
 
namespace  vir::execution
 

Concepts

concept  vir::detail::simd_execution_policy
 Satisfied for valid specializations of vir::execution::simd_policy.
 
concept  vir::detail::simd_execution_range
 Modelled if std::ranges::contiguous_range is modelled and the value-type of Rng can be transformed via vir::simdize.
 
concept  vir::detail::simd_execution_iterator
 Modelled if std::contiguous_iterator is modelled and the value-type of It can be transformed via vir::simdize.
 

Functions

template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_iterator It, typename F>
constexpr void vir::for_each (ExecutionPolicy pol, It first, It last, F &&fun)
 Iterate over the given range (iterator overload).
 
template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_range R, typename F>
constexpr void vir::for_each (ExecutionPolicy pol, R &&rng, F &&fun)
 Iterate over the given range (range overload).
 
template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_iterator It1, detail::simd_execution_iterator OutIt, typename UnaryOperation>
constexpr OutIt vir::transform (ExecutionPolicy pol, It1 first1, It1 last1, OutIt d_first, UnaryOperation unary_op)
 Unary transform (iterator overload)
 
template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_iterator It1, detail::simd_execution_iterator It2, detail::simd_execution_iterator OutIt, typename BinaryOperation>
constexpr OutIt vir::transform (ExecutionPolicy pol, It1 first1, It1 last1, It2 first2, OutIt d_first, BinaryOperation binary_op)
 Binary transform (iterator overload)
 
template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_range R1, detail::simd_execution_range R2, typename UnaryOperation>
constexpr auto vir::transform (ExecutionPolicy pol, R1 &&r1, R2 &d_rng, UnaryOperation unary_op)
 Unary transform (range overload)
 
template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_range R1, detail::simd_execution_range R2, detail::simd_execution_range R3, typename BinaryOperation>
constexpr auto vir::transform (ExecutionPolicy pol, R1 &&r1, R2 &&r2, R3 &d_rng, BinaryOperation binary_op)
 Binary transform (range overload)
 
template<detail::simd_execution_range... Rs>
constexpr auto vir::transform (detail::simd_execution_policy auto pol, const std::ranges::zip_view< Rs... > &rs, detail::simd_execution_range auto &&d_rg, auto op)
 Many-input transform (zipped range overload)
 
template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_iterator It1, detail::simd_execution_iterator It2, typename T>
constexpr T vir::transform_reduce (ExecutionPolicy policy, It1 first1, It1 last1, It2 first2, T init)
 Inner product (iterator overload)
 
template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_iterator It1, detail::simd_execution_iterator It2, typename T, typename BinaryReductionOp, typename BinaryTransformOp>
constexpr T vir::transform_reduce (ExecutionPolicy policy, It1 first1, It1 last1, It2 first2, T init, BinaryReductionOp reduce_op, BinaryTransformOp transform_op)
 As above but with user-provided transform and reduce operations (iterator overload)
 
template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_iterator It, typename T, typename BinaryReductionOp, typename UnaryTransformOp>
constexpr T vir::transform_reduce (ExecutionPolicy policy, It first1, It last1, T init, BinaryReductionOp reduce_op, UnaryTransformOp transform_op)
 Transform one input range with subsequent reduction (iterator overload)
 
template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_range Rng1, detail::simd_execution_range Rng2, typename T>
constexpr T vir::transform_reduce (ExecutionPolicy policy, Rng1 &&r1, Rng2 &&r2, T init)
 Inner product (range overload)
 
template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_range Rng1, detail::simd_execution_range Rng2, typename T, typename BinaryReductionOp, typename BinaryTransformOp>
constexpr T vir::transform_reduce (ExecutionPolicy policy, Rng1 &&r1, Rng2 &&r2, T init, BinaryReductionOp reduce_op, BinaryTransformOp transform_op)
 As above but with user-provided transform and reduce operations (range overload)
 
template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_range Rng, typename T, typename BinaryReductionOp, typename UnaryTransformOp>
constexpr T vir::transform_reduce (ExecutionPolicy policy, Rng &&r1, T init, BinaryReductionOp reduce_op, UnaryTransformOp transform_op)
 Transform one input range with subsequent reduction (range overload)
 
template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_iterator It>
constexpr std::iter_value_t< It > vir::reduce (ExecutionPolicy policy, It first, It last)
 Sum the given range (iterator overload)
 
template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_iterator It, typename T>
constexpr T vir::reduce (ExecutionPolicy policy, It first, It last, T init)
 Sum the given range with initial value init (iterator overload)
 
template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_iterator It, typename T, typename BinaryReductionOp>
constexpr T vir::reduce (ExecutionPolicy policy, It first, It last, T init, BinaryReductionOp op)
 Reduce the given range with initial value init over op (iterator overload)
 
template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_range Rg>
constexpr std::ranges::range_value_t< Rg > vir::reduce (ExecutionPolicy policy, Rg &&rg)
 Sum the given range (range overload)
 
template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_range Rg, typename T>
constexpr T vir::reduce (ExecutionPolicy policy, Rg &&rg, T init)
 Sum the given range with initial value init (range overload)
 
template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_range Rg, typename T, typename BinaryReductionOp>
constexpr T vir::reduce (ExecutionPolicy policy, Rg &&rg, T init, BinaryReductionOp op)
 Reduce the given range with initial value init over op (range overload)
 
template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_iterator It, typename F>
constexpr int vir::count_if (ExecutionPolicy pol, It first, It last, F &&pred)
 Count the elements in the input range matching pred (iterator overload)
 
template<detail::simd_execution_policy ExecutionPolicy, detail::simd_execution_range R, typename F>
constexpr int vir::count_if (ExecutionPolicy pol, R &&rg, F &&pred)
 Count the elements in the input range matching pred (range overload)
 
template<vir::detail::simd_execution_policy ExecutionPolicy, vir::detail::simd_execution_iterator It, typename F>
constexpr void std::for_each (ExecutionPolicy pol, It first, It last, F &&fun)
 Overloads std::for_each for vir::execution::simd.
 
template<vir::detail::simd_execution_policy ExecutionPolicy, vir::detail::simd_execution_iterator It1, vir::detail::simd_execution_iterator OutIt, typename UnaryOperation>
constexpr OutIt std::transform (ExecutionPolicy pol, It1 first1, It1 last1, OutIt d_first, UnaryOperation unary_op)
 Overloads std::transform for vir::execution::simd.
 
template<vir::detail::simd_execution_policy ExecutionPolicy, vir::detail::simd_execution_iterator It1, vir::detail::simd_execution_iterator It2, vir::detail::simd_execution_iterator OutIt, typename BinaryOperation>
constexpr OutIt std::transform (ExecutionPolicy pol, It1 first1, It1 last1, It2 first2, OutIt d_first, BinaryOperation binary_op)
 Overloads std::transform for vir::execution::simd.
 
template<vir::detail::simd_execution_policy ExecutionPolicy, vir::detail::simd_execution_iterator It1, vir::detail::simd_execution_iterator It2, typename T>
constexpr T std::transform_reduce (ExecutionPolicy policy, It1 first1, It1 last1, It2 first2, T init)
 Overloads std::transform_reduce for vir::execution::simd.
 
template<vir::detail::simd_execution_policy ExecutionPolicy, vir::detail::simd_execution_iterator It1, vir::detail::simd_execution_iterator It2, typename T, typename BinaryReductionOp, typename BinaryTransformOp>
constexpr T std::transform_reduce (ExecutionPolicy policy, It1 first1, It1 last1, It2 first2, T init, BinaryReductionOp reduce_op, BinaryTransformOp transform_op)
 Overloads std::transform_reduce for vir::execution::simd.
 
template<vir::detail::simd_execution_policy ExecutionPolicy, vir::detail::simd_execution_iterator It, typename T, typename BinaryReductionOp, typename UnaryTransformOp>
constexpr T std::transform_reduce (ExecutionPolicy policy, It first1, It last1, T init, BinaryReductionOp reduce_op, UnaryTransformOp transform_op)
 Overloads std::transform_reduce for vir::execution::simd.
 
template<vir::detail::simd_execution_policy ExecutionPolicy, vir::detail::simd_execution_iterator It>
constexpr std::iter_value_t< It > std::reduce (ExecutionPolicy policy, It first, It last)
 Overloads std::reduce for vir::execution::simd.
 
template<vir::detail::simd_execution_policy ExecutionPolicy, vir::detail::simd_execution_iterator It, typename T>
constexpr T std::reduce (ExecutionPolicy policy, It first, It last, T init)
 Overloads std::reduce for vir::execution::simd.
 
template<vir::detail::simd_execution_policy ExecutionPolicy, vir::detail::simd_execution_iterator It, typename T, typename BinaryReductionOp>
constexpr T std::reduce (ExecutionPolicy policy, It first, It last, T init, BinaryReductionOp op)
 Overloads std::reduce for vir::execution::simd.
 
template<vir::detail::simd_execution_policy ExecutionPolicy, vir::detail::simd_execution_iterator It, typename F>
constexpr int std::count_if (ExecutionPolicy pol, It first, It last, F &&fun)
 Overloads std::count_if for vir::execution::simd.
 

Variables

constexpr simd_policy vir::execution::simd {}
 SIMD execution policy.
 

Detailed Description

SIMD execution policy for standard algorithms.