A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://kokkos.github.io/kokkos-core-wiki/API/simd/simd.html below:

Experimental::simd - Kokkos documentation

Experimental::simd

Header File: Kokkos_SIMD.hpp

Usage:

Kokkos::Experimental::simd is an abstraction over platform-specific vector datatypes and calls platform-specific vector intrinsics. It is based on the simd type proposed for ISO C++ in this document

Interface
namespace Experimental {
template <class T, class Abi>
class basic_simd;
}
Template Parameters

The first template parameter T should be a C++ fundamental type for which the current platform supports vector intrinsics. Kokkos supports the following types for T:

The second template parameter Abi is one of the pre-defined ABI types in the namespace Kokkos::Experimental::simd_abi. This type determines the size of the vector and what architecture-specific intrinsics will be used. The following types are always available in that namespace:

Typedefs Width Constructors Load/Store Methods Simd Flags Value Access Methods Arithmetic Operators Compound Assignment Operators Comparison Operators Rounding Functions Min/Max Functions Reductions <cmath> Functions

These functions are only defined in AVX2 and AVX512 for value_type=float and value_type=double

Global Typedefs Examples
#include <Kokkos_SIMD.hpp>
#include <cstdio>

int main(int argc, char* argv[]) {
  Kokkos::initialize(argc,argv);
  {
    using simd_type = Kokkos::Experimental::simd<double>;
    simd_type a([] (std::size_t i) { return 0.1 * i; });
    simd_type b(2.0);
    simd_type c = Kokkos::sqrt(a * a + b * b);
    for (std::size_t i = 0; i < simd_type::size(); ++i) {
      printf("[%zu] = %g\n", i, c[i]);
    }
  }
  Kokkos::finalize();
}

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4