SeqAn3 3.3.0-rc.1
The Modern C++ library for sequence analysis.
 
Loading...
Searching...
No Matches
default_simd_length.hpp
Go to the documentation of this file.
1// -----------------------------------------------------------------------------------------------------
2// Copyright (c) 2006-2022, Knut Reinert & Freie Universität Berlin
3// Copyright (c) 2016-2022, Knut Reinert & MPI für molekulare Genetik
4// This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5// shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
6// -----------------------------------------------------------------------------------------------------
7
13#pragma once
14
16
17namespace seqan3::detail
18{
19
31template <template <typename, size_t> typename simd_backend_t>
32constexpr auto default_simd_max_length = 0u;
33
40template <typename scalar_t, template <typename, size_t> typename simd_backend_t>
41constexpr auto default_simd_length = []
42{
43 constexpr auto max_length = default_simd_max_length<simd_backend_t>;
44 if constexpr (max_length == 0)
45 return min_viable_uint_v<1u>;
46 else
47 return min_viable_uint_v<max_length / sizeof(scalar_t)>;
48}();
49
50} // namespace seqan3::detail
constexpr auto default_simd_length
seqan3::detail::default_simd_length returns the default length depending on the given scalar_t type,...
Definition: default_simd_length.hpp:41
constexpr auto default_simd_max_length
seqan3 auto-detects the maximum number of packable [u]int8_t types.
Definition: default_simd_length.hpp:32
constexpr auto min_viable_uint_v
Given a value, cast the value as the smallest unsigned integer that can hold it.
Definition: integer_traits.hpp:43
Provides metaprogramming utilities for integer types.
The internal SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29