Krita Source Code Documentation
Loading...
Searching...
No Matches
xsimd Namespace Reference

Namespaces

namespace  kernel
 

Typedefs

using current_arch = default_arch
 

Functions

template<typename T , typename A >
T * aligned_malloc (size_t size) noexcept
 
template<class B , class T , class A >
batch< B, Abitwise_cast_compat (batch< T, A > const &x) noexcept
 
template<typename V >
std::pair< V, V > interleave (const V &a, const V &b) noexcept
 
template<typename T , typename T2 >
load_and_extend (const T2 *src) noexcept
 
template<size_t value, size_t... values>
constexpr std::enable_if< sizeof...(values)==0, size_t >::type max ()
 
template<size_t value, size_t... values>
constexpr std::enable_if< sizeof...(values)!=0, size_t >::type max ()
 
template<typename T , typename A >
batch< T, Apow2 (batch< T, A > const &self) noexcept
 
template<typename T , typename A >
xsimd::batch< T, Apow2 (xsimd::batch< T, A > const &self) noexcept
 
template<typename T , typename A >
auto set_one (const batch< T, A > &src, const batch_bool< T, A > &mask) noexcept
 
template<typename T , typename A >
auto set_zero (const batch< T, A > &src, const batch_bool< T, A > &mask) noexcept
 
template<typename V , typename T , typename A >
batch< T, Atruncate_to_type (batch< T, A > const &self) noexcept
 
template<typename V , typename T , typename A >
batch< T, Atruncate_to_type (xsimd::batch< T, A > const &self) noexcept
 
template<typename T >
void vector_aligned_free (const T *ptr) noexcept
 
template<typename T , typename A >
T * vector_aligned_malloc (size_t sz) noexcept
 

Typedef Documentation

◆ current_arch

using xsimd::current_arch = default_arch

Definition at line 47 of file xsimd_arch.hpp.

Function Documentation

◆ aligned_malloc()

template<typename T , typename A >
T * xsimd::aligned_malloc ( size_t size)
inlinenoexcept

Definition at line 72 of file xsimd_generic.hpp.

73{
74 using T_v = batch<T, A>;
75
76 return reinterpret_cast<T *>(xsimd::aligned_malloc(size, T_v::arch_type::alignment()));
77}
T * aligned_malloc(size_t size) noexcept

References aligned_malloc().

◆ bitwise_cast_compat()

template<class B , class T , class A >
batch< B, A > xsimd::bitwise_cast_compat ( batch< T, A > const & x)
inlinenoexcept

Definition at line 134 of file xsimd_generic.hpp.

135{
136 return bitwise_cast<batch<B, A>>(x);
137}

◆ interleave()

template<typename V >
std::pair< V, V > xsimd::interleave ( const V & a,
const V & b )
inlinenoexcept

Definition at line 116 of file xsimd_generic.hpp.

117{
118 return {xsimd::zip_lo(a, b), xsimd::zip_hi(a, b)};
119}

◆ load_and_extend()

template<typename T , typename T2 >
T xsimd::load_and_extend ( const T2 * src)
inlinenoexcept

Definition at line 57 of file xsimd_generic.hpp.

58{
59 return kernel::detail::apply_with_index_and_value(
60 [&](size_t i, typename T::value_type) {
61 return static_cast<typename T::value_type>(src[i]);
62 },
63 T{});
64}

References xsimd::kernel::detail::apply_with_index_and_value().

◆ max() [1/2]

template<size_t value, size_t... values>
constexpr std::enable_if< sizeof...(values)==0, size_t >::type xsimd::max ( )
constexpr

Definition at line 81 of file xsimd_generic.hpp.

82{
83 return value;
84}
float value(const T *src, size_t ch)

References value().

◆ max() [2/2]

template<size_t value, size_t... values>
constexpr std::enable_if< sizeof...(values)!=0, size_t >::type xsimd::max ( )
constexpr

Definition at line 88 of file xsimd_generic.hpp.

89{
90 return std::max(value, max<values...>());
91}

References value().

◆ pow2() [1/2]

template<typename T , typename A >
batch< T, A > xsimd::pow2 ( batch< T, A > const & self)
inlinenoexcept

Definition at line 126 of file xsimd_generic.hpp.

127{
128 return self * self;
129}

◆ pow2() [2/2]

template<typename T , typename A >
xsimd::batch< T, A > xsimd::pow2 ( xsimd::batch< T, A > const & self)
inlinenoexcept

◆ set_one()

template<typename T , typename A >
auto xsimd::set_one ( const batch< T, A > & src,
const batch_bool< T, A > & mask )
inlinenoexcept

Definition at line 46 of file xsimd_generic.hpp.

47{
48 return xsimd::select(mask, xsimd::batch<T, A>(1), src);
49}

◆ set_zero()

template<typename T , typename A >
auto xsimd::set_zero ( const batch< T, A > & src,
const batch_bool< T, A > & mask )
inlinenoexcept

Definition at line 39 of file xsimd_generic.hpp.

40{
41 return xsimd::select(mask, xsimd::batch<T, A>(0), src);
42}

◆ truncate_to_type() [1/2]

template<typename V , typename T , typename A >
batch< T, A > xsimd::truncate_to_type ( batch< T, A > const & self)
noexcept

◆ truncate_to_type() [2/2]

template<typename V , typename T , typename A >
batch< T, A > xsimd::truncate_to_type ( xsimd::batch< T, A > const & self)
inlinenoexcept

Definition at line 22 of file xsimd_generic.hpp.

23{
24 return kernel::detail::apply_with_value(
25 [](float i) -> float {
26 if (std::numeric_limits<V>::min() > i) {
27 return 0;
28 } else if (std::numeric_limits<V>::max() < i) {
29 return 0;
30 } else {
31 return static_cast<V>(i);
32 }
33 },
34 self);
35}

References xsimd::kernel::detail::apply_with_value().

◆ vector_aligned_free()

template<typename T >
void xsimd::vector_aligned_free ( const T * ptr)
inlinenoexcept

Definition at line 103 of file xsimd_generic.hpp.

104{
105 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-const-cast)
106 return xsimd::aligned_free(const_cast<T *>(ptr));
107}

◆ vector_aligned_malloc()

template<typename T , typename A >
T * xsimd::vector_aligned_malloc ( size_t sz)
inlinenoexcept

Definition at line 96 of file xsimd_generic.hpp.

97{
98 return static_cast<T *>(xsimd::aligned_malloc(sz * sizeof(T), A::alignment()));
99}

References aligned_malloc().