#include <streamed_parallel_for.hpp>
|
template<typename H , typename D > |
| StreamView (H &view_h, D &view_d, bool stage_in_pinned_memory_in, int n_on_device, int n_partitions_of_device_view) |
|
| ~StreamView () |
|
template<typename ST > |
void | copy_to_device (int offset_h, int offset_d, int n, int i_staged_area, ST &gpu_stream) |
|
template<typename ST > |
void | copy_to_host (int offset_h, int offset_d, int n, int i_staged_area, ST &gpu_stream) |
|
void | copy_to_pinned (int offset_h, int n, int i_staging_area) |
|
void | copy_from_pinned (int offset_h, int n, int i_staging_area) |
|
template<typename T>
struct Streamed::StreamView< T >
Each AoSoA or View that is to be streamed to device is handled as a StreamView. The StreamView handles the copies to and from device as well as to and from the pinned memory staging area
template<typename T>
template<typename H , typename D >
Constructor
- Parameters
-
[in] | view_h | is the host data, either an AoSoA or a View |
[in] | view_d | is the device data allocation, either an AoSoA or a View |
[in] | stage_in_pinned_memory_in | says whether to use pinned memory |
[in] | n_on_device | is the size of the device data allocation |
[in] | n_partitions_of_device_view | is the number of partitions to split the device allocation into |
Custom destructor to deallocate the pinned memory
Copies a chunk of data to the host memory from the temporary pinned memory staging area
- Parameters
-
[in] | offset_h | is the offset where the data chunk begins in the full view |
[in] | n | is the number of elements to be copied |
[in] | i_staging_area | is which pinned host memory to use |
- Returns
- void
template<typename T>
template<typename ST >
void Streamed::StreamView< T >::copy_to_device |
( |
int |
offset_h, |
|
|
int |
offset_d, |
|
|
int |
n, |
|
|
int |
i_staged_area, |
|
|
ST & |
gpu_stream |
|
) |
| |
|
inline |
Copies a chunk of data to device by wrapping the specified section of the host and device allocations in unmanaged views. Could potentially use subviews instead.
- Parameters
-
[in] | offset_h | is the offset where the data chunk begins in the full view |
[in] | offset_d | is the offset where the data chunk begins in the full view |
[in] | n | is the number of elements to be copied |
[in] | i_staged_area | is which pinned host memory to use |
[in] | gpu_stream | is the GPU stream used to execute the send |
- Returns
- void
template<typename T>
template<typename ST >
void Streamed::StreamView< T >::copy_to_host |
( |
int |
offset_h, |
|
|
int |
offset_d, |
|
|
int |
n, |
|
|
int |
i_staged_area, |
|
|
ST & |
gpu_stream |
|
) |
| |
|
inline |
Copies a chunk of data to the host by wrapping the specified section of the host and device allocations in unmanaged views. Could potentially use subviews instead.
- Parameters
-
[in] | offset_h | is the offset where the data chunk begins in the full view |
[in] | offset_d | is the offset where the data chunk begins in the full view |
[in] | n | is the number of elements to be copied |
[in] | i_staged_area | is which pinned host memory to use |
[in] | gpu_stream | is the GPU stream used to execute the return |
- Returns
- void
Copies a chunk of data from the host memory to the temporary pinned memory staging area
- Parameters
-
[in] | offset_h | is the offset where the data chunk begins in the full view |
[in] | n | is the number of elements to be copied |
[in] | i_staging_area | is which pinned host memory to use |
- Returns
- void
The documentation for this struct was generated from the following file: