Kokkos::CUDANodeMemoryModel Class Reference

#include <Kokkos_CUDANodeMemoryModel.hpp>

Inherited by Kokkos::ThrustGPUNode.

List of all members.

Public Member Functions

template<class T >
Teuchos::ArrayRCP< T > allocBuffer (size_t size)
 Allocate a parallel buffer, returning it as a pointer ecnapsulated in an ArrayRCP.
template<class T >
void copyFromBuffer (size_t size, const Teuchos::ArrayRCP< const T > &buffSrc, const Teuchos::ArrayView< T > &hostDest)
 Copy data to host memory from a parallel buffer.
template<class T >
void copyToBuffer (size_t size, const Teuchos::ArrayView< const T > &hostSrc, const Teuchos::ArrayRCP< T > &buffDest)
 Copy data to host memory from a parallel buffer.
template<class T >
void copyBuffers (size_t size, const Teuchos::ArrayRCP< const T > &buffSrc, const Teuchos::ArrayRCP< T > &buffDest)
 Copy data between buffers.


Detailed Description

A default implementation of the Node memory architecture for Node with a single memory space.

Definition at line 22 of file Kokkos_CUDANodeMemoryModel.hpp.


Member Function Documentation

template<class T >
Teuchos::ArrayRCP< T > Kokkos::CUDANodeMemoryModel::allocBuffer ( size_t  size  )  [inline]

Allocate a parallel buffer, returning it as a pointer ecnapsulated in an ArrayRCP.

Dereferencing the returned ArrayRCP or its underlying pointer in general results in undefined behavior outside of parallel computations.

The buffer will be automatically freed by the Node when no more references remain.

Template Parameters:
T The data type of the allocate buffer. This is used to perform alignment and determine the number of bytes to allocate.
Parameters:
[in] size The size requested for the parallel buffer, greater than zero.
Postcondition:
The method will return an ArrayRCP encapsulating a pointer. The underlying pointer may be used in parallel computation routines, and is guaranteed to have size large enough to reference size number of entries of type T.

Definition at line 25 of file Kokkos_CUDANodeMemoryModelImpl.hpp.

template<class T >
void Kokkos::CUDANodeMemoryModel::copyFromBuffer ( size_t  size,
const Teuchos::ArrayRCP< const T > &  buffSrc,
const Teuchos::ArrayView< T > &  hostDest 
) [inline]

Copy data to host memory from a parallel buffer.

Parameters:
[in] size The number of entries to copy from buffSrc to hostDest.
[in] buffSrc The parallel buffer from which to copy.
[out] hostDest The location in host memory where the data from buffSrc is copied to.
Precondition:
size is non-negative.
buffSrc has length at least size.
hostDest has length equal to size.
Postcondition:
On return, entries in the range [0 , size) of buffSrc have been copied to hostDest entries in the range [0 , size).

Definition at line 43 of file Kokkos_CUDANodeMemoryModelImpl.hpp.

template<class T >
void Kokkos::CUDANodeMemoryModel::copyToBuffer ( size_t  size,
const Teuchos::ArrayView< const T > &  hostSrc,
const Teuchos::ArrayRCP< T > &  buffDest 
) [inline]

Copy data to host memory from a parallel buffer.

Parameters:
[in] size The number of entries to copy from hostSrc to buffDest.
[in] hostSrc The location in host memory from where the data is copied.
[out] buffDest The parallel buffer to which the data is copied.
Precondition:
size is non-negative.
hostSrc has length equal to size.
buffSrc has length at least size.
Postcondition:
On return, entries in the range [0 , size) of hostSrc are allowed to be written to. The data is guaranteed to be present in buffDest before it is used in a parallel computation.

Definition at line 58 of file Kokkos_CUDANodeMemoryModelImpl.hpp.

template<class T >
void Kokkos::CUDANodeMemoryModel::copyBuffers ( size_t  size,
const Teuchos::ArrayRCP< const T > &  buffSrc,
const Teuchos::ArrayRCP< T > &  buffDest 
) [inline]

Copy data between buffers.

Parameters:
[in] size The size of the copy, greater than zero.
[in] buffSrc The source buffer, with length at least as large as size.
[in,out] buffDest The destination buffer, with length at least as large as size.
Postcondition:
The data is guaranteed to have been copied before any other usage of buffSrc or buffDest occurs.

Definition at line 73 of file Kokkos_CUDANodeMemoryModelImpl.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends
Generated on Wed Apr 13 09:59:49 2011 for Kokkos Node API and Local Linear Algebra Kernels by  doxygen 1.6.3