SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
to_simd.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
10#pragma once
11
12#include <algorithm>
13#include <iterator>
14#include <ranges>
15
26
27namespace seqan3::detail
28{
29
55template <std::ranges::view urng_t, simd::simd_concept simd_t>
56class view_to_simd : public std::ranges::view_interface<view_to_simd<urng_t, simd_t>>
57{
58private:
59 static_assert(std::ranges::forward_range<urng_t>, "The underlying range must model forward_range.");
60 static_assert(std::ranges::input_range<std::ranges::range_value_t<urng_t>>,
61 "Expects the value type of the underlying range to be an input_range.");
62 static_assert(std::default_initializable<std::ranges::iterator_t<std::ranges::range_value_t<urng_t>>>,
63 "Expects the inner range iterator to be default initializable.");
64 static_assert(std::default_initializable<std::ranges::sentinel_t<std::ranges::range_value_t<urng_t>>>,
65 "Expects the inner range sentinel to be default initializable.");
67 "Expects semi-alphabet as value type of the inner range.");
68
72 using inner_range_type = std::ranges::range_value_t<urng_t>;
78
83 static constexpr bool fast_load =
84 std::ranges::contiguous_range<inner_range_type>
85 && std::sized_sentinel_for<std::ranges::iterator_t<inner_range_type>, std::ranges::sentinel_t<inner_range_type>>
87
89 static constexpr uint8_t chunk_size = simd_traits<simd_t>::length;
93 static constexpr uint8_t total_chunks = fast_load ? (chunks_per_load * chunks_per_load) : 1;
95 static constexpr auto alphabet_size = seqan3::alphabet_size<std::ranges::range_value_t<inner_range_type>>;
97
98 // Forward declare class' iterator type. See definition below.
99 class iterator_type;
100
101public:
105 constexpr view_to_simd()
106 requires std::default_initializable<urng_t>
107 = default;
108 constexpr view_to_simd(view_to_simd const &) = default;
109 constexpr view_to_simd(view_to_simd &&) = default;
110 constexpr view_to_simd & operator=(view_to_simd const &) = default;
111 constexpr view_to_simd & operator=(view_to_simd &&) = default;
112 ~view_to_simd() = default;
113
119 urng{std::move(urng)},
120 padding_simd_vector{simd::fill<simd_t>(padding_value)},
122 {
123 // Check if the size is less or equal the simd size.
124 if (std::ranges::distance(urng) > chunk_size)
125 throw std::invalid_argument{"The size of the underlying range must be less than or equal to the size of "
126 "the given simd type!"};
127 }
128
130 template <typename other_urng_t>
131 requires (!std::same_as<std::remove_cvref_t<other_urng_t>, view_to_simd>)
132 && (!std::same_as<other_urng_t, urng_t>) && std::ranges::viewable_range<other_urng_t>
133 constexpr view_to_simd(other_urng_t && urng, scalar_type const padding_value = alphabet_size) :
134 view_to_simd{views::type_reduce(std::forward<other_urng_t>(urng)), padding_value}
135 {}
137
142 constexpr iterator_type begin() noexcept
143 {
144 return {*this};
145 }
146
148 constexpr void begin() const noexcept = delete;
149
151 constexpr std::default_sentinel_t end() noexcept
152 {
153 return std::default_sentinel;
154 }
155
157 constexpr void end() const noexcept = delete;
159
161 constexpr bool empty() const noexcept
162 requires std::ranges::forward_range<inner_range_type>
163 {
165 [](auto & rng)
166 {
167 return std::ranges::empty(rng);
168 });
169 }
170
177 constexpr size_t size() const noexcept
178 requires std::ranges::sized_range<inner_range_type>
179 {
181 [](auto & lhs, auto & rhs)
182 {
183 return std::ranges::size(lhs) < std::ranges::size(rhs);
184 });
185
186 return (it != std::ranges::end(urng)) ? (std::ranges::size(*it) + chunk_size - 1) / chunk_size : 0;
187 }
188
189private:
190 urng_t urng{};
194};
195
203template <std::ranges::view urng_t, simd::simd_concept simd_t>
204class view_to_simd<urng_t, simd_t>::iterator_type
205{
206public:
212 using pointer = void;
213 using difference_type = ptrdiff_t;
217
221 constexpr iterator_type() = default;
222 constexpr iterator_type(iterator_type const &) = default;
223 constexpr iterator_type(iterator_type &&) = default;
224 constexpr iterator_type & operator=(iterator_type const &) = default;
225 constexpr iterator_type & operator=(iterator_type &&) = default;
226 ~iterator_type() = default;
227
236 constexpr iterator_type(view_to_simd & this_view) : this_view{&this_view}, current_chunk_pos{0}
237 {
238 // Initialise the iterator of the sub ranges.
239 size_t seq_id = 0;
240 for (auto it = std::ranges::begin(this_view.urng); it != std::ranges::end(this_view.urng); ++it, ++seq_id)
241 {
242 cached_iter[seq_id] = std::ranges::begin(*it);
243 cached_sentinel[seq_id] = std::ranges::end(*it);
244 }
245
246 // The batch is empty and by default the constructed iterator is pointing to the end.
247 if (seq_id == 0)
248 return;
249
250 // The batch is not empty but might not be full either.
251 // If a slot is supposed to be empty, it will be initialised with the iterator of the first sequence set to the
252 // end emulating an empty sequence.
253 auto sentinel_it = std::ranges::next(cached_iter[0], cached_sentinel[0]);
254 for (; seq_id < chunk_size; ++seq_id)
255 {
256 cached_iter[seq_id] = sentinel_it;
257 cached_sentinel[seq_id] = cached_sentinel[0];
258 }
259
260 // Check if this is the final chunk already.
261 final_chunk = all_iterators_reached_sentinel();
262
263 // Fetch the next available input characters from the sequences and transform them into simd vectors.
264 underflow();
265 }
267
272 constexpr reference operator*() const noexcept
273 {
274 assert(this_view != nullptr);
275 return std::span{this_view->cached_simd_chunks[current_chunk_pos].begin(),
276 (current_chunk_pos == final_chunk_pos) ? final_chunk_size : chunk_size};
277 }
279
284 constexpr iterator_type & operator++(/*pre-increment*/)
285 {
286 if constexpr (fast_load)
287 { // Check if cached chunks have been already consumed and we need to fetch the next chunks.
288 if (current_chunk_pos == final_chunk_pos)
289 {
290 underflow();
291 current_chunk_pos = 0;
292 }
293 else
294 {
295 ++current_chunk_pos;
296 }
297 }
298 else // In case fast load is not available only one chunk is filled at a time.
299 {
300 underflow();
301 }
302
303 return *this;
304 }
305
307 constexpr value_type operator++(int /*post-increment*/)
308 {
309 value_type tmp = this->operator*();
310 ++(*this);
311 return tmp;
312 }
314
319 constexpr bool operator==(std::default_sentinel_t const &) const noexcept
320 {
321 return at_end;
322 }
323
325 friend constexpr bool operator==(std::default_sentinel_t const &, iterator_type const & rhs) noexcept
326 {
327 return rhs.at_end;
328 }
329
331 constexpr bool operator!=(std::default_sentinel_t const &) const noexcept
332 {
333 return !at_end;
334 }
335
337 friend constexpr bool operator!=(std::default_sentinel_t const &, iterator_type const & rhs) noexcept
338 {
339 return !rhs.at_end;
340 }
342
343private:
354 auto unpack(max_simd_type const & row) const
355 {
356 if constexpr (chunk_size == simd_traits<max_simd_type>::length / 2) // upcast into 2 vectors.
357 {
358 return std::array{simd::upcast<simd_t>(extract_half<0>(row)), // 1. half
359 simd::upcast<simd_t>(extract_half<1>(row))}; // 2. half
360 }
361 else if constexpr (chunk_size == simd_traits<max_simd_type>::length / 4) // upcast into 4 vectors.
362 {
363 return std::array{simd::upcast<simd_t>(extract_quarter<0>(row)), // 1. quarter
364 simd::upcast<simd_t>(extract_quarter<1>(row)), // 2. quarter
365 simd::upcast<simd_t>(extract_quarter<2>(row)), // 3. quarter
366 simd::upcast<simd_t>(extract_quarter<3>(row))}; // 4. quarter
367 }
368 else if constexpr (chunk_size == simd_traits<max_simd_type>::length / 8) // upcast into 8 vectors.
369 {
370 return std::array{simd::upcast<simd_t>(extract_eighth<0>(row)), // 1. eighth
371 simd::upcast<simd_t>(extract_eighth<1>(row)), // 2. eighth
372 simd::upcast<simd_t>(extract_eighth<2>(row)), // 3. eighth
373 simd::upcast<simd_t>(extract_eighth<3>(row)), // 4. eighth
374 simd::upcast<simd_t>(extract_eighth<4>(row)), // 5. eighth
375 simd::upcast<simd_t>(extract_eighth<5>(row)), // 6. eighth
376 simd::upcast<simd_t>(extract_eighth<6>(row)), // 7. eighth
377 simd::upcast<simd_t>(extract_eighth<7>(row))}; // 8. eighth
378 }
379 else
380 {
381 return std::array{simd::upcast<simd_t>(row)};
382 }
383 }
384
396 {
397 auto apply_padding = [this](simd_t const vec)
398 {
399 return (vec == simd::fill<simd_t>(static_cast<uint8_t>(~0))) ? this_view->padding_simd_vector : vec;
400 };
401
402 // Iterate over the rows of the matrix
403 for (uint8_t row = 0; row < static_cast<uint8_t>(matrix.size()); ++row)
404 {
405 // split a row into multiple chunks of size `chunk_size`
406 auto chunked_row = unpack(matrix[row]);
407
408 if constexpr (chunked_row.size() == 1)
409 {
410 this_view->cached_simd_chunks[0][row] = apply_padding(std::move(chunked_row[0]));
411 }
412 else // Parse the tuple elements and store them in the cached simd chunks.
413 {
414 static_assert(chunked_row.size() == chunks_per_load, "Expected chunks_per_load many simd vectors.");
415
416 for (uint8_t chunk = 0; chunk < chunks_per_load; ++chunk) // store chunks in respective cached entries.
417 {
418 size_t idx = chunk * chunks_per_load + row / chunk_size;
419 this_view->cached_simd_chunks[idx][row % chunk_size] = apply_padding(std::move(chunked_row[chunk]));
420 }
421 }
422 }
423 }
424
428 constexpr bool all_iterators_reached_sentinel() const noexcept
429 {
430 using std::get;
431
432 return std::ranges::all_of(views::zip(cached_iter, cached_sentinel),
433 [](auto && iterator_sentinel_pair)
434 {
435 return get<0>(iterator_sentinel_pair) == get<1>(iterator_sentinel_pair);
436 });
437 }
438
449 constexpr simd_t convert_single_column() noexcept
450 {
451 simd_t simd_column{};
452 for (size_t idx = 0u; idx < chunk_size; ++idx)
453 {
454 if (cached_iter[idx] == cached_sentinel[idx])
455 {
456 simd_column[idx] = this_view->padding_value;
457 }
458 else
459 {
460 simd_column[idx] = static_cast<scalar_type>(seqan3::to_rank(*cached_iter[idx]));
461 ++cached_iter[idx];
462 }
463 };
464 return simd_column;
465 }
466
477 template <typename array_t>
478 constexpr void update_final_chunk_position(array_t const & iterators_before_update) noexcept
479 {
480 size_t max_distance = 0;
481 for (auto && [it, sent] : views::zip(iterators_before_update, cached_sentinel))
482 max_distance = std::max<size_t>(std::ranges::distance(it, sent), max_distance);
483
484 assert(max_distance > 0);
485 assert(max_distance <= (total_chunks * chunk_size));
486
487 --max_distance;
488 final_chunk_pos = max_distance / chunk_size;
489 // first we should be able to check the chunk position.
490 final_chunk_size = (max_distance % chunk_size) + 1;
491 }
492
494 constexpr void underflow()
495 requires fast_load
496 {
497 at_end = final_chunk;
498 if (at_end) // reached end of stream.
499 return;
500 // For the efficient load we assume at most one byte sized alphabets.
501 // Hence we can load `simd_traits<simd_t>::max_length` length many elements at once.
502 // Depending on the packing of `simd_t` we can prefetch blocks and store them in the `cached_simd_chunks`.
503 // E.g. assume `simd_t` with length 8 on SSE4 with max length 16.
504 // To fill the 16x16 matrix we need four 8x8 matrices.
505 // Thus, for the 8 sequences we need to load two times 16 consecutive bytes to fill the matrix, i.e. two loads
506 // see figure below.
507 //
508 // 0 1 ... 7 | 8 9 ... 15
509 // 0 [a00, a01, ..., a07]|[a08, a09, ..., a15] // first load of seq a reads 16 characters
510 // 1 [b00, b01, ..., b07]|[b08, b09, ..., b15] // first load of seq b reads 16 characters
511 // ... | ...
512 // 7 [g00, g01, ..., g07]|[g08, g09, ..., g15] // first load of seq g reads 16 characters
513 // ----------------------------------------
514 // 8 [a16, a17, ..., a23]|[a24, a25, ..., a31] // second load of seq a reads next 16 characters
515 // 9 [b16, b17, ..., b23]|[b24, b25, ..., b31] // second load of seq b reads next 16 characters
516 // ... | ...
517 // 15 [g16, g17, ..., g23]|[g24, g25, ..., g31] // second load of seq g reads next 16 characters
518 //
519 // This quadratic byte matrix can be transposed efficiently with simd instructions.
520 // If the target simd scalar type is bigger we can apply the same mechanism but have then 16 4x4 matrices
521 // (32 bit) or 256 2x2 matrices (64 bit).
522
523 constexpr int8_t max_size = simd_traits<simd_t>::max_length;
525 decltype(cached_iter) iterators_before_update{cached_iter}; // Keep track of iterators before the update.
526 // Iterate over each sequence.
527 for (uint8_t sequence_pos = 0; sequence_pos < chunk_size; ++sequence_pos)
528 { // Iterate over each block depending on the packing of the target simd vector.
529 for (uint8_t chunk_pos = 0; chunk_pos < chunks_per_load; ++chunk_pos)
530 {
531 uint8_t pos = chunk_pos * chunk_size + sequence_pos; // matrix entry to fill
532 if (cached_sentinel[sequence_pos] - cached_iter[sequence_pos] >= max_size)
533 { // Not in final block, thus load directly from memory.
534 matrix[pos] = simd::load<max_simd_type>(std::addressof(*cached_iter[sequence_pos]));
535 std::advance(cached_iter[sequence_pos], max_size);
536 }
537 else // Loads the final block byte wise in order to not load from uninitialised memory.
538 {
539 matrix[pos] = simd::fill<max_simd_type>(~0);
540 auto & sequence_it = cached_iter[sequence_pos];
541 for (int8_t idx = 0; sequence_it != cached_sentinel[sequence_pos]; ++sequence_it, ++idx)
542 matrix[pos][idx] = seqan3::to_rank(*sequence_it);
543 }
544 }
545 }
546
547 // Handle final chunk which might not end at an offset which is not a multiple of `chunk_size`.
548 final_chunk = all_iterators_reached_sentinel();
549
550 if (final_chunk)
551 update_final_chunk_position(iterators_before_update);
552
554 split_into_sub_matrices(std::move(matrix));
555 }
556
558 constexpr void underflow()
559 requires (!fast_load)
560 {
561 at_end = final_chunk;
562 if (at_end) // reached end of stream.
563 return;
564
565 decltype(cached_iter) iterators_before_update{cached_iter}; // Keep track of iterators before the update.
566 for (size_t i = 0; i < chunk_size; ++i)
567 this_view->cached_simd_chunks[0][i] = convert_single_column();
568
569 final_chunk = all_iterators_reached_sentinel();
570
571 if (final_chunk)
572 update_final_chunk_position(iterators_before_update);
573 }
574
580 view_to_simd * this_view{nullptr};
582 uint8_t final_chunk_size{chunk_size};
584 uint8_t final_chunk_pos{total_chunks - 1};
586 uint8_t current_chunk_pos{0};
588 bool final_chunk{true};
590 bool at_end{true};
591};
592
593// ============================================================================
594// to_simd_fn (adaptor definition)
595// ============================================================================
596
605template <simd::simd_concept simd_t>
607{
610
614 constexpr auto operator()(padding_t const padding_value) const noexcept
615 {
616 return detail::adaptor_from_functor{*this, padding_value};
617 }
618
620 constexpr auto operator()() const noexcept
621 {
622 return detail::adaptor_from_functor{*this};
623 }
624
630 template <std::ranges::range urng_t>
631 constexpr auto operator()(urng_t && urange, padding_t const padding_value) const noexcept
632 {
633 static_assert(std::ranges::forward_range<urng_t>,
634 "The underlying range in views::to_simd must model std::ranges::forward_range.");
635 static_assert(std::ranges::viewable_range<urng_t>,
636 "The underlying range in views::to_simd must model std::ranges::viewable_range.");
637 static_assert(std::ranges::input_range<std::ranges::range_value_t<urng_t>>,
638 "The value type of the underlying range must model std::ranges::input_range.");
640 "The value type of the inner ranges must model seqan3::semialphabet.");
641
642 return view_to_simd<type_reduce_t<urng_t>, simd_t>{std::forward<urng_t>(urange), padding_value};
643 }
644
649 template <std::ranges::range urng_t>
650 constexpr auto operator()(urng_t && urange) const noexcept
651 {
652 static_assert(std::ranges::forward_range<urng_t>,
653 "The underlying range in views::to_simd must model std::ranges::forward_range.");
654 static_assert(std::ranges::viewable_range<urng_t>,
655 "The underlying range in views::to_simd must model std::ranges::viewable_range.");
656 static_assert(std::ranges::input_range<std::ranges::range_value_t<urng_t>>,
657 "The value type of the underlying range must model std::ranges::input_range.");
659 "The value type of the inner ranges must model seqan3::semialphabet.");
660
661 return view_to_simd<type_reduce_t<urng_t>, simd_t>{std::forward<urng_t>(urange)};
662 }
663
665 template <std::ranges::range urng_t>
666 constexpr friend auto operator|(urng_t && urange, to_simd_fn const & me)
667 {
668 return me(std::forward<urng_t>(urange));
669 }
670};
671
672} // namespace seqan3::detail
673
674namespace seqan3::views
675{
676
778template <simd::simd_concept simd_t>
779inline constexpr auto to_simd = detail::to_simd_fn<simd_t>{};
780
781} // namespace seqan3::views
Provides seqan3::detail::adaptor_from_functor.
T addressof(T... args)
T advance(T... args)
Provides algorithms to modify seqan3::simd::simd_type.
T all_of(T... args)
Core alphabet concept and free function/type trait wrappers.
T begin(T... args)
Template for range adaptor closure objects that store arguments and wrap a proto-adaptor.
Definition adaptor_from_functor.hpp:54
Defines the requirements of a matrix (e.g. score matrices, trace matrices).
Definition matrix_concept.hpp:58
Iterator that transposes the underlying range of ranges and transforms that to SIMD types.
Definition to_simd.hpp:205
auto unpack(max_simd_type const &row) const
Unpacks one row of the transposed byte matrix using simd instructions.
Definition to_simd.hpp:354
ptrdiff_t difference_type
The difference type.
Definition to_simd.hpp:213
constexpr void update_final_chunk_position(array_t const &iterators_before_update) noexcept
Updates the end of the final chunk and sets the index of the final chunk.
Definition to_simd.hpp:478
constexpr void split_into_sub_matrices(std::array< max_simd_type, simd_traits< max_simd_type >::length > matrix) const
Unpacks the matrix of simd types and caches the respective chunk entries.
Definition to_simd.hpp:395
constexpr iterator_type & operator=(iterator_type &&)=default
Defaulted.
void pointer
The pointer type.
Definition to_simd.hpp:212
constexpr value_type operator++(int)
Advances the iterator to the next chunk and returns the previous pointed-to value.
Definition to_simd.hpp:307
friend constexpr bool operator!=(std::default_sentinel_t const &, iterator_type const &rhs) noexcept
Returns true if iterator did not reach the end yet, otherwise false.
Definition to_simd.hpp:337
constexpr bool all_iterators_reached_sentinel() const noexcept
Checks if all sequence iterators reached the end.
Definition to_simd.hpp:428
constexpr simd_t convert_single_column() noexcept
Convert a single column into a simd vector.
Definition to_simd.hpp:449
constexpr bool operator!=(std::default_sentinel_t const &) const noexcept
Returns true if iterator did not reach the end yet, otherwise false.
Definition to_simd.hpp:331
constexpr iterator_type(iterator_type &&)=default
Defaulted.
constexpr void underflow()
Fetches the next available chunk(s).
Definition to_simd.hpp:494
constexpr iterator_type()=default
Defaulted.
constexpr reference operator*() const noexcept
Returns a reference to the current chunk of simd vectors.
Definition to_simd.hpp:272
constexpr iterator_type(view_to_simd &this_view)
Construction from the associated range.
Definition to_simd.hpp:236
friend constexpr bool operator==(std::default_sentinel_t const &, iterator_type const &rhs) noexcept
Returns true if iterator reached the end, otherwise false.
Definition to_simd.hpp:325
constexpr iterator_type & operator=(iterator_type const &)=default
Defaulted.
constexpr bool operator==(std::default_sentinel_t const &) const noexcept
Returns true if iterator reached the end, otherwise false.
Definition to_simd.hpp:319
constexpr iterator_type & operator++()
Advances the iterator to the next chunk.
Definition to_simd.hpp:284
constexpr iterator_type(iterator_type const &)=default
Defaulted.
constexpr void underflow()
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition to_simd.hpp:558
Transforms a range of ranges into chunks of seqan3::simd vectors.
Definition to_simd.hpp:57
constexpr iterator_type begin() noexcept
The iterator to begin of this range.
Definition to_simd.hpp:142
static constexpr uint8_t chunk_size
The size of one chunk. Equals the number of elements in the simd vector.
Definition to_simd.hpp:89
scalar_type padding_value
The padding value used to fill the corresponding simd vector element.
Definition to_simd.hpp:193
constexpr std::default_sentinel_t end() noexcept
A sentinel representing the end of this range.
Definition to_simd.hpp:151
constexpr bool empty() const noexcept
Checks whether the range is empty.
Definition to_simd.hpp:161
static constexpr bool fast_load
Check if fast load is enabled.
Definition to_simd.hpp:83
static constexpr uint8_t total_chunks
The total number of chunks that can be cached.
Definition to_simd.hpp:93
constexpr size_t size() const noexcept
Returns the size of this range.
Definition to_simd.hpp:177
constexpr void end() const noexcept=delete
Const iteration is disabled.
static constexpr uint8_t chunks_per_load
The number of chunks that can be gathered with a single load.
Definition to_simd.hpp:91
simd_t padding_simd_vector
A cached simd vector with the padding symbol.
Definition to_simd.hpp:192
std::ranges::range_value_t< urng_t > inner_range_type
The inner range type.
Definition to_simd.hpp:72
static constexpr auto alphabet_size
The alphabet size.
Definition to_simd.hpp:95
constexpr view_to_simd()=default
Defaulted.
urng_t urng
The underlying range.
Definition to_simd.hpp:190
std::array< chunk_type, total_chunks > cached_simd_chunks
The cached chunks of transformed simd vectors.
Definition to_simd.hpp:191
constexpr void begin() const noexcept=delete
Const iteration is disabled.
simd_type_t< uint8_t, simd_traits< simd_t >::max_length > max_simd_type
The SIMD type with maximal number of lanes for the current arch.
Definition to_simd.hpp:76
typename simd_traits< simd_t >::scalar_type scalar_type
Definition to_simd.hpp:74
constexpr view_to_simd(other_urng_t &&urng, scalar_type const padding_value=alphabet_size)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition to_simd.hpp:133
Provides various transformation traits used by the range module.
@ row
The corresponding alignment coordinate will be incrementable/decrementable in the row index.
decltype(seqan3::to_rank(std::declval< semi_alphabet_type >())) alphabet_rank_t
The rank_type of the semi-alphabet; defined as the return type of seqan3::to_rank....
Definition alphabet/concept.hpp:166
constexpr auto to_rank
Return the rank representation of a (semi-)alphabet object.
Definition alphabet/concept.hpp:152
constexpr auto to_simd
A view that transforms a range of ranges into chunks of seqan3::simd vectors.
Definition to_simd.hpp:779
constexpr void transpose(std::array< simd_t, simd_traits< simd_t >::length > &matrix)
Transposes the given simd vector matrix.
Definition algorithm.hpp:420
typename simd_type< scalar_t, length, simd_backend >::type simd_type_t
Helper type of seqan3::simd::simd_type.
Definition simd.hpp:56
seqan::stl::views::zip zip
A view adaptor that takes several views and returns tuple-like values from every i-th element of each...
Definition zip.hpp:24
The basis for seqan3::alphabet, but requires only rank interface (not char).
T max_element(T... args)
The internal SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
The SeqAn namespace for views.
Definition char_strictly_to.hpp:19
SeqAn specific customisations in the standard namespace.
Provides seqan3::simd::simd_type.
Provides seqan3::simd::simd_traits.
views::to_simd's range adaptor closure object type.
Definition to_simd.hpp:607
typename simd_traits< simd_t >::scalar_type padding_t
The type of a padding value.
Definition to_simd.hpp:609
constexpr auto operator()(urng_t &&urange) const noexcept
Call the view's constructor with the underlying std::ranges::viewable_range as argument.
Definition to_simd.hpp:650
constexpr auto operator()(urng_t &&urange, padding_t const padding_value) const noexcept
Call the view's constructor with the underlying std::ranges::viewable_range as argument.
Definition to_simd.hpp:631
constexpr friend auto operator|(urng_t &&urange, to_simd_fn const &me)
Overloaded bit-operator to allow chaining with other ranges.
Definition to_simd.hpp:666
constexpr auto operator()() const noexcept
Returns a range adaptor object.
Definition to_simd.hpp:620
constexpr auto operator()(padding_t const padding_value) const noexcept
Returns a range adaptor closure object with the given parameter.
Definition to_simd.hpp:614
seqan3::simd::simd_traits is the trait class that provides uniform interface to the properties of sim...
Definition simd_traits.hpp:38
Provides type traits for working with templates.
Provides seqan3::views::type_reduce.
Provides seqan3::simd::simd_concept.
Provides seqan3::views::zip.
Hide me