|
Kokkos Node API and Local Linear Algebra Kernels Version of the Day
|
Kokkos node interface to the ThreadPool threading library. More...
#include <Kokkos_TPINode.hpp>

Public Member Functions | |
| TPINode (Teuchos::ParameterList &plist) | |
| Constructor acceptings a list of parameters. | |
| void | init (int numThreads) |
Thread initialization method. If numThreads is greater than zero, this calls TPI_Init(). If the threads have already been initialized by this node, it first calls TPI_Finalize(). | |
| ~TPINode () | |
| Default destructor calls TPI_Finalize(). TPI_Finalize() is called if the number of initialized threads is greater than zero; otherwise, the destructor has no effect. | |
| void | sync () const |
| No-op for TPINode. | |
| template<class T > | |
| 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 ArrayRCP< const T > &buffSrc, const ArrayView< T > &hostDest) |
| Copy data to host memory from a parallel buffer. | |
| template<class T > | |
| void | copyToBuffer (size_t size, const ArrayView< const T > &hostSrc, const ArrayRCP< T > &buffDest) |
| Copy data to host memory from a parallel buffer. | |
| template<class T > | |
| void | copyBuffers (size_t size, const ArrayRCP< const T > &buffSrc, const ArrayRCP< T > &buffDest) |
| Copy data between buffers. | |
| template<class T > | |
| ArrayRCP< const T > | viewBuffer (size_t size, ArrayRCP< const T > buff) |
| Return a const view of a buffer for use on the host. | |
| template<class T > | |
| ArrayRCP< T > | viewBufferNonConst (ReadWriteOption rw, size_t size, const ArrayRCP< T > &buff) |
| Return a non-const view of a buffer for use on the host. | |
Static Public Member Functions | |
| template<class WDP > | |
| static void | parallel_for (int beg, int end, WDP wd) |
| parallel for skeleton, a wrapper around TPI_Run_threads. See Kokkos Node API | |
| template<class WDP > | |
| static WDP::ReductionType | parallel_reduce (int beg, int end, WDP wd) |
| parallel reduction skeleton, a wrapper around TPI_Run_threads_reduce. See Kokkos Node API | |
Static Public Attributes | |
| static const bool | isHostNode = true |
| Indicates that parallel buffers allocated by this node are available for use on the host thread. | |
Kokkos node interface to the ThreadPool threading library.
Definition at line 134 of file Kokkos_TPINode.hpp.
| Kokkos::TPINode::TPINode | ( | Teuchos::ParameterList & | plist | ) |
Constructor acceptings a list of parameters.
This constructor accepts the parameters:
| Num Threads | [int] Specifies the number of threads, calls TPINode::init(). Throws std::runtime_error if less than zero. Default: 0. |
| Verbose | [int] Non-zero parameter specifies that the constructor is verbose, printing information about the number of threads. Default: 0. |
Definition at line 49 of file Kokkos_TPINode.cpp.
| Kokkos::TPINode::~TPINode | ( | ) |
Default destructor calls TPI_Finalize(). TPI_Finalize() is called if the number of initialized threads is greater than zero; otherwise, the destructor has no effect.
Definition at line 74 of file Kokkos_TPINode.cpp.
| void Kokkos::TPINode::init | ( | int | numThreads | ) |
Thread initialization method. If numThreads is greater than zero, this calls TPI_Init(). If the threads have already been initialized by this node, it first calls TPI_Finalize().
Definition at line 64 of file Kokkos_TPINode.cpp.
| static void Kokkos::TPINode::parallel_for | ( | int | beg, |
| int | end, | ||
| WDP | wd | ||
| ) | [inline, static] |
parallel for skeleton, a wrapper around TPI_Run_threads. See Kokkos Node API
Definition at line 158 of file Kokkos_TPINode.hpp.
| static WDP::ReductionType Kokkos::TPINode::parallel_reduce | ( | int | beg, |
| int | end, | ||
| WDP | wd | ||
| ) | [inline, static] |
parallel reduction skeleton, a wrapper around TPI_Run_threads_reduce. See Kokkos Node API
Definition at line 166 of file Kokkos_TPINode.hpp.
| void Kokkos::TPINode::sync | ( | ) | const [inline] |
No-op for TPINode.
Definition at line 177 of file Kokkos_TPINode.hpp.
| ArrayRCP<T> Kokkos::StandardNodeMemoryModel::allocBuffer | ( | size_t | size | ) | [inline, inherited] |
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.
| T | The data type of the allocate buffer. This is used to perform alignment and determine the number of bytes to allocate. |
| [in] | size | The size requested for the parallel buffer, greater than zero. |
size number of entries of type T. Definition at line 79 of file Kokkos_StandardNodeMemoryModel.hpp.
| void Kokkos::StandardNodeMemoryModel::copyFromBuffer | ( | size_t | size, |
| const ArrayRCP< const T > & | buffSrc, | ||
| const ArrayView< T > & | hostDest | ||
| ) | [inline, inherited] |
Copy data to host memory from a parallel buffer.
| [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. |
size is non-negative. buffSrc has length at least size. hostDest has length equal to size. [0 , size) of buffSrc have been copied to hostDest entries in the range [0 , size). Definition at line 102 of file Kokkos_StandardNodeMemoryModel.hpp.
| void Kokkos::StandardNodeMemoryModel::copyToBuffer | ( | size_t | size, |
| const ArrayView< const T > & | hostSrc, | ||
| const ArrayRCP< T > & | buffDest | ||
| ) | [inline, inherited] |
Copy data to host memory from a parallel buffer.
| [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. |
size is non-negative. hostSrc has length equal to size. buffSrc has length at least size. [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 122 of file Kokkos_StandardNodeMemoryModel.hpp.
| void Kokkos::StandardNodeMemoryModel::copyBuffers | ( | size_t | size, |
| const ArrayRCP< const T > & | buffSrc, | ||
| const ArrayRCP< T > & | buffDest | ||
| ) | [inline, inherited] |
Copy data between buffers.
| [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. |
Definition at line 139 of file Kokkos_StandardNodeMemoryModel.hpp.
| ArrayRCP<const T> Kokkos::StandardNodeMemoryModel::viewBuffer | ( | size_t | size, |
| ArrayRCP< const T > | buff | ||
| ) | [inline, inherited] |
Return a const view of a buffer for use on the host.
Definition at line 151 of file Kokkos_StandardNodeMemoryModel.hpp.
| ArrayRCP<T> Kokkos::StandardNodeMemoryModel::viewBufferNonConst | ( | ReadWriteOption | rw, |
| size_t | size, | ||
| const ArrayRCP< T > & | buff | ||
| ) | [inline, inherited] |
Return a non-const view of a buffer for use on the host.
Definition at line 160 of file Kokkos_StandardNodeMemoryModel.hpp.
const bool Kokkos::StandardNodeMemoryModel::isHostNode = true [static, inherited] |
Indicates that parallel buffers allocated by this node are available for use on the host thread.
Definition at line 61 of file Kokkos_StandardNodeMemoryModel.hpp.
1.7.4