Work blocks

A work block represents an invocation of a task with a specific set of related input data, output data, and parameters. The input and output data are described by corresponding data transfer lists. The parameters are provided through the ALF APIs. Depending on the application, the data transfer list can either be generated on the host (host data partition) or by the accelerators (accelerator data partition).

Before it calls the compute task, and as the ALF accelerator runtime processes a work block it retrieves the parameters and the input data based on the input data transfer list to the input buffer in accelerator memory. After it has invoked the computational kernel, the ALF accelerator runtime puts the output result back into the host memory. The ALF accelerator runtime manages the memory of the accelerator to accommodate the work block's input and output data.

Single-use work block

A single-use work block is processed only once. Using a single-use work block gives you the option of generating input and output data transfer lists on either the host or the accelerator.

Multi-use work block

A multi-use work block is repeatedly processed up to the specified iteration count. Unlike using a single-use work block, using a multi-use work block does not allow you to generate input and output data transfer lists from the host process. For multi-use work blocks, all input and output data transfer lists must be generated on the accelerators each time a work block is processed by the ALF runtime. For each iteration of the multi-use work block, the ALF runtime passes the parameters, total number of iterations, and current iteration count to the accelerator data partition subroutines, and you can generate the corresponding data transfer lists for each iteration based on this information. See Accelerator data partitioning for more information about single-use work blocks and multi-use work blocks.