Kokkos Core Kernels Package Version of the Day
Kokkos::Cuda Class Reference

Kokkos device that uses CUDA to run on GPUs. More...

#include <Kokkos_Cuda.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 Cuda device_type
 The device type (same as this class).
typedef CudaSpace memory_space
 This device's preferred memory space.
typedef CudaSpace::size_type size_type
 The size_type typedef best suited for this device.
typedef LayoutLeft array_layout
 This device's preferred array layout.
typedef Kokkos::Serial host_mirror_device_type
 This device's host mirror type.

Static Public Member Functions

Functions that all Kokkos devices must implement.
static KOKKOS_INLINE_FUNCTION 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.
Device-specific functions
static void initialize (const SelectDevice=SelectDevice())
 Initialize, telling the CUDA run-time library which device to use.
static void initialize (int device)
static void initialize (int device, int)
static int is_initialized ()
static size_type device_arch ()
 Cuda device architecture of the selected device.
static size_type detect_device_count ()
 Query device count.
static std::vector< unsigned > detect_device_arch ()
 Detect the available devices and their architecture as defined by the __CUDA_ARCH__ specification.
static unsigned team_max ()
static unsigned team_recommended ()

Detailed Description

Kokkos device that uses CUDA to run on GPUs.

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 Serial device executes "parallel" kernels sequentially. The Cuda device uses NVIDIA's CUDA programming model to execute kernels in parallel on GPUs.

Definition at line 90 of file Kokkos_Cuda.hpp.


Member Typedef Documentation

typedef Impl::DeviceTag Kokkos::Cuda::kokkos_tag

The tag (what type of kokkos_object is this).

Definition at line 96 of file Kokkos_Cuda.hpp.

The device type (same as this class).

Definition at line 98 of file Kokkos_Cuda.hpp.

This device's preferred memory space.

Definition at line 100 of file Kokkos_Cuda.hpp.

typedef CudaSpace::size_type Kokkos::Cuda::size_type

The size_type typedef best suited for this device.

Definition at line 102 of file Kokkos_Cuda.hpp.

This device's preferred array layout.

Definition at line 104 of file Kokkos_Cuda.hpp.

This device's host mirror type.

Definition at line 112 of file Kokkos_Cuda.hpp.


Member Function Documentation

static KOKKOS_INLINE_FUNCTION int Kokkos::Cuda::in_parallel ( ) [inline, static]

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

Definition at line 121 of file Kokkos_Cuda.hpp.

static bool Kokkos::Cuda::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::Cuda::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::Cuda::fence ( ) [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.

static void Kokkos::Cuda::finalize ( ) [static]

Free any resources being consumed by the device.

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

Print configuration information to the given output stream.

static void Kokkos::Cuda::initialize ( const SelectDevice  = SelectDevice()) [static]

Initialize, telling the CUDA run-time library which device to use.

static size_type Kokkos::Cuda::device_arch ( ) [static]

Cuda device architecture of the selected device.

This matches the __CUDA_ARCH__ specification.

static size_type Kokkos::Cuda::detect_device_count ( ) [static]

Query device count.

static std::vector<unsigned> Kokkos::Cuda::detect_device_arch ( ) [static]

Detect the available devices and their architecture as defined by the __CUDA_ARCH__ specification.


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