XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
Streamed::StreamView< T > Struct Template Reference

#include <streamed_parallel_for.hpp>

Public Member Functions

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)
 

Public Attributes

bool stage_in_pinned_memory
 
T * h_view_ptr
 
T * d_view_ptr
 
T * pinned_send [2]
 
T * pinned_return [2]
 

Detailed Description

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

Constructor & Destructor Documentation

template<typename T>
template<typename H , typename D >
Streamed::StreamView< T >::StreamView ( H &  view_h,
D &  view_d,
bool  stage_in_pinned_memory_in,
int  n_on_device,
int  n_partitions_of_device_view 
)
inline

Constructor

Parameters
[in]view_his the host data, either an AoSoA or a View
[in]view_dis the device data allocation, either an AoSoA or a View
[in]stage_in_pinned_memory_insays whether to use pinned memory
[in]n_on_deviceis the size of the device data allocation
[in]n_partitions_of_device_viewis the number of partitions to split the device allocation into

Here is the call graph for this function:

template<typename T>
Streamed::StreamView< T >::~StreamView ( )
inline

Custom destructor to deallocate the pinned memory

Member Function Documentation

template<typename T>
void Streamed::StreamView< T >::copy_from_pinned ( int  offset_h,
int  n,
int  i_staging_area 
)
inline

Copies a chunk of data to the host memory from the temporary pinned memory staging area

Parameters
[in]offset_his the offset where the data chunk begins in the full view
[in]nis the number of elements to be copied
[in]i_staging_areais which pinned host memory to use
Returns
void

Here is the caller graph for this function:

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_his the offset where the data chunk begins in the full view
[in]offset_dis the offset where the data chunk begins in the full view
[in]nis the number of elements to be copied
[in]i_staged_areais which pinned host memory to use
[in]gpu_streamis the GPU stream used to execute the send
Returns
void

Here is the caller graph for this function:

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_his the offset where the data chunk begins in the full view
[in]offset_dis the offset where the data chunk begins in the full view
[in]nis the number of elements to be copied
[in]i_staged_areais which pinned host memory to use
[in]gpu_streamis the GPU stream used to execute the return
Returns
void

Here is the caller graph for this function:

template<typename T>
void Streamed::StreamView< T >::copy_to_pinned ( int  offset_h,
int  n,
int  i_staging_area 
)
inline

Copies a chunk of data from the host memory to the temporary pinned memory staging area

Parameters
[in]offset_his the offset where the data chunk begins in the full view
[in]nis the number of elements to be copied
[in]i_staging_areais which pinned host memory to use
Returns
void

Here is the caller graph for this function:

Member Data Documentation

template<typename T>
T* Streamed::StreamView< T >::d_view_ptr
template<typename T>
T* Streamed::StreamView< T >::h_view_ptr
template<typename T>
T* Streamed::StreamView< T >::pinned_return[2]
template<typename T>
T* Streamed::StreamView< T >::pinned_send[2]
template<typename T>
bool Streamed::StreamView< T >::stage_in_pinned_memory

The documentation for this struct was generated from the following file: