# std::experimental::simd<T,Abi>::size

From cppreference.com
< cpp‎ | experimental‎ | simd‎ | simd

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.

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>`)

Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/experimental/simd/simd/size&oldid=151187"