SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
|
The simd module contains a unified interface to provide simd types and functions used in seqan3. More...
Modules | |
Views | |
SIMD related views. | |
Classes | |
struct | seqan3::detail::builtin_simd< scalar_t, length > |
A class that holds the type of a simd implementation called [vector extension] (https://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html) (formerly known as "seqan simd" in seqan2). More... | |
struct | seqan3::detail::builtin_simd< scalar_t, length > |
A class that holds the type of a simd implementation called [vector extension] (https://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html) (formerly known as "seqan simd" in seqan2). More... | |
struct | seqan3::detail::builtin_simd_traits_helper< builtin_simd_t > |
Helper struct for seqan3::detail::is_builtin_simd. More... | |
struct | seqan3::detail::builtin_simd_traits_helper< builtin_simd_t > |
Helper struct for seqan3::detail::is_builtin_simd. More... | |
struct | seqan3::detail::is_builtin_simd< builtin_simd_t > |
This class inherits from std::true_type, iff seqan3::detail::builtin_simd<scalar_t, length>::type is a builtin simd type. More... | |
struct | seqan3::detail::is_native_builtin_simd< builtin_simd_t > |
This class inherits from std::true_type, iff the builtin simd type is supported by the current architecture. More... | |
interface | simd_concept |
The generic simd concept. More... | |
interface | simd_index |
Refines the seqan3::simd::simd_concept requiring the underlying scalar type to model std::integral. More... | |
struct | seqan3::simd::simd_traits< simd_t > |
seqan3::simd::simd_traits is the trait class that provides uniform interface to the properties of simd_t types. More... | |
struct | seqan3::simd::simd_traits< builtin_simd_t > |
This class specializes seqan3::simd::simd_traits for seqan3::detail::builtin_simd types. More... | |
struct | seqan3::simd::simd_type< scalar_t, length, simd_backend > |
seqan3::simd::simd_type encapsulates simd vector types, which can be manipulated by simd operations. More... | |
Typedefs | |
template<typename scalar_t , size_t length> | |
using | seqan3::detail::default_simd_backend = builtin_simd< scalar_t, length > |
seqan3::detail::default_simd_backend is the default used implementation of seqan3::simd::simd_type. | |
template<typename scalar_t , size_t length = detail::default_simd_length<scalar_t, detail::default_simd_backend>, template< typename scalar_t_, size_t length_ > typename simd_backend = detail::default_simd_backend> | |
using | seqan3::simd::simd_type_t = typename simd_type< scalar_t, length, simd_backend >::type |
Helper type of seqan3::simd::simd_type. | |
Functions | |
template<uint8_t index, simd::simd_concept simd_t> | |
constexpr simd_t | seqan3::detail::extract_eighth (simd_t const &src) |
Extracts one eighth of the given simd vector and stores it in the lower eighth of the target vector. | |
template<uint8_t index, simd::simd_concept simd_t> | |
constexpr simd_t | seqan3::detail::extract_half (simd_t const &src) |
Extracts one half of the given simd vector and stores the result in the lower half of the target vector. | |
template<size_t divisor, simd_concept simd_t> | |
constexpr simd_t | seqan3::detail::extract_impl (simd_t const &src, uint8_t const mask) |
Helper function to extract a part of the given simd vector. | |
template<uint8_t index, simd::simd_concept simd_t> | |
constexpr simd_t | seqan3::detail::extract_quarter (simd_t const &src) |
Extracts one quarter of the given simd vector and stores it in the lower quarter of the target vector. | |
template<simd::simd_concept simd_t> | |
constexpr simd_t | seqan3::simd::fill (typename simd_traits< simd_t >::scalar_type const scalar) noexcept |
Fills a seqan3::simd::simd_type vector with a scalar value. | |
template<simd::simd_concept simd_t, size_t... I> | |
constexpr simd_t | seqan3::detail::fill_impl (typename simd_traits< simd_t >::scalar_type const scalar, std::index_sequence< I... >) noexcept |
Helper function for seqan3::simd::fill. | |
template<simd::simd_concept simd_t> | |
constexpr simd_t | seqan3::simd::iota (typename simd_traits< simd_t >::scalar_type const offset) |
Fills a seqan3::simd::simd_type vector with the scalar values offset, offset+1, offset+2, ... | |
template<simd::simd_concept simd_t, typename scalar_t , scalar_t... I> | |
constexpr simd_t | seqan3::detail::iota_impl (scalar_t const offset, std::integer_sequence< scalar_t, I... >) |
Helper function for seqan3::simd::iota. | |
template<simd::simd_concept simd_t> | |
constexpr simd_t | seqan3::simd::load (void const *mem_addr) |
Load simd_t size bits of integral data from memory. | |
template<typename char_t , typename simd_t > requires simd::simd_concept<std::remove_cvref_t<simd_t>> | |
debug_stream_type< char_t > & | seqan3::operator<< (debug_stream_type< char_t > &s, simd_t &&simd) |
Overload for debug_stream for simd types. | |
template<simd::simd_concept simd_t> | |
constexpr void | seqan3::simd::store (void *mem_addr, simd_t const &simd_vec) |
Store simd_t size bits of integral data into memory. | |
template<simd::simd_concept simd_t> | |
constexpr void | seqan3::simd::transpose (std::array< simd_t, simd_traits< simd_t >::length > &matrix) |
Transposes the given simd vector matrix. | |
template<simd::simd_concept target_simd_t, simd::simd_concept source_simd_t> | |
constexpr target_simd_t | seqan3::simd::upcast (source_simd_t const &src) |
Upcasts the given vector into the target vector using sign extension of packed values. | |
template<simd::simd_concept target_simd_t, simd::simd_concept source_simd_t> | |
constexpr target_simd_t | seqan3::detail::upcast_signed (source_simd_t const &src) |
Upcasts the given vector into the target vector using signed extension of packed values. | |
template<simd::simd_concept target_simd_t, simd::simd_concept source_simd_t> | |
constexpr target_simd_t | seqan3::detail::upcast_unsigned (source_simd_t const &src) |
Upcasts the given vector into the target vector using unsigned extension of packed values. | |
Variables | |
template<typename scalar_t , template< typename, size_t > typename simd_backend_t> | |
constexpr auto | seqan3::detail::default_simd_length |
seqan3::detail::default_simd_length returns the default length depending on the given scalar_t type, which is used in seqan3::simd::simd_type. | |
template<template< typename, size_t > typename simd_backend_t> | |
constexpr auto | seqan3::detail::default_simd_max_length = 0u |
seqan3 auto-detects the maximum number of packable [u]int8_t types. | |
template<> | |
constexpr auto | seqan3::detail::default_simd_max_length< builtin_simd > |
This function specializes seqan3::detail::default_simd_max_length for seqan3::detail::builtin_simd. | |
template<typename builtin_simd_t > | |
constexpr bool | seqan3::detail::is_builtin_simd_v = is_builtin_simd<builtin_simd_t>::value |
Helper variable to test whether a type is a simd builtin type. | |
template<typename builtin_simd_t > | |
constexpr bool | seqan3::detail::is_native_builtin_simd_v = is_native_builtin_simd<builtin_simd_t>::value |
Helper variable to test whether a type is a native simd builtin type. | |
The simd module contains a unified interface to provide simd types and functions used in seqan3.
There are different simd implementations (backends), which are auto-selected by seqan3::simd::simd_type_t. Namely seqan3::detail::builtin_simd.
using seqan3::detail::default_simd_backend = typedef builtin_simd<scalar_t, length> |
seqan3::detail::default_simd_backend is the default used implementation of seqan3::simd::simd_type.
scalar_t | The underlying type of a simd vector |
length | The number of packed values in a simd vector |
|
constexpr |
Extracts one eighth of the given simd vector and stores it in the lower eighth of the target vector.
index | An index value in the range of [0, 1, 2, 3, 4, 5, 6, 7]. |
simd_t | The simd type. |
src | The source to extract the eighth from. |
src
If the simd vector contains less than 8 elements, the unchanged source will be returned.Only the first simd length / 8 elements are defined. The value of the remaining elements is implementation defined.
Example operation for SSE4:
|
constexpr |
Extracts one half of the given simd vector and stores the result in the lower half of the target vector.
index | An index value in the range of [0, 1]. |
simd_t | The simd type. |
src | The source to extract the half from. |
src
If the simd vector contains less than 2 elements, the unchanged source will be returned.Only the first simd length / 2 elements are defined. The value of the remaining elements is implementation defined.
Example operation for SSE4:
|
constexpr |
Helper function to extract a part of the given simd vector.
divisor | The divisor to select the chunk size. |
simd_t | The simd type; must model seqan3::simd::simd_concept. |
[in] | src | The source vector to extract from. |
[in] | mask | The control mask to select which chunk is extracted. |
Extracts the specified part of the source simd vector and stores it in the first chunk starting at offset 0 in the destination vector.
|
constexpr |
Extracts one quarter of the given simd vector and stores it in the lower quarter of the target vector.
index | An index value in the range of [0, 1, 2, 3]. |
simd_t | The simd type. |
src | The source to extract the quarter from. |
src
. If the simd vector contains less than 4 elements, the unchanged source will be returned.Only the first simd length / 4 elements are defined. The value of the remaining elements is implementation defined.
Example operation for SSE4:
|
constexprnoexcept |
Fills a seqan3::simd::simd_type vector with a scalar value.
simd_t | The simd type which satisfies seqan3::simd::simd_concept. |
[in] | scalar | The scalar value to fill the seqan3::simd::simd_type vector. |
|
constexpr |
Fills a seqan3::simd::simd_type vector with the scalar values offset, offset+1, offset+2, ...
simd_t | The simd type which satisfies seqan3::simd::simd_concept. |
[in] | offset | The scalar offset to fill the seqan3::simd::simd_type vector |
|
constexpr |
Load simd_t size bits of integral data from memory.
simd_t | The simd type; must model seqan3::simd::simd_concept. |
[in] | mem_addr | The memory address to load from. Does not need to be aligned on any particular boundary. |
|
constexpr |
Store simd_t size bits of integral data into memory.
simd_t | The simd type; must model seqan3::simd::simd_concept. |
[in] | mem_addr | The memory address to write to. Does not need to be aligned on any particular boundary. |
[in] | simd_vec | The simd vector to read the data from. |
|
constexpr |
Transposes the given simd vector matrix.
simd_t | The simd vector type; must model seqan3::simd::simd_concept and must be a simd built-in type. |
[in,out] | matrix | The matrix that is transposed in place. |
Strong exception guarantee.
Quadratic.
|
constexpr |
Upcasts the given vector into the target vector using sign extension of packed values.
simd_t | The simd type; must model seqan3::simd::simd_concept and must be a builtin simd type. |
|
constexpr |
Upcasts the given vector into the target vector using signed extension of packed values.
target_simd_t | The target simd type; must model seqan3::simd::simd_concept and must be a native builtin simd type. |
source_simd_t | The source simd type; must model seqan3::simd::simd_concept and must be a native builtin simd type. |
[in] | src | The source to upcast into target_simd_t . |
|
constexpr |
Upcasts the given vector into the target vector using unsigned extension of packed values.
target_simd_t | The target simd type; must model seqan3::simd::simd_concept and must be a native builtin simd type. |
source_simd_t | The source simd type; must model seqan3::simd::simd_concept and must be a native builtin simd type. |
[in] | src | The source to upcast into target_simd_t . |
|
constexpr |
seqan3::detail::default_simd_length returns the default length depending on the given scalar_t type, which is used in seqan3::simd::simd_type.
scalar_t | The underlying type of a simd vector |
simd_backend_t | The name of the simd backend. |
|
constexpr |
seqan3 auto-detects the maximum number of packable [u]int8_t
types.
simd_backend_t | The name of the simd backend. |
This value is influenced by compiler flags like -march=native
, -msse4
, -mavx2
, etc and sets this value accordingly.
|
inlineconstexpr |
This function specializes seqan3::detail::default_simd_max_length for seqan3::detail::builtin_simd.
The redefinition of default_simd_max_length influences the default length (i.e., seqan3::detail::default_simd_length) of seqan3::simd::simd_type for seqan3::detail::builtin_simd types.
|
constexpr |
Helper variable to test whether a type is a simd builtin type.
builtin_simd_t | The type to check. |
|
constexpr |
Helper variable to test whether a type is a native simd builtin type.
builtin_simd_t | The type to check. |