Kokkos Core Kernels Package  Version of the Day
Namespaces | Classes | Enumerations | Functions
Kokkos Namespace Reference

Namespaces

 hwloc
 Minimal subset of logical 'hwloc' functionality available from http://www.open-mpi.org/projects/hwloc/.
 

Classes

struct  Array
 Derived from the C++17 'std::array'. Dropping the iterator interface. More...
 
class  Bitset
 A thread safe view to a bitset. More...
 
class  complex
 Partial reimplementation of std::complex that works as the result of a Kokkos::parallel_reduce. More...
 
class  ConstBitset
 
struct  Device
 Memory space for main process and CPU execution spaces. More...
 
class  Future
 
class  HostSpace
 Memory management for host memory. More...
 
struct  LayoutLeft
 Memory layout tag indicating left-to-right (Fortran scheme) striding of multi-indices. More...
 
struct  LayoutRight
 Memory layout tag indicating right-to-left (C or lexigraphical scheme) striding of multi-indices. More...
 
struct  LayoutStride
 Memory layout tag indicated arbitrarily strided multi-index mapping into contiguous memory. More...
 
struct  LayoutTileLeft
 Memory layout tag indicating left-to-right (Fortran scheme) striding of multi-indices by tiles. More...
 
struct  pair
 Replacement for std::pair that works on CUDA devices. More...
 
class  Qthread
 Execution space supported by Qthread. More...
 
class  RangePolicy
 Execution policy for work over a range of an integral type. More...
 
class  ScratchMemorySpace
 Scratch memory space associated with an execution space. More...
 
class  StaticCrsGraph
 Compressed row storage array. More...
 
class  TeamPolicy
 Execution policy for parallel work over a league of teams of threads. More...
 
class  Timer
 Time since construction. More...
 
class  UnorderedMap
 Thread-safe, performance-portable lookup table. More...
 
class  UnorderedMapInsertResult
 First element of the return value of UnorderedMap::insert(). More...
 
class  View
 View to an array of data. More...
 
class  ViewTraits
 Traits class for accessing attributes of a View. More...
 

Enumerations

enum  MemoryTraitsFlags
 Memory access traits for views, an extension point. More...
 

Functions

template<class RealType >
KOKKOS_INLINE_FUNCTION complex< RealType > operator+ (const complex< RealType > &x, const complex< RealType > &y)
 Binary + operator for complex. More...
 
template<class RealType >
KOKKOS_INLINE_FUNCTION complex< RealType > operator+ (const complex< RealType > &x)
 Unary + operator for complex. More...
 
template<class RealType >
KOKKOS_INLINE_FUNCTION complex< RealType > operator- (const complex< RealType > &x, const complex< RealType > &y)
 Binary - operator for complex. More...
 
template<class RealType >
KOKKOS_INLINE_FUNCTION complex< RealType > operator- (const complex< RealType > &x)
 Unary - operator for complex. More...
 
template<class RealType >
KOKKOS_INLINE_FUNCTION complex< RealType > operator* (const complex< RealType > &x, const complex< RealType > &y)
 Binary * operator for complex. More...
 
template<class RealType >
complex< RealType > operator* (const std::complex< RealType > &x, const complex< RealType > &y)
 Binary * operator for std::complex and complex. More...
 
template<class RealType >
KOKKOS_INLINE_FUNCTION complex< RealType > operator* (const RealType &x, const complex< RealType > &y)
 Binary * operator for RealType times complex. More...
 
template<class RealType >
KOKKOS_INLINE_FUNCTION RealType imag (const complex< RealType > &x)
 Imaginary part of a complex number. More...
 
template<class RealType >
KOKKOS_INLINE_FUNCTION RealType real (const complex< RealType > &x)
 Real part of a complex number. More...
 
template<class RealType >
KOKKOS_INLINE_FUNCTION RealType abs (const complex< RealType > &x)
 Absolute value (magnitude) of a complex number. More...
 
template<class RealType >
KOKKOS_INLINE_FUNCTION complex< RealType > conj (const complex< RealType > &x)
 Conjugate of a complex number. More...
 
template<class RealType1 , class RealType2 >
KOKKOS_INLINE_FUNCTION complex< RealType1 > operator/ (const complex< RealType1 > &x, const RealType2 &y)
 Binary operator / for complex and real numbers. More...
 
template<class RealType >
KOKKOS_INLINE_FUNCTION complex< RealType > operator/ (const complex< RealType > &x, const complex< RealType > &y)
 Binary operator / for complex. More...
 
template<class RealType >
KOKKOS_INLINE_FUNCTION bool operator== (const complex< RealType > &x, const complex< RealType > &y)
 Equality operator for two complex numbers. More...
 
template<class RealType >
KOKKOS_INLINE_FUNCTION bool operator== (const std::complex< RealType > &x, const complex< RealType > &y)
 Equality operator for std::complex and Kokkos::complex. More...
 
