alf_accel_input_dtl_prepare

NAME

alf_accel_input_dtl_prepare - Defines the data transfer lists for input data.

SYNOPSIS

int alf_accel_input_dtl_prepare (void* p_task_context, void *p_parm_context, void *p_dtl, unsigned int current_iter, unsigned int num_iter);

Parameters  
p_task_context[IN] Pointer to the task context buffer in accelerator memory.
p_parm_ctx_buffer[IN] Pointer to the work block parameter context buffer in accelerator memory.
p_dtl[IN] Pointer the data transfer list the generated data transfer list should be saved.
current_iter[IN] The current iteration count of multi-use work blocks. This value starts at 0. For single-use work blocks, this value is always 0.
num_iter[IN] The total number of iterations of multi-use work blocks. For single-use work blocks, this value is always 1.

DESCRIPTION

This function is called by the ALF runtime when it needs the accelerator to define the data transfer lists for input data. One important point to consider is that because the ALF framework may do double buffering, the function only refers to the information provided by the p_parm_ctx_buffer. This function should generate the data transfer lists for the input buffer (ALF_BUF_IN), the overlapped input buffer (ALF_BUF_OVL_IN), and the overlapped I/O buffer (ALF_BUF_OVL_INOUT) when these buffers are enabled. For the overlapped I/O buffer (ALF_BUF_OVL_INOUT), the data transfer list generated in this function is reused by the runtime to push the data back to host memory.

This function is an optional function. It is only called if the task descriptor sets the ALF_TASK_DESC_PARTITION_ON_ACCEL to true. When this attribute is not set or set to false, you can choose not to implement this API when the programming environment supports weak link or to implement an empty function that returns zero when weak link is not supported.

RETURN VALUE

0 The computation finished correctly.
less than 0 An error occurred during the call. The error code is passed back to you to be handled.