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

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

πŸ’– std::experi...::simd::size(3) πŸ’–

okay bestie, this one comes from the C++ Standard Libary β€” yes, "Libary" is exactly how the manual name is spelled up top and we are not fixing it, periodt. The page is all about std::experimental::simd::size, and the vibe is very "how wide is my SIMD, bestie?" πŸ’…


🌸 NAME 🌸

std::experimental::simd::size - std::experimental::simd::size

✨ Synopsis ✨

static constexpr size_t size() noexcept;  (parallelism TS v2)

Returns the width (the number of values) of simd<T, Abi>. πŸ’–

πŸŽ€ Example πŸŽ€

The actual output depends on target and compiler flags. No cap.

// Run this code

        #include <experimental/simd>
        #include <cstdint>
        #include <iostream>
        namespace stdx = std::experimental;

        int main()
        {
            stdx::native_simd<std::int32_t> a = 1;
            std::cout << a.size() << '\n';
            std::cout << reduce(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_mask<T,Abi>).

okay that's the whole page, bestie! source: http://cppreference.com Β· date/version: 2024.06.10 Β· page: std::experi...::simd::size(3) β€” slay, bye! πŸŽ€βœ¨

πŸ“¦ where this page comes from