std::experi..._mask::size(3)
okay bestie, welcome to the std::experi..._mask::size(3) page from the C++ Standard Libary manual. The main character is std::experimental::simd_mask::size, and sheβs here to hand you the width of simd_mask<T, Abi> with zero drama. π
β¨
πΈ NAME πΈ
std::experimental::simd_mask::size-std::experimental::simd_mask::size
Yes, the NAME section is mirroring the same name twice β we love a consistent queen. π
β¨ Synopsis β¨
Hereβs the signature in all its static constexpr + noexcept glory:
static constexpr size_t size() noexcept; (parallelism TS v2)
Returns the width (the number of values) of simd_mask<T, Abi>. Thatβs literally the whole job, and she ate. π
π¦ Example π¦
The actual output depends on target and compiler flags. So donβt panic if your terminal serves different numbers β thatβs just the target/compiler-flags situation, fr fr.
// Run this code
#include <experimental/simd>
#include <iostream>
namespace stdx = std::experimental;
int main()
{
stdx::native_simd_mask<int> a { true };
std::cout << a.size() << '\n';
std::cout << popcount(a) << '\n';
}
π Possible output: π
16
16
π See also π
simd_size(parallelism TS v2)β obtains the number of elements of a given element type and ABI tag (class template)size[static](parallelism TS v2)β returns the width / number of elements (public static member function ofstd::experimental::simd<T,Abi>)
thatβs the whole page, bestie β go forth and size your masks πβ¨ source: http://cppreference.com Β· date: 2024.06.10 Β· page: std::experi..._mask::size(3)
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms