Kokkos Core Kernels Package Version of the Day
Static Public Member Functions
Kokkos::Serial Class Reference

Kokkos device for non-parallel execution. More...

#include <Kokkos_Serial.hpp>

List of all members.

Public Types

Type declarations that all Kokkos devices must provide.
typedef Impl::DeviceTag kokkos_tag
 The tag (what type of kokkos_object is this).
typedef Serial device_type
 The device type (same as this class).
typedef HostSpace::size_type size_type
 The size_type typedef best suited for this device.
typedef HostSpace memory_space
 This device's preferred memory space.
typedef Serial scratch_memory_space
typedef LayoutRight array_layout
 This device's preferred array layout.
typedef Serial host_mirror_device_type
 This device's host mirror type.

Static Public Member Functions

static int in_parallel ()
 True if and only if this method is being called in a thread-parallel function.
static bool sleep ()
 Set the device in a "sleep" state.
static bool wake ()
 Wake the device from the 'sleep' state so it is ready for work.
static void fence ()
 Wait until all dispatched functors complete.
static void finalize ()
 Free any resources being consumed by the device.
static void print_configuration (std::ostream &, const bool detail=false)
 Print configuration information to the given output stream.

Detailed Description

Kokkos device for non-parallel execution.

A "device" represents a parallel execution model. It tells Kokkos how to parallelize the execution of kernels in a parallel_for or parallel_reduce. For example, the Threads device uses Pthreads or C++11 threads on a CPU, the OpenMP device uses the OpenMP language extensions, and the Cuda device uses NVIDIA's CUDA programming model. The Serial device executes "parallel" kernels sequentially. This is useful if you really do not want to use threads, or if you want to explore different combinations of MPI and shared-memory parallel programming models.

Definition at line 74 of file Kokkos_Serial.hpp.


Member Typedef Documentation

typedef Impl::DeviceTag Kokkos::Serial::kokkos_tag

The tag (what type of kokkos_object is this).

Definition at line 80 of file Kokkos_Serial.hpp.

The device type (same as this class).

Definition at line 82 of file Kokkos_Serial.hpp.

typedef HostSpace::size_type Kokkos::Serial::size_type

The size_type typedef best suited for this device.

Definition at line 84 of file Kokkos_Serial.hpp.

This device's preferred memory space.

Definition at line 86 of file Kokkos_Serial.hpp.

This device's preferred array layout.

Definition at line 89 of file Kokkos_Serial.hpp.

This device's host mirror type.

Serial is a host device, so the host mirror type is the same as the device type itself.

Definition at line 94 of file Kokkos_Serial.hpp.


Member Function Documentation

static int Kokkos::Serial::in_parallel ( ) [inline, static]

True if and only if this method is being called in a thread-parallel function.

For the Serial device, this method always returns false, because parallel_for or parallel_reduce with the Serial device always execute sequentially.

Definition at line 104 of file Kokkos_Serial.hpp.

static bool Kokkos::Serial::sleep ( ) [static]

Set the device in a "sleep" state.

This function sets the device in a "sleep" state in which it is not ready for work. This may consume less resources than if the device were in an "awake" state, but it may also take time to bring the device from a sleep state to be ready for work.

Returns:
True if the device is in the "sleep" state, else false if the device is actively working and could not enter the "sleep" state.
static bool Kokkos::Serial::wake ( ) [static]

Wake the device from the 'sleep' state so it is ready for work.

Returns:
True if the device is in the "ready" state, else "false" if the device is actively working (which also means that it's awake).
static void Kokkos::Serial::fence ( ) [inline, static]

Wait until all dispatched functors complete.

The parallel_for or parallel_reduce dispatch of a functor may return asynchronously, before the functor completes. This method does not return until all dispatched functors on this device have completed.

Definition at line 132 of file Kokkos_Serial.hpp.

static void Kokkos::Serial::finalize ( ) [inline, static]

Free any resources being consumed by the device.

Definition at line 142 of file Kokkos_Serial.hpp.

static void Kokkos::Serial::print_configuration ( std::ostream &  ,
const bool  detail = false 
) [static]

Print configuration information to the given output stream.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends