alf_wb_create

NAME

alf_wb_create - Creates a new work block for the specified compute task.

SYNOPSIS

int alf_wb_create(alf_task_handle_t task_handle, ALF_WORK_BLOCK_TYPE_T work_block_type, unsigned int repeat_count, alf_wb_handle_t *p_wb_handle);

Parameters  
p_wb_handle [OUT] The pointer to a buffer where the created handle is returned. The contents are not modified if this call fails.
task_handle [IN] The handle to the compute task.
work_block_type [IN] The type of work block to be created. Choose from the following types:
  • ALF_WB_SINGLE: Creates a single-use work block
  • ALF_WB_MULTI: Creates a multi-use work block. This work block type is only supported when the task is created with the ALF_PARTITION_ON_ACCEL attribute.
repeat_count [IN] Specifies the number of iterations for a multi-use work block. This parameter is ignored when a single-use work block is created.

DESCRIPTION

This function creates a new work block for the specified computing task. The work block is added to the work queue of the task and the runtime releases the allocated resources once the work block is processed. The caller can only update the contents of a work block before it is added to the work queue. After the work block is added to the work queue, the lifespan of the data structure is left to the ALF runtime. The ALF runtime is responsible for cleaning up any resource allocated for the work block. This API can only be called before alf_task_finalize is invoked. After the alf_task_finalize is called, further calls to this API return an error.

RETURN VALUE

0 Success.
less than 0 Errors occurred:
  • ALF_ERR_INVAL: Invalid input argument.
  • ALF_ERR_PERM: Operation not allowed in current context. For example, the task has already been finalized or the work block has been enqueued.
  • ALF_ERR_BADF: Invalid task handle.
  • ALF_ERR_NOMEM: Out of memory.
  • ALF_ERR_GENERIC: Generic internal errors.
Related concepts
Data structures
Related reference
alf_wb_enqueue
alf_wb_parm_add
alf_wb_dtl_begin
alf_wb_dtl_entry_add
alf_wb_dtl_end