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

Namespaces

namespace  hwloc
 

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


Classes

class  CrsArray
 Compressed row storage array. More...
class  RangePolicy
 Execution policy for work over a range of an integral type. More...
class  TeamPolicy
 Execution policy for parallel work over a league of teams of threads. More...
class  TeamVectorPolicy
 Execution policy for parallel work over a league of teams of threads with explicit vector support. More...
class  HostSpace
 Memory management on the host for devices. 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  ScratchMemorySpace
 Scratch memory space associated with an execution space. More...
class  Serial
 Kokkos device for non-parallel execution. More...
class  Future
class  TaskPolicy
 If the argument is an execution space then a serial task in that space. More...
class  ViewTraits
 Traits class for accessing attributes of a View. More...
class  Bitset
 A thread safe view to a bitset. More...
class  ConstBitset
class  StaticCrsGraph
 Compressed row storage array. More...
class  UnorderedMapInsertResult
 First element of the return value of UnorderedMap::insert(). More...
class  UnorderedMap
 Thread-safe, performance-portable lookup table. More...
class  SparseRowView
 View of a row of a sparse matrix. More...
class  SparseRowViewConst
 Const view of a row of a sparse matrix. More...
class  CrsMatrix
 Compressed sparse row implementation of a sparse matrix. More...

Enumerations

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

Functions

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.
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.
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.
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.
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.
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.
template<class T1 , class T2 >
KOKKOS_FORCEINLINE_FUNCTION
pair< T1, T2 > 
make_pair (T1 x, T2 y)
 Return a new pair.
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.
template<class ExecPolicy , class FunctorType >
void parallel_for (const ExecPolicy &policy, const FunctorType &functor, typename Impl::enable_if< !Impl::is_integral< ExecPolicy >::value >::type *=0)
 Execute functor in parallel according to the execution policy.
template<class ExecPolicy , class FunctorType >
void parallel_reduce (const ExecPolicy &policy, const FunctorType &functor, typename Impl::enable_if< !Impl::is_integral< ExecPolicy >::value >::type *=0)
 Parallel reduction.
template<class DT , class DL , class DD , class DM , class DS >
void deep_copy (const View< DT, DL, DD, DM, DS > &dst, typename Impl::enable_if<(Impl::is_same< typename ViewTraits< DT, DL, DD, DM >::non_const_value_type, typename ViewTraits< DT, DL, DD, DM >::value_type >::value), typename ViewTraits< DT, DL, DD, DM >::const_value_type >::type &value)
 Deep copy a value into a view.
template<class DT , class DL , class DD , class DM , class DS , class ST , class SL , class SD , class SM , class SS >
void deep_copy (const View< DT, DL, DD, DM, DS > &dst, const View< ST, SL, SD, SM, SS > &src, typename Impl::enable_if<(Impl::is_same< typename View< DT, DL, DD, DM, DS >::value_type, typename View< ST, SL, SD, SM, SS >::non_const_value_type >::value &&(unsigned(View< DT, DL, DD, DM, DS >::rank)==unsigned(0))&&(unsigned(View< ST, SL, SD, SM, SS >::rank)==unsigned(0)))>::type *=0)
 A deep copy between views of compatible type, and rank zero.
template<class DT , class DL , class DD , class DM , class ST , class SL , class SD , class SM >
void deep_copy (const View< DT, DL, DD, DM, Impl::ViewDefault > &dst, const View< ST, SL, SD, SM, Impl::ViewDefault > &src, typename Impl::enable_if<(Impl::is_same< typename View< DT, DL, DD, DM, Impl::ViewDefault >::value_type, typename View< ST, SL, SD, SM, Impl::ViewDefault >::non_const_value_type >::value &&(unsigned(View< DT, DL, DD, DM, Impl::ViewDefault >::rank)==unsigned(View< ST, SL, SD, SM, Impl::ViewDefault >::rank))&&(0< unsigned(View< DT, DL, DD, DM, Impl::ViewDefault >::rank))&&Impl::is_same< typename View< DT, DL, DD, DM, Impl::ViewDefault >::array_layout, typename View< ST, SL, SD, SM, Impl::ViewDefault >::array_layout >::value)>::type *=0)
 A deep copy between views of the default specialization, compatible type, same non-zero rank, same contiguous layout.
template<class DT , class DL , class DD , class DM , class DS , class ST , class SL , class SD , class SM , class SS >
void deep_copy (const View< DT, DL, DD, DM, DS > &dst, const View< ST, SL, SD, SM, SS > &src, const typename Impl::enable_if<(Impl::is_same< typename View< DT, DL, DD, DM, DS >::value_type, typename View< DT, DL, DD, DM, DS >::non_const_value_type >::value &&Impl::VerifyExecutionCanAccessMemorySpace< typename View< DT, DL, DD, DM, DS >::memory_space, typename View< ST, SL, SD, SM, SS >::memory_space >::value &&(unsigned(View< DT, DL, DD, DM, DS >::rank)==unsigned(View< ST, SL, SD, SM, SS >::rank))&&(0< unsigned(View< DT, DL, DD, DM, DS >::rank))&&((!Impl::is_same< typename View< DT, DL, DD, DM, DS >::array_layout, typename View< ST, SL, SD, SM, SS >::array_layout >::value)||(!Impl::is_same< DS, SS >::value)))>::type *=0)
 Deep copy equal dimension arrays in the same space which have different layouts or specializations.
