Tensor Tiling Library
 
Loading...
Searching...
No Matches
TTL_duplex_buffering< TENSORTYPE > Struct Template Reference

Data required to perform duplex buffer pipelining. More...

#include <TTL_duplex_scheme.h>

Collaboration diagram for TTL_duplex_buffering< TENSORTYPE >:

Public Member Functions

 TTL_duplex_buffering (TTL_tensor< TENSORTYPE > ext_tensor_in, TTL_local(TENSORTYPE *) int_base_in, TTL_tensor< TENSORTYPE > ext_tensor_out, TTL_local(TENSORTYPE *) int_base_out, TTL_event(*input_events)[2], TTL_tile first_tile)
 Create a TTL_DUPLEX_BUFFERING_TYPE and begin the buffering process.
 
TTL_io_tensors< TENSORTYPE > step_buffering (TTL_tile tile_current_import, TTL_tile tile_current_export)
 
void finish_buffering ()
 Complete any transfers required to finish the buffering process.
 

Data Fields

TTL_common_buffering< TENSORTYPE, 2 > m_common
 The information that is m_common to all pipeline schemes.
 
TTL_event(* m_events )[2]
 
struct { 
 
   TTL_tensor< TENSORTYPE >   to_export_to 
 
   TTL_tensor< TENSORTYPE >   to_export_from 
 
m_prev_out_tensors 
 Store of the buffers used for the previous import/export cycles.
 

Static Public Attributes

static constexpr unsigned int IMPORT_BUFFER = 0
 Indexes to use for importing and exporting of data.
 
static constexpr unsigned int EXPORT_BUFFER = 1
 

Detailed Description

template<typename TENSORTYPE>
struct TTL_duplex_buffering< TENSORTYPE >

Data required to perform duplex buffer pipelining.

See also
TTL_start_duplex_buffering for a description of duplex buffer pipelining.

Definition at line 62 of file p/pipelines/TTL_duplex_scheme.h.

Constructor & Destructor Documentation

◆ TTL_duplex_buffering()

template<typename TENSORTYPE>
TTL_duplex_buffering< TENSORTYPE >::TTL_duplex_buffering ( TTL_tensor< TENSORTYPE > ext_tensor_in,
TTL_local(TENSORTYPE *) int_base_in,
TTL_tensor< TENSORTYPE > ext_tensor_out,
TTL_local(TENSORTYPE *) int_base_out,
TTL_event(*) input_events[2],
TTL_tile first_tile )
inline

Create a TTL_DUPLEX_BUFFERING_TYPE and begin the buffering process.

Parameters
ext_tensor_inA tensor describing the input in global memory
int_base_inThe address of the local import buffer.
ext_tensor_outA tensor describing the output in global memory
int_base_outThe address of the local export buffer.
m_eventsA pointer to a list of 2 m_events. The first event in the list will be used for imports, the second event in the list will be used for exports.
first_tileThe first tile to fetch for the scheme
Returns
The TTL_DUPLEX_BUFFERING_TYPE created from the input parameters.

The first event in the list will be used for imports, the second event in the list will be used for exports.

Example:

TTL_duplex_buffering buffering_scheme(
ext_base_in, ext_layout_in, l_buffers[0],
ext_base_out, ext_layout_out, l_buffers[1],
static TTL_event_t TTL_get_event()
Return an empty event of type TTL_event_t.
event_t TTL_event
TTL_event is a pseudonym for OpenCL event_t.
Data required to perform duplex buffer pipelining.


Returns
The TTL_duplex_buffering created from the input parameters.

Solid description of duplex buffering here.

The simplest form of duplex buffering takes the following flow.

This can be optimized and standardized using the step_buffering call.

Definition at line 147 of file p/pipelines/TTL_duplex_scheme.h.

Member Function Documentation

◆ finish_buffering()

template<typename TENSORTYPE>
void TTL_duplex_buffering< TENSORTYPE >::finish_buffering ( )
inline

Complete any transfers required to finish the buffering process.

Any transfers that are still in progress will be completed and any transfers that need to be started and completed before finish_buffering returns

Definition at line 214 of file p/pipelines/TTL_duplex_scheme.h.

◆ step_buffering()

template<typename TENSORTYPE>
TTL_io_tensors< TENSORTYPE > TTL_duplex_buffering< TENSORTYPE >::step_buffering ( TTL_tile tile_current_import,
TTL_tile tile_current_export )
inline

Definition at line 162 of file p/pipelines/TTL_duplex_scheme.h.

Field Documentation

◆ EXPORT_BUFFER

template<typename TENSORTYPE>
unsigned int TTL_duplex_buffering< TENSORTYPE >::EXPORT_BUFFER = 1
staticconstexpr

Definition at line 224 of file p/pipelines/TTL_duplex_scheme.h.

◆ IMPORT_BUFFER

template<typename TENSORTYPE>
unsigned int TTL_duplex_buffering< TENSORTYPE >::IMPORT_BUFFER = 0
staticconstexpr

Indexes to use for importing and exporting of data.

Definition at line 223 of file p/pipelines/TTL_duplex_scheme.h.

◆ m_common

template<typename TENSORTYPE>
TTL_common_buffering<TENSORTYPE, 2> TTL_duplex_buffering< TENSORTYPE >::m_common

The information that is m_common to all pipeline schemes.

Definition at line 218 of file p/pipelines/TTL_duplex_scheme.h.

◆ m_events

template<typename TENSORTYPE>
TTL_event(* TTL_duplex_buffering< TENSORTYPE >::m_events)[2]

2 m_events are required, 1 first is used for external to internal transfers, the second for internal to external transfers

Definition at line 226 of file p/pipelines/TTL_duplex_scheme.h.

◆ [struct]

struct { ... } TTL_duplex_buffering< TENSORTYPE >::m_prev_out_tensors

Store of the buffers used for the previous import/export cycles.

◆ to_export_from

template<typename TENSORTYPE>
TTL_tensor<TENSORTYPE> TTL_duplex_buffering< TENSORTYPE >::to_export_from

Definition at line 236 of file p/pipelines/TTL_duplex_scheme.h.

◆ to_export_to

template<typename TENSORTYPE>
TTL_tensor<TENSORTYPE> TTL_duplex_buffering< TENSORTYPE >::to_export_to

Definition at line 235 of file p/pipelines/TTL_duplex_scheme.h.


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