std::experi..._mask::size(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

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 of std::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