template<class T , class L , class D , class M , class S >
void resize (View< T, L, D, M, S > &v, const typename Impl::enable_if< ViewTraits< T, L, D, M >::is_managed, size_t >::type n0, 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.
template<class T , class L , class D , class M , class S >
void realloc (View< T, L, D, M, S > &v, const typename Impl::enable_if< ViewTraits< T, L, D, M >::is_managed, size_t >::type n0, 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)
 Reallocate a view without copying old data to new data.
template<typename T , class RangeVector , class CrsMatrix , class DomainVector >
bool MV_Multiply_DoMKL (typename Kokkos::Impl::enable_if< !Kokkos::Impl::is_same< T, double >::value &&!Kokkos::Impl::is_same< T, float >::value, typename RangeVector::value_type >::type s_b, const RangeVector &y, typename DomainVector::value_type s_a, const CrsMatrix &A, const DomainVector &x)
 Attempt to compute y = s_a * A * x using Intel MKL.

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

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 64 of file Kokkos_MemoryTraits.hpp.


Function Documentation

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 291 of file Kokkos_Pair.hpp.

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 297 of file Kokkos_Pair.hpp.

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 303 of file Kokkos_Pair.hpp.

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 309 of file Kokkos_Pair.hpp.

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 315 of file Kokkos_Pair.hpp.

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 321 of file Kokkos_Pair.hpp.

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 330 of file Kokkos_Pair.hpp.

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 374 of file Kokkos_Pair.hpp.

template<class ExecPolicy , class FunctorType >
void Kokkos::parallel_for ( const ExecPolicy &  policy,
const FunctorType &  functor,
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 device_type typedef. Here is an example functor for parallel_for:

  class FunctorType {
  public:
    typedef  ...  device_type ;
    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 device_type is not defined DefaultExecutionSpace will be used.

Definition at line 184 of file Kokkos_Parallel.hpp.

template<class ExecPolicy , class FunctorType >
void Kokkos::parallel_reduce ( const ExecPolicy &  policy,
const FunctorType &  functor,
typename Impl::enable_if< !Impl::is_integral< ExecPolicy >::value >::type *  = 0 
) [inline]

Parallel reduction.

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

  class FunctorType { // For POD value type
  public:
    typedef    ...     device_type ;
    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    ...     device_type ;
    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 247 of file Kokkos_Parallel.hpp.

template<class DT , class DL , class DD , class DM , class DS >
void Kokkos::deep_copy ( const View< DT, DL, DD, DM, DS > &  dst,
typename Impl::enable_if<(Impl::is_same< typename ViewTraits< DT, DL, DD, DM >::non_const_value_type, typename ViewTraits< DT, DL, DD, DM >::value_type >::value), typename ViewTraits< DT, DL, DD, DM >::const_value_type >::type &  value 
) [inline]

Deep copy a value into a view.

Definition at line 1212 of file Kokkos_View.hpp.

template<class DT , class DL , class DD , class DM , class DS , class ST , class SL , class SD , class SM , class SS >
void Kokkos::deep_copy ( const View< DT, DL, DD, DM, DS > &  dst,
const View< ST, SL, SD, SM, SS > &  src,
typename Impl::enable_if<(Impl::is_same< typename View< DT, DL, DD, DM, DS >::value_type, typename View< ST, SL, SD, SM, SS >::non_const_value_type >::value &&(unsigned(View< DT, DL, DD, DM, DS >::rank)==unsigned(0))&&(unsigned(View< ST, SL, SD, SM, SS >::rank)==unsigned(0)))>::type *  = 0 
) [inline]

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

Definition at line 1237 of file Kokkos_View.hpp.

template<class DT , class DL , class DD , class DM , class ST , class SL , class SD , class SM >
void Kokkos::deep_copy ( const View< DT, DL, DD, DM, Impl::ViewDefault > &  dst,
const View< ST, SL, SD, SM, Impl::ViewDefault > &  src 
) [inline]

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

Definition at line 1268 of file Kokkos_View.hpp.

template<class DT , class DL , class DD , class DM , class DS , class ST , class SL , class SD , class SM , class SS >
void Kokkos::deep_copy ( const View< DT, DL, DD, DM, DS > &  dst,
const View< ST, SL, SD, SM, SS > &  src 
) [inline]

Deep copy equal dimension arrays in the same space which have different layouts or specializations.

Definition at line 1327 of file Kokkos_View.hpp.

template<class T , class L , class D , class M , class S >
void Kokkos::resize ( View< T, L, D, M, S > &  v,
const typename Impl::enable_if< ViewTraits< T, L, D, M >::is_managed, size_t >::type  n0,
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 1417 of file Kokkos_View.hpp.

template<class T , class L , class D , class M , class S >
void Kokkos::realloc ( View< T, L, D, M, S > &  v,
const typename Impl::enable_if< ViewTraits< T, L, D, M >::is_managed, size_t >::type  n0,
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]

Reallocate a view without copying old data to new data.

Definition at line 1442 of file Kokkos_View.hpp.

template<typename T , class RangeVector , class CrsMatrix , class DomainVector >
bool Kokkos::MV_Multiply_DoMKL ( typename Kokkos::Impl::enable_if< !Kokkos::Impl::is_same< T, double >::value &&!Kokkos::Impl::is_same< T, float >::value, typename RangeVector::value_type >::type  s_b,
const RangeVector &  y,
typename DomainVector::value_type  s_a,
const CrsMatrix &  A,
const DomainVector &  x 
)

Attempt to compute y = s_a * A * x using Intel MKL.

If the given combination of scalar types is not supported, do nothing and return false; otherwise, compute y = s_a * A * x and return true.

Definition at line 60 of file Kokkos_CrsMatrix_MKL.hpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends