Open Deep Learning API
Loading...
Searching...
No Matches
Enumerations | Functions
odla_ops_control_flow.h File Reference

Go to the source code of this file.

Enumerations

enum  odla_loop_output_mode {
  ODLA_LOOP_LAST_VALUE , ODLA_LOOP_FWD_BEFORE , ODLA_LOOP_FWD_AFTER , ODLA_LOOP_REV_BEFORE ,
  ODLA_LOOP_REV_AFTER
}
 Types of loop output. More...
 

Functions

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_CreateLoopVariable (odla_value init_value, odla_value_id value_id)
 Create a loop variable which has an initial value and recurrent values. More...
 
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_BeginLoop (odla_value trip_count, odla_value_id value_id)
 Create a loop. All subsequent loop related APIs are specific to this one until the correspoding odla_EndLoop is called. More...
 
ODLA_API_EXPORT odla_values ODLA_API_CALL odla_EndLoop (odla_value condition, odla_values output_values, const odla_loop_output_mode *flags, odla_value_ids)
 
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_BeginIf (odla_value condition, odla_value_id)
 
ODLA_API_EXPORT odla_status odla_EnterBranchBody (odla_bool true_branch)
 
ODLA_API_EXPORT odla_values ODLA_API_CALL odla_EndIf (odla_value_ids)
 

Detailed Description

This file defines the ODLA loop operators.

Definition in file odla_ops_control_flow.h.

Enumeration Type Documentation

◆ odla_loop_output_mode

Types of loop output.

Enumerator
ODLA_LOOP_LAST_VALUE 

The value for the last iteration

Definition at line 33 of file odla_ops_control_flow.h.

33 {
35 ODLA_LOOP_FWD_BEFORE, /* !< Concatenated values for each iteration:
36 [init_value...last_value) */
37 ODLA_LOOP_FWD_AFTER, /* !< Concatenated values for each iteration:
38 [state_1...last_value]) */
39 ODLA_LOOP_REV_BEFORE, /* !< Concatenated values for each iteration,
40 in reverse order: (last_value...init_value]) */
41 ODLA_LOOP_REV_AFTER, /* !< Concatenated values for each iteration, in
42 reverse order: [last_value...init_value) */
odla_loop_output_mode
Types of loop output.
@ ODLA_LOOP_LAST_VALUE

Function Documentation

◆ odla_BeginLoop()

ODLA_API_EXPORT odla_status ODLA_API_CALL odla_BeginLoop ( odla_value  trip_count,
odla_value_id  value_id 
)

Create a loop. All subsequent loop related APIs are specific to this one until the correspoding odla_EndLoop is called.

Parameters
trip_countthe iteration count for the loop. The type of the value must be a scalar of integer.
value_ida unique value id (can be NULL)
Returns
odla_status

◆ odla_CreateLoopVariable()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_CreateLoopVariable ( odla_value  init_value,
odla_value_id  value_id 
)

Create a loop variable which has an initial value and recurrent values.

Parameters
init_valueinitial value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_EndLoop()

ODLA_API_EXPORT odla_values ODLA_API_CALL odla_EndLoop ( odla_value  condition,
odla_values  output_values,
const odla_loop_output_mode flags,
odla_value_ids   
)
Parameters
conditionThe boolean condition to end the loop. If it is NULL, the condition is assumed as True, therefore the loop will be solely controlled by the trip count defined in odla_BeginLoop.
output_valuesThe values as loop outputs. These values must be created by odla_CreateLoopVariable.
flagsEach output value has a corresponding flag. If the flag is not ODLA_LOOP_LAST_VALUE, an extra concatenated value will be returned.
value_idsunique value ids (can be NULL)
Returns
odla_values loop output values.