CoolerView
¶
Header File: Kokkos_Core.hpp
Description¶
Interface¶
-
template<class DataType, class ...Traits>
class CoolerView¶ - Template Parameters:
Foo – Description of the Foo template parameter
- Param bar:
Description of the bar parameter
Public Types:
-
type data_type¶
Some interesting description of the type and how to use it.
Static Public Member Variables:
-
int some_var = 5;¶
Description of some_var
See also
The
frobrnicator()
free function.
Constructors:
-
CoolerView(CoolerView &&rhs)¶
Whether it’s a move/copy/default constructor. Describe what it does.
Destructor:
-
~CoolerView()¶
Performs some special operation when destroyed.
Public Member Functions:
-
template<class U>
foo(U x)¶ Brief description of the function.
- Template Parameters:
U – Description of U
- Param:
description of x
Changed in version 3.7.1: What changed between versions: e.g. Only takes one parameter for foo-style operations instead of two.
-
type [[deprecated("in version 4.0.1")]] foobar¶
Represents the foobar capability.
Deprecated since version 4.0.1: Use
foobat
instead.
-
type foobat¶
A better version of foobar.
Added in version 4.0.1.
Non-Member Functions¶
-
template<class ViewSrc>
bool operator==(CoolerView, ViewSrc);¶ - Template Parameters:
ViewDst – the other
- Returns:
true if
View::value_type
,View::array_layout
,View::memory_space
,View::rank()
,View::data()
and View::extent(r), for 0 <= r < rank, match.
-
void frobrnicator(CoolerView &v) noexcept¶
- Param:
v the
CoolerView
to frobnicate
Frobnicates a CoolerView.
Examples¶
#include <Kokkos_Core.hpp>
#include <cstdio>
int main(int argc, char* argv[]) {
Kokkos::initialize(argc,argv);
int N0 = atoi(argv[1]);
int N1 = atoi(argv[2]);
Kokkos::View<double*> a("A",N0);
Kokkos::View<double*> b("B",N1);
Kokkos::parallel_for("InitA", N0, KOKKOS_LAMBDA (const int& i) {
a(i) = i;
});
Kokkos::parallel_for("InitB", N1, KOKKOS_LAMBDA (const int& i) {
b(i) = i;
});
Kokkos::View<double**,Kokkos::LayoutLeft> c("C",N0,N1);
{
Kokkos::View<const double*> const_a(a);
Kokkos::View<const double*> const_b(b);
Kokkos::parallel_for("SetC", Kokkos::MDRangePolicy<Kokkos::Rank<2,Kokkos::Iterate::Left>>({0,0},{N0,N1}),
KOKKOS_LAMBDA (const int& i0, const int& i1) {
c(i0,i1) = a(i0) * b(i1);
});
}
Kokkos::finalize();
}