Tensor Tiling Library
 
Loading...
Searching...
No Matches
TTL_duplex_scheme.h File Reference
Include dependency graph for p/pipelines/TTL_duplex_scheme.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  TTL_duplex_buffering< TENSORTYPE >
 Data required to perform duplex buffer pipelining. More...
 

Detailed Description

Given pair of blocking import and export that can execute concurrently, TTL_duplex_buffering issues them together and then waits on both to complete, hopefully executing them in parallel to each other. This scheme uses two internal buffers, one for the import and one for the export. Note that the export is pipelined to pair the import of the current tile with the export of previous tile.

The following table draws the pipelined actions performed in duplex buffering. It specifies which tile is processed in each iteration:

Action\Iteration #0 #1 #i (2:NumOfTiles-1) #NumOfTiles-
Import 0 1 i
Wait Import 0 1 i
Compute 0 1 i
Export 0 i-1 NumOfTiles-1
WaitExport 0 i-1 NumOfTiles-1

Notice the epilog (#NumOfTiles) which is an extra iteration.

When including this file the following must be defined

#define TTL_TENSOR_TYPE void #define TTL_TENSOR_TYPE uchar etc

Definition in file p/pipelines/TTL_duplex_scheme.h.