Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::experimental::simd_cast,std::experimental::static_simd_cast

      From cppreference.com
      <cpp‎ |experimental‎ |simd
       
       
       
       
       
      Defined in header<experimental/simd>
      template<class V,class T,class Abi>
      /*see below*/ simd_cast(const simd<T, Abi>& v)noexcept;
      (1)(parallelism TS v2)
      template<class V,class T,class Abi>
      /*see below*/ static_simd_cast(const simd<T, Abi>& v)noexcept;
      (2)(parallelism TS v2)

      Cast a simd object to another simd object. If V is T, returnssimd<T, Abi>; otherwise, if V is a scalar type, returnssimd<V, simd_abi::fixed_size<simd<T, Abi>::size()>>. Otherwise, V must be a simd type, and the function returns V.

      1) This function does not participate in overloading resolution unless
      • every possible value of the input element can be represented with the output element,
      • eitheris_simd_v<V> is false, orV::size() issimd<T, Abi>::size().
      2) This function does not participate in overloading resolution unless eitheris_simd_v<V> is false, orV::size() issimd<T, Abi>::size().

      Contents

      [edit]Parameters

      v - the input simd object

      [edit]Return value

      A simd object with the i-th element initialized tostatic_cast<To>(v[i]), where To is the output element type as specified.

      [edit]Notes

      The TS specification is missingsimd_cast andstatic_simd_cast overloads forsimd_mask. The libstdc++ implementation provides the missing overloads in thestd::experimental::__proposed namespace. If you already use the

      namespace stdx= std::experimental;

      shortcut, you might be interested to use

      namespace stdx{usingnamespace std::experimental;usingnamespace std::experimental::__proposed;}

      instead. Alternatively, libstdc++ implements a__cvt() member function insimd_mask, which allows implicit conversion of the mask. See also:https://github.com/VcDevel/std-simd/issues/41

      [edit]Example

      This section is incomplete
      Reason: no example
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/experimental/simd/simd_cast&oldid=157506"

      [8]ページ先頭

      ©2009-2026 Movatter.jp