template<class RealType1 , class RealType2 >
KOKKOS_INLINE_FUNCTION bool operator== (const complex< RealType1 > &x, const RealType2 &y)
 Equality operator for complex and real number. More...
 
template<class RealType >
KOKKOS_INLINE_FUNCTION bool operator== (const RealType &x, const complex< RealType > &y)
 Equality operator for real and complex number. More...
 
template<class RealType >
KOKKOS_INLINE_FUNCTION bool operator!= (const complex< RealType > &x, const complex< RealType > &y)
 Inequality operator for two complex numbers. More...
 
template<class RealType >
KOKKOS_INLINE_FUNCTION bool operator!= (const std::complex< RealType > &x, const complex< RealType > &y)
 Inequality operator for std::complex and Kokkos::complex. More...
 
template<class RealType1 , class RealType2 >
KOKKOS_INLINE_FUNCTION bool operator!= (const complex< RealType1 > &x, const RealType2 &y)
 Inequality operator for complex and real number. More...
 
template<class RealType >
KOKKOS_INLINE_FUNCTION bool operator!= (const RealType &x, const complex< RealType > &y)
 Inequality operator for real and complex number. More...
 
void finalize ()
 Finalize the spaces that were initialized via Kokkos::initialize. More...
 
void finalize_all ()
 Finalize all known execution spaces. More...
 
template<typename iType , class TeamMemberType >
KOKKOS_INLINE_FUNCTION Impl::TeamThreadRangeBoundariesStruct< iType, TeamMemberType > TeamThreadRange (const TeamMemberType &, const iType &count)
 Execution policy for parallel work over a threads within a team. More...
 
template<typename iType1 , typename iType2 , class TeamMemberType >
KOKKOS_INLINE_FUNCTION Impl::TeamThreadRangeBoundariesStruct< typename std::common_type< iType1, iType2 >::type, TeamMemberType > TeamThreadRange (const TeamMemberType &, const iType1 &begin, const iType2 &end)
 Execution policy for parallel work over a threads within a team. More...
 
template<typename iType , class TeamMemberType >
KOKKOS_INLINE_FUNCTION Impl::ThreadVectorRangeBoundariesStruct< iType, TeamMemberType > ThreadVectorRange (const TeamMemberType &, const iType &count)
 Execution policy for a vector parallel loop. More...
 
template<class T1 , class T2 >
KOKKOS_FORCEINLINE_FUNCTION bool operator== (const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
 Equality operator for Kokkos::pair. More...
 
template<class T1 , class T2 >
KOKKOS_FORCEINLINE_FUNCTION bool operator!= (const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
 Inequality operator for Kokkos::pair. More...
 
template<class T1 , class T2 >
KOKKOS_FORCEINLINE_FUNCTION bool operator< (const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
 Less-than operator for Kokkos::pair. More...
 
template<class T1 , class T2 >
KOKKOS_FORCEINLINE_FUNCTION bool operator<= (const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
 Less-than-or-equal-to operator for Kokkos::pair. More...
 
template<class T1 , class T2 >
KOKKOS_FORCEINLINE_FUNCTION bool operator> (const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
 Greater-than operator for Kokkos::pair. More...
 
template<class T1 , class T2 >
KOKKOS_FORCEINLINE_FUNCTION bool operator>= (const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
 Greater-than-or-equal-to operator for Kokkos::pair. More...
 
template<class T1 , class T2 >
KOKKOS_FORCEINLINE_FUNCTION pair< T1, T2 > make_pair (T1 x, T2 y)
 Return a new pair. More...
 
template<class T1 , class T2 >
KOKKOS_FORCEINLINE_FUNCTION pair< T1 &, T2 & > tie (T1 &x, T2 &y)
 Return a pair of references to the input arguments. More...
 
template<class ExecPolicy , class FunctorType >
void parallel_for (const ExecPolicy &policy, const FunctorType &functor, const std::string &str="", typename Impl::enable_if< ! Impl::is_integral< ExecPolicy >::value >::type *=0)
 Execute functor in parallel according to the execution policy. More...
 
template<class PolicyType , class FunctorType , class ReturnType >
void parallel_reduce (const std::string &label, const PolicyType &policy, const FunctorType &functor, ReturnType &return_value, typename Impl::enable_if< Kokkos::Impl::is_execution_policy< PolicyType >::value >::type *=0)
 Parallel reduction. More...
 
template<class ... Args>
Impl::ViewCtorProp< typename Impl::ViewCtorProp< void, Args >::type ... > view_alloc (Args const &... args)
 Create View allocation parameter bundle from argument list. More...
 
template<typename D , class ... P>
KOKKOS_INLINE_FUNCTION constexpr unsigned rank (const View< D, P... > &V)
 Temporary free function rank() until rank() is implemented in the View. More...
 
template<class DT , class ... DP>
void deep_copy (const View< DT, DP... > &dst, typename ViewTraits< DT, DP... >::const_value_type &value, typename std::enable_if< std::is_same< typename ViewTraits< DT, DP... >::specialize, void >::value >::type *=0)
 Deep copy a value from Host memory into a view. More...
 
template<class ST , class ... SP>
void deep_copy (typename ViewTraits< ST, SP... >::non_const_value_type &dst, const View< ST, SP... > &src, typename std::enable_if< std::is_same< typename ViewTraits< ST, SP... >::specialize, void >::value >::type *=0)
 Deep copy into a value in Host memory from a view. More...
 
template<class DT , class ... DP, class ST , class ... SP>
void deep_copy (const View< DT, DP... > &dst, const View< ST, SP... > &src, typename std::enable_if<(std::is_same< typename ViewTraits< DT, DP... >::specialize, void >::value &&std::is_same< typename ViewTraits< ST, SP... >::specialize, void >::value &&(unsigned(ViewTraits< DT, DP... >::rank)==unsigned(0) &&unsigned(ViewTraits< ST, SP... >::rank)==unsigned(0)))>::type *=0)
 A deep copy between views of compatible type, and rank zero. More...
 
template<class DT , class ... DP, class ST , class ... SP>
void deep_copy (const View< DT, DP... > &dst, const View< ST, SP... > &src, typename std::enable_if<(std::is_same< typename ViewTraits< DT, DP... >::specialize, void >::value &&std::is_same< typename ViewTraits< ST, SP... >::specialize, void >::value &&(unsigned(ViewTraits< DT, DP... >::rank) !=0||unsigned(ViewTraits< ST, SP... >::rank) !=0))>::type *=0)
 A deep copy between views of the default specialization, compatible type, same non-zero rank, same contiguous layout. More...
 
template<class ExecSpace , class DT , class ... DP>
void deep_copy (const ExecSpace &, const View< DT, DP... > &dst, typename ViewTraits< DT, DP... >::const_value_type &value, typename std::enable_if< Kokkos::Impl::is_execution_space< ExecSpace >::value &&std::is_same< typename ViewTraits< DT, DP... >::specialize, void >::value >::type *=0)
 Deep copy a value from Host memory into a view. More...
 
template<class ExecSpace , class ST , class ... SP>
void deep_copy (const ExecSpace &exec_space, typename ViewTraits< ST, SP... >::non_const_value_type &dst, const View< ST, SP... > &src, typename std::enable_if< Kokkos::Impl::is_execution_space< ExecSpace >::value &&std::is_same< typename ViewTraits< ST, SP... >::specialize, void >::value >::type *=0)
 Deep copy into a value in Host memory from a view. More...
 
template<class ExecSpace , class DT , class ... DP, class ST , class ... SP>
void deep_copy (const ExecSpace &exec_space, const View< DT, DP... > &dst, const View< ST, SP... > &src, typename std::enable_if<(Kokkos::Impl::is_execution_space< ExecSpace >::value &&std::is_same< typename ViewTraits< DT, DP... >::specialize, void >::value &&std::is_same< typename ViewTraits< ST, SP... >::specialize, void >::value &&(unsigned(ViewTraits< DT, DP... >::rank)==unsigned(0) &&unsigned(ViewTraits< ST, SP... >::rank)==unsigned(0)))>::type *=0)
 A deep copy between views of compatible type, and rank zero. More...
 
template<class ExecSpace , class DT , class ... DP, class ST , class ... SP>
void deep_copy (const ExecSpace &exec_space, const View< DT, DP... > &dst, const View< ST, SP... > &src, typename std::enable_if<(Kokkos::Impl::is_execution_space< ExecSpace >::value &&std::is_same< typename ViewTraits< DT, DP... >::specialize, void >::value &&std::is_same< typename ViewTraits< ST, SP... >::specialize, void >::value &&(unsigned(ViewTraits< DT, DP... >::rank) !=0||unsigned(ViewTraits< ST, SP... >::rank) !=0))>::type *=0)
 A deep copy between views of the default specialization, compatible type, same non-zero rank, same contiguous layout. More...
 
template<class T , class ... P>
std::enable_if< std::is_same< typename Kokkos::View< T, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::View< T, P... >::array_layout, Kokkos::LayoutRight >::value >::type resize (Kokkos::View< T, P... > &v, const size_t n0=0, const size_t n1=0, const size_t n2=0, const size_t n3=0, const size_t n4=0, const size_t n5=0, const size_t n6=0, const size_t n7=0)
 Resize a view with copying old data to new data at the corresponding indices. More...
 
template<class T , class ... P>
void resize (Kokkos::View< T, P... > &v, const typename Kokkos::View< T, P... >::array_layout &layout)
 Resize a view with copying old data to new data at the corresponding indices. More...
 
template<class T , class ... P>
std::enable_if< std::is_same< typename Kokkos::View< T, P... >::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::View< T, P... >::array_layout, Kokkos::LayoutRight >::value >::type realloc (Kokkos::View< T, P... > &v, const size_t n0=0, const size_t n1=0, const size_t n2=0, const size_t n3=0, const size_t n4=0, const size_t n5=0, const size_t n6=0, const size_t n7=0)
 Resize a view with discarding old data. More...
 
template<class T , class ... P>
void realloc (Kokkos::View< T, P... > &v, const typename Kokkos::View< T, P... >::array_layout &layout)
 Resize a view with discarding old data. More...
 

Detailed Description

Define Kokkos::DefaultExecutionSpace as per configuration option or chosen from the enabled execution spaces in the following order: Kokkos::Cuda, Kokkos::OpenMP, Kokkos::Threads, Kokkos::Serial

Enumeration Type Documentation

◆ MemoryTraitsFlags

Memory access traits for views, an extension point.

These traits should be orthogonal. If there are dependencies then the MemoryTraits template must detect and enforce dependencies.

A zero value is the default for a View, indicating that none of these traits are present.

Definition at line 62 of file Kokkos_MemoryTraits.hpp.

Function Documentation

◆ operator+() [1/2]

template<class RealType >
KOKKOS_INLINE_FUNCTION complex<RealType> Kokkos::operator+ ( const complex< RealType > &  x,
const complex< RealType > &  y 
)

Binary + operator for complex.

Definition at line 333 of file Kokkos_Complex.hpp.

◆ operator+() [2/2]

template<class RealType >
KOKKOS_INLINE_FUNCTION complex<RealType> Kokkos::operator+ ( const complex< RealType > &  x)

Unary + operator for complex.

Definition at line 341 of file Kokkos_Complex.hpp.

◆ operator-() [1/2]

template<class RealType >
KOKKOS_INLINE_FUNCTION complex<RealType> Kokkos::operator- ( const complex< RealType > &  x,
const complex< RealType > &  y 
)

Binary - operator for complex.

Definition at line 349 of file Kokkos_Complex.hpp.

◆ operator-() [2/2]

template<class RealType >
KOKKOS_INLINE_FUNCTION complex<RealType> Kokkos::operator- ( const complex< RealType > &  x)

Unary - operator for complex.

Definition at line 357 of file Kokkos_Complex.hpp.

◆ operator*() [1/3]

template<class RealType >
KOKKOS_INLINE_FUNCTION complex<RealType> Kokkos::operator* ( const complex< RealType > &  x,
const complex< RealType > &  y 
)

Binary * operator for complex.

Definition at line 365 of file Kokkos_Complex.hpp.

◆ operator*() [2/3]

template<class RealType >
complex<RealType> Kokkos::operator* ( const std::complex< RealType > &  x,
const complex< RealType > &  y 
)

Binary * operator for std::complex and complex.

This function exists because GCC 4.7.2 (and perhaps other compilers) are not able to deduce that they can multiply std::complex by Kokkos::complex, by first converting std::complex to Kokkos::complex.

This function cannot be called in a CUDA device function, because std::complex's methods and nonmember functions are not marked as CUDA device functions.

Definition at line 382 of file Kokkos_Complex.hpp.

◆ operator*() [3/3]

template<class RealType >
KOKKOS_INLINE_FUNCTION complex<RealType> Kokkos::operator* ( const RealType &  x,
const complex< RealType > &  y 
)

Binary * operator for RealType times complex.

This function exists because the compiler doesn't know that RealType and complex<RealType> commute with respect to operator*.

Definition at line 394 of file Kokkos_Complex.hpp.

◆ imag()

template<class RealType >
KOKKOS_INLINE_FUNCTION RealType Kokkos::imag ( const complex< RealType > &  x)

Imaginary part of a complex number.

Definition at line 402 of file Kokkos_Complex.hpp.

◆ real()

template<class RealType >
KOKKOS_INLINE_FUNCTION RealType Kokkos::real ( const complex< RealType > &  x)

Real part of a complex number.

Definition at line 409 of file Kokkos_Complex.hpp.

◆ abs()

template<class RealType >
KOKKOS_INLINE_FUNCTION RealType Kokkos::abs ( const complex< RealType > &  x)

Absolute value (magnitude) of a complex number.

Definition at line 416 of file Kokkos_Complex.hpp.

◆ conj()

template<class RealType >
KOKKOS_INLINE_FUNCTION complex<RealType> Kokkos::conj ( const complex< RealType > &  x)

Conjugate of a complex number.

Definition at line 424 of file Kokkos_Complex.hpp.

◆ operator/() [1/2]

template<class RealType1 , class RealType2 >
KOKKOS_INLINE_FUNCTION complex<RealType1> Kokkos::operator/ ( const complex< RealType1 > &  x,
const RealType2 &  y 
)

Binary operator / for complex and real numbers.

Definition at line 433 of file Kokkos_Complex.hpp.

◆ operator/() [2/2]

template<class RealType >
KOKKOS_INLINE_FUNCTION complex<RealType> Kokkos::operator/ ( const complex< RealType > &  x,
const complex< RealType > &  y 
)

Binary operator / for complex.

Definition at line 441 of file Kokkos_Complex.hpp.

◆ operator==() [1/5]

template<class RealType >
KOKKOS_INLINE_FUNCTION bool Kokkos::operator== ( const complex< RealType > &  x,
const complex< RealType > &  y 
)

Equality operator for two complex numbers.

Definition at line 467 of file Kokkos_Complex.hpp.

◆ operator==() [2/5]

template<class RealType >
KOKKOS_INLINE_FUNCTION bool Kokkos::operator== ( const std::complex< RealType > &  x,
const complex< RealType > &  y 
)

Equality operator for std::complex and Kokkos::complex.

Definition at line 474 of file Kokkos_Complex.hpp.

◆ operator==() [3/5]

template<class RealType1 , class RealType2 >
KOKKOS_INLINE_FUNCTION bool Kokkos::operator== ( const complex< RealType1 > &  x,
const RealType2 &  y 
)

Equality operator for complex and real number.

Definition at line 481 of file Kokkos_Complex.hpp.

◆ operator==() [4/5]

template<class RealType >
KOKKOS_INLINE_FUNCTION bool Kokkos::operator== ( const RealType &  x,
const complex< RealType > &  y 
)

Equality operator for real and complex number.

Definition at line 488 of file Kokkos_Complex.hpp.

◆ operator!=() [1/5]

template<class RealType >
KOKKOS_INLINE_FUNCTION bool Kokkos::operator!= ( const complex< RealType > &  x,
const complex< RealType > &  y 
)

Inequality operator for two complex numbers.

Definition at line 495 of file Kokkos_Complex.hpp.

◆ operator!=() [2/5]

template<class RealType >
KOKKOS_INLINE_FUNCTION bool Kokkos::operator!= ( const std::complex< RealType > &  x,
const complex< RealType > &  y 
)

Inequality operator for std::complex and Kokkos::complex.

Definition at line 502 of file Kokkos_Complex.hpp.

◆ operator!=() [3/5]

template<class RealType1 , class RealType2 >
KOKKOS_INLINE_FUNCTION bool Kokkos::operator!= ( const complex< RealType1 > &  x,
const RealType2 &  y 
)

Inequality operator for complex and real number.

Definition at line 509 of file Kokkos_Complex.hpp.

◆ operator!=() [4/5]

template<class RealType >
KOKKOS_INLINE_FUNCTION bool Kokkos::operator!= ( const RealType &  x,
const complex< RealType > &  y 
)

Inequality operator for real and complex number.

Definition at line 516 of file Kokkos_Complex.hpp.

◆ finalize()

void Kokkos::finalize ( )

Finalize the spaces that were initialized via Kokkos::initialize.

◆ finalize_all()

void Kokkos::finalize_all ( )

Finalize all known execution spaces.

◆ TeamThreadRange() [1/2]

template<typename iType , class TeamMemberType >
KOKKOS_INLINE_FUNCTION Impl::TeamThreadRangeBoundariesStruct<iType,TeamMemberType> Kokkos::TeamThreadRange ( const TeamMemberType &  ,
const iType &  count 
)

Execution policy for parallel work over a threads within a team.

The range is split over all threads in a team. The Mapping scheme depends on the architecture. This policy is used together with a parallel pattern as a nested layer within a kernel launched with the TeamPolicy. This variant expects a single count. So the range is (0,count].

◆ TeamThreadRange() [2/2]

template<typename iType1 , typename iType2 , class TeamMemberType >
KOKKOS_INLINE_FUNCTION Impl::TeamThreadRangeBoundariesStruct<typename std::common_type<iType1, iType2>::type, TeamMemberType> Kokkos::TeamThreadRange ( const TeamMemberType &  ,
const iType1 &  begin,
const iType2 &  end 
)

Execution policy for parallel work over a threads within a team.

The range is split over all threads in a team. The Mapping scheme depends on the architecture. This policy is used together with a parallel pattern as a nested layer within a kernel launched with the TeamPolicy. This variant expects a begin and end. So the range is (begin,end].

◆ ThreadVectorRange()

template<typename iType , class TeamMemberType >
KOKKOS_INLINE_FUNCTION Impl::ThreadVectorRangeBoundariesStruct<iType,TeamMemberType> Kokkos::ThreadVectorRange ( const TeamMemberType &  ,
const iType &  count 
)

Execution policy for a vector parallel loop.

The range is split over all vector lanes in a thread. The Mapping scheme depends on the architecture. This policy is used together with a parallel pattern as a nested layer within a kernel launched with the TeamPolicy. This variant expects a single count. So the range is (0,count].

◆ operator==() [5/5]

template<class T1 , class T2 >
KOKKOS_FORCEINLINE_FUNCTION bool Kokkos::operator== ( const pair< T1, T2 > &  lhs,
const pair< T1, T2 > &  rhs 
)

Equality operator for Kokkos::pair.

Definition at line 364 of file Kokkos_Pair.hpp.

◆ operator!=() [5/5]

template<class T1 , class T2 >
KOKKOS_FORCEINLINE_FUNCTION bool Kokkos::operator!= ( const pair< T1, T2 > &  lhs,
const pair< T1, T2 > &  rhs 
)

Inequality operator for Kokkos::pair.

Definition at line 370 of file Kokkos_Pair.hpp.

◆ operator<()

template<class T1 , class T2 >
KOKKOS_FORCEINLINE_FUNCTION bool Kokkos::operator< ( const pair< T1, T2 > &  lhs,
const pair< T1, T2 > &  rhs 
)

Less-than operator for Kokkos::pair.

Definition at line 376 of file Kokkos_Pair.hpp.

◆ operator<=()

template<class T1 , class T2 >
KOKKOS_FORCEINLINE_FUNCTION bool Kokkos::operator<= ( const pair< T1, T2 > &  lhs,
const pair< T1, T2 > &  rhs 
)

Less-than-or-equal-to operator for Kokkos::pair.

Definition at line 382 of file Kokkos_Pair.hpp.

◆ operator>()

template<class T1 , class T2 >
KOKKOS_FORCEINLINE_FUNCTION bool Kokkos::operator> ( const pair< T1, T2 > &  lhs,
const pair< T1, T2 > &  rhs 
)

Greater-than operator for Kokkos::pair.

Definition at line 388 of file Kokkos_Pair.hpp.

◆ operator>=()

template<class T1 , class T2 >
KOKKOS_FORCEINLINE_FUNCTION bool Kokkos::operator>= ( const pair< T1, T2 > &  lhs,
const pair< T1, T2 > &  rhs 
)

Greater-than-or-equal-to operator for Kokkos::pair.

Definition at line 394 of file Kokkos_Pair.hpp.

◆ make_pair()

template<class T1 , class T2 >
KOKKOS_FORCEINLINE_FUNCTION pair<T1,T2> Kokkos::make_pair ( T1  x,
T2  y 
)

Return a new pair.

This is a "nonmember constructor" for Kokkos::pair. It works just like std::make_pair.

Definition at line 403 of file Kokkos_Pair.hpp.

◆ tie()

template<class T1 , class T2 >
KOKKOS_FORCEINLINE_FUNCTION pair<T1 &,T2 &> Kokkos::tie ( T1 &  x,
T2 &  y 
)

Return a pair of references to the input arguments.

This compares to std::tie (new in C++11). You can use it to assign to two variables at once, from the result of a function that returns a pair. For example (__device__ and __host__ attributes omitted for brevity):

// Declaration of the function to call.
// First return value: operation count.
// Second return value: whether all operations succeeded.
Kokkos::pair<int, bool> someFunction ();
// Code that uses Kokkos::tie.
int myFunction () {
int count = 0;
bool success = false;
// This assigns to both count and success.
Kokkos::tie (count, success) = someFunction ();
if (! success) {
// ... Some operation failed;
// take corrective action ...
}
return count;
}

The line that uses tie() could have been written like this:

Kokkos::pair<int, bool> result = someFunction ();
count = result.first;
success = result.second;

Using tie() saves two lines of code and avoids a copy of each element of the pair. The latter could be significant if one or both elements of the pair are more substantial objects than int or bool.

Definition at line 447 of file Kokkos_Pair.hpp.

◆ parallel_for()

template<class ExecPolicy , class FunctorType >
void Kokkos::parallel_for ( const ExecPolicy &  policy,
const FunctorType &  functor,
const std::string &  str = "",
typename Impl::enable_if< ! Impl::is_integral< ExecPolicy >::value >::type *  = 0 
)
inline

Execute functor in parallel according to the execution policy.

A "functor" is a class containing the function to execute in parallel, data needed for that execution, and an optional execution_space typedef. Here is an example functor for parallel_for:

class FunctorType {
public:
typedef ... execution_space ;
void operator() ( WorkType iwork ) const ;
};

In the above example, WorkType is any integer type for which a valid conversion from size_t to IntType exists. Its operator() method defines the operation to parallelize, over the range of integer indices iwork=[0,work_count-1]. This compares to a single iteration iwork of a for loop. If execution_space is not defined DefaultExecutionSpace will be used.

Definition at line 172 of file Kokkos_Parallel.hpp.

◆ parallel_reduce()

template<class PolicyType , class FunctorType , class ReturnType >
void Kokkos::parallel_reduce ( const std::string &  label,
const PolicyType &  policy,
const FunctorType &  functor,
ReturnType &  return_value,
typename Impl::enable_if< Kokkos::Impl::is_execution_policy< PolicyType >::value >::type *  = 0 
)
inline

Parallel reduction.

parallel_reduce performs parallel reductions with arbitrary functions - i.e. it is not solely data based. The call expects up to 4 arguments:

Example of a parallel_reduce functor for a POD (plain old data) value type:

class FunctorType { // For POD value type
public:
typedef ... execution_space ;
typedef <podType> value_type ;
void operator()( <intType> iwork , <podType> & update ) const ;
void init( <podType> & update ) const ;
void join( volatile <podType> & update ,
volatile const <podType> & input ) const ;
typedef true_type has_final ;
void final( <podType> & update ) const ;
};

Example of a parallel_reduce functor for an array of POD (plain old data) values:

class FunctorType { // For array of POD value
public:
typedef ... execution_space ;
typedef <podType> value_type[] ;
void operator()( <intType> , <podType> update[] ) const ;
void init( <podType> update[] ) const ;
void join( volatile <podType> update[] ,
volatile const <podType> input[] ) const ;
typedef true_type has_final ;
void final( <podType> update[] ) const ;
};

Definition at line 1179 of file Kokkos_Parallel_Reduce.hpp.

◆ view_alloc()

template<class ... Args>
Impl::ViewCtorProp< typename Impl::ViewCtorProp< void , Args >::type ... > Kokkos::view_alloc ( Args const &...  args)
inline

Create View allocation parameter bundle from argument list.

Valid argument list members are: 1) label as a "string" or std::string 2) memory space instance of the View::memory_space type 3) execution space instance compatible with the View::memory_space 4) Kokkos::WithoutInitializing to bypass initialization 4) Kokkos::AllowPadding to allow allocation to pad dimensions for memory alignment

Definition at line 405 of file Kokkos_View.hpp.

◆ rank()

template<typename D , class ... P>
KOKKOS_INLINE_FUNCTION constexpr unsigned Kokkos::rank ( const View< D, P... > &  V)

Temporary free function rank() until rank() is implemented in the View.

Definition at line 1580 of file Kokkos_View.hpp.

◆ deep_copy() [1/8]

template<class DT , class ... DP>
void Kokkos::deep_copy ( const View< DT, DP... > &  dst,
typename ViewTraits< DT, DP... >::const_value_type &  value,
typename std::enable_if< std::is_same< typename ViewTraits< DT, DP... >::specialize, void >::value >::type *  = 0 
)
inline

Deep copy a value from Host memory into a view.

Definition at line 1812 of file Kokkos_View.hpp.

◆ deep_copy() [2/8]

template<class ST , class ... SP>
void Kokkos::deep_copy ( typename ViewTraits< ST, SP... >::non_const_value_type &  dst,
const View< ST, SP... > &  src,
typename std::enable_if< std::is_same< typename ViewTraits< ST, SP... >::specialize, void >::value >::type *  = 0 
)
inline

Deep copy into a value in Host memory from a view.

Definition at line 1830 of file Kokkos_View.hpp.

◆ deep_copy() [3/8]

template<class DT , class ... DP, class ST , class ... SP>
void Kokkos::deep_copy ( const View< DT, DP... > &  dst,
const View< ST, SP... > &  src,
typename std::enable_if<(std::is_same< typename ViewTraits< DT, DP... >::specialize, void >::value &&std::is_same< typename ViewTraits< ST, SP... >::specialize, void >::value &&(unsigned(ViewTraits< DT, DP... >::rank)==unsigned(0) &&unsigned(ViewTraits< ST, SP... >::rank)==unsigned(0)))>::type *  = 0 
)
inline

A deep copy between views of compatible type, and rank zero.

Definition at line 1849 of file Kokkos_View.hpp.

◆ deep_copy() [4/8]

template<class DT , class ... DP, class ST , class ... SP>
void Kokkos::deep_copy ( const View< DT, DP... > &  dst,
const View< ST, SP... > &  src,
typename std::enable_if<(std::is_same< typename ViewTraits< DT, DP... >::specialize, void >::value &&std::is_same< typename ViewTraits< ST, SP... >::specialize, void >::value &&(unsigned(ViewTraits< DT, DP... >::rank) !=0||unsigned(ViewTraits< ST, SP... >::rank) !=0))>::type *  = 0 
)
inline

A deep copy between views of the default specialization, compatible type, same non-zero rank, same contiguous layout.

Definition at line 1882 of file Kokkos_View.hpp.

◆ deep_copy() [5/8]

template<class ExecSpace , class DT , class ... DP>
void Kokkos::deep_copy ( const ExecSpace &  ,
const View< DT, DP... > &  dst,
typename ViewTraits< DT, DP... >::const_value_type &  value,
typename std::enable_if< Kokkos::Impl::is_execution_space< ExecSpace >::value &&std::is_same< typename ViewTraits< DT, DP... >::specialize, void >::value >::type *  = 0 
)
inline

Deep copy a value from Host memory into a view.

Definition at line 2019 of file Kokkos_View.hpp.

◆ deep_copy() [6/8]

template<class ExecSpace , class ST , class ... SP>
void Kokkos::deep_copy ( const ExecSpace &  exec_space,
typename ViewTraits< ST, SP... >::non_const_value_type &  dst,
const View< ST, SP... > &  src,
typename std::enable_if< Kokkos::Impl::is_execution_space< ExecSpace >::value &&std::is_same< typename ViewTraits< ST, SP... >::specialize, void >::value >::type *  = 0 
)
inline

Deep copy into a value in Host memory from a view.

Definition at line 2039 of file Kokkos_View.hpp.

◆ deep_copy() [7/8]

template<class ExecSpace , class DT , class ... DP, class ST , class ... SP>
void Kokkos::deep_copy ( const ExecSpace &  exec_space,
const View< DT, DP... > &  dst,
const View< ST, SP... > &  src,
typename std::enable_if<(Kokkos::Impl::is_execution_space< ExecSpace >::value &&std::is_same< typename ViewTraits< DT, DP... >::specialize, void >::value &&std::is_same< typename ViewTraits< ST, SP... >::specialize, void >::value &&(unsigned(ViewTraits< DT, DP... >::rank)==unsigned(0) &&unsigned(ViewTraits< ST, SP... >::rank)==unsigned(0)))>::type *  = 0 
)
inline

A deep copy between views of compatible type, and rank zero.

Definition at line 2061 of file Kokkos_View.hpp.

◆ deep_copy() [8/8]

template<class ExecSpace , class DT , class ... DP, class ST , class ... SP>
void Kokkos::deep_copy ( const ExecSpace &  exec_space,
const View< DT, DP... > &  dst,
const View< ST, SP... > &  src,
typename std::enable_if<(Kokkos::Impl::is_execution_space< ExecSpace >::value &&std::is_same< typename ViewTraits< DT, DP... >::specialize, void >::value &&std::is_same< typename ViewTraits< ST, SP... >::specialize, void >::value &&(unsigned(ViewTraits< DT, DP... >::rank) !=0||unsigned(ViewTraits< ST, SP... >::rank) !=0))>::type *  = 0 
)
inline

A deep copy between views of the default specialization, compatible type, same non-zero rank, same contiguous layout.

Definition at line 2097 of file Kokkos_View.hpp.

◆ resize() [1/2]

template<class T , class ... P>
std::enable_if< std::is_same<typename Kokkos::View<T,P...>::array_layout,Kokkos::LayoutLeft>::value || std::is_same<typename Kokkos::View<T,P...>::array_layout,Kokkos::LayoutRight>::value>::type Kokkos::resize ( Kokkos::View< T, P... > &  v,
const size_t  n0 = 0,
const size_t  n1 = 0,
const size_t  n2 = 0,
const size_t  n3 = 0,
const size_t  n4 = 0,
const size_t  n5 = 0,
const size_t  n6 = 0,
const size_t  n7 = 0 
)
inline

Resize a view with copying old data to new data at the corresponding indices.

Definition at line 2358 of file Kokkos_View.hpp.

◆ resize() [2/2]

template<class T , class ... P>
void Kokkos::resize ( Kokkos::View< T, P... > &  v,
const typename Kokkos::View< T, P... >::array_layout &  layout 
)
inline

Resize a view with copying old data to new data at the corresponding indices.

Definition at line 2382 of file Kokkos_View.hpp.

◆ realloc() [1/2]

template<class T , class ... P>
std::enable_if< std::is_same<typename Kokkos::View<T,P...>::array_layout,Kokkos::LayoutLeft>::value || std::is_same<typename Kokkos::View<T,P...>::array_layout,Kokkos::LayoutRight>::value>::type Kokkos::realloc ( Kokkos::View< T, P... > &  v,
const size_t  n0 = 0,
const size_t  n1 = 0,
const size_t  n2 = 0,
const size_t  n3 = 0,
const size_t  n4 = 0,
const size_t  n5 = 0,
const size_t  n6 = 0,
const size_t  n7 = 0 
)
inline

Resize a view with discarding old data.

Definition at line 2403 of file Kokkos_View.hpp.

◆ realloc() [2/2]

template<class T , class ... P>
void Kokkos::realloc ( Kokkos::View< T, P... > &  v,
const typename Kokkos::View< T, P... >::array_layout &  layout 
)
inline

Resize a view with discarding old data.

Definition at line 2426 of file Kokkos_View.hpp.