Kokkos Core Kernels Package
Version of the Day
|
Kokkos device for non-parallel execution. More...
#include <Kokkos_Serial.hpp>
Public Types | |
Type declarations that all Kokkos devices must provide. | |
typedef Serial | execution_space |
Tag this class as an execution space: More... | |
typedef HostSpace::size_type | size_type |
The size_type typedef best suited for this device. More... | |
typedef HostSpace | memory_space |
This device's preferred memory space. More... | |
typedef LayoutRight | array_layout |
This device's preferred array layout. More... | |
typedef ScratchMemorySpace < Kokkos::Serial > | scratch_memory_space |
Scratch memory space. More... | |
typedef Serial | device_type |
For backward compatibility: More... | |
Static Public Member Functions | |
static int | in_parallel () |
True if and only if this method is being called in a thread-parallel function. More... | |
static bool | sleep () |
Set the device in a "sleep" state. More... | |
static bool | wake () |
Wake the device from the 'sleep' state so it is ready for work. More... | |
static void | fence () |
Wait until all dispatched functors complete. More... | |
static void | finalize () |
Free any resources being consumed by the device. More... | |
static void | print_configuration (std::ostream &, const bool detail=false) |
Print configuration information to the given output stream. More... | |
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 75 of file Kokkos_Serial.hpp.
Tag this class as an execution space:
Definition at line 81 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 83 of file Kokkos_Serial.hpp.
This device's preferred memory space.
Definition at line 85 of file Kokkos_Serial.hpp.
This device's preferred array layout.
Definition at line 87 of file Kokkos_Serial.hpp.
Scratch memory space.
Definition at line 90 of file Kokkos_Serial.hpp.
typedef Serial Kokkos::Serial::device_type |
For backward compatibility:
Definition at line 93 of file Kokkos_Serial.hpp.
|
inlinestatic |
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 103 of file Kokkos_Serial.hpp.
|
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.
|
static |
Wake the device from the 'sleep' state so it is ready for work.
|
inlinestatic |
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 131 of file Kokkos_Serial.hpp.
|
inlinestatic |
Free any resources being consumed by the device.
Definition at line 146 of file Kokkos_Serial.hpp.
|
static |
Print configuration information to the given output stream.