|
Open Deep Learning API
|
Go to the source code of this file.
Data Structures | |
| struct | odla_resource_location |
| Resource location. More... | |
Typedefs | |
| typedef struct _odla_computation * | odla_computation |
| Computation object. More... | |
| typedef struct _odla_executable * | odla_executable |
| Executable object. More... | |
| typedef struct _odla_context * | odla_context |
| Context object. More... | |
| typedef struct _odla_item_value * | odla_item_value |
| Property item value object. More... | |
| typedef struct _odla_constants_array * | odla_constants_array |
| Constants array object. More... | |
Enumerations | |
| enum | odla_compute_mode { ODLA_COMPUTE_DEFAULT , ODLA_COMPUTE_INFERENCE , ODLA_COMPUTE_TRAINING } |
| Compute mode. More... | |
| enum | odla_item_type { ODLA_DYNAMIC_BATCH , ODLA_MIN_BATCH_SIZE , ODLA_MAX_BATCH_SIZE , ODLA_OPT_BATCH_SIZE , ODLA_RUN_BATCH_SIZE , ODLA_DYNAMIC_SHAPE , ODLA_MIN_SHAPE , ODLA_MAX_SHAPE , ODLA_OPT_SHAPE , ODLA_DYNAMIC_VALUE , ODLA_MIN_VALUE , ODLA_MAX_VALUE , ODLA_OPT_VALUE , ODLA_BF16_MODE , ODLA_FP16_MODE , ODLA_USE_SIM_MODE , ODLA_PROCESSOR_NUM , ODLA_BATCHES_PER_STEP , ODLA_USE_DATA_TYPE , ODLA_LOAD_ENGINE_MODE , ODLA_USE_DLA_CORE , ODLA_QUANT_TABLE , ODLA_QUANT_TABLE_SIZE , ODLA_AGGREGATE_OPS , ODLA_ENABLE_ENGINE_CACHE , ODLA_CACHE_DIR , ODLA_ASYNC_CALLBACK_FUNC , ODLA_ASYNC_CALLBACK_ARG } |
| Property item type. More... | |
| enum | odla_bf16_mode { BF16_DISABLE , BF16_ACCURACY_MODE , BF16_PERFORMACE_MODE , BF16_AUTO_MODE } |
| BF16 mode. More... | |
| enum | odla_resource_location_type { ODLA_LOCATION_PATH , ODLA_LOCATION_MEMORY , ODLA_LOCATION_URI } |
| Type of resource location. More... | |
Functions | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_CreateComputation (odla_computation *computation) |
| Create a computation object. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_CompileComputation (const odla_computation computation, const odla_device device, odla_executable *executable) |
| Compile a computation object into executable. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_LoadComputation (odla_resource_location location, odla_computation *computation) |
| Load a computation from the file system. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_StoreComputation (odla_resource_location location, odla_computation computation) |
| Store a computation object into the file system. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_DifferentiateComputation (odla_computation computation) |
| Differentiate a computation. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_ExecuteComputation (const odla_computation computation, const odla_context context, const odla_compute_mode mode, odla_device device) |
| Execute a computation. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_AsyncExecuteComputation (const odla_computation computation, const odla_context context, const odla_compute_mode mode, odla_device device) |
| Asynchronously execute a computation. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_GetNumOfArgsFromComputation (const odla_computation computation, odla_uint32 *num_args) |
| Get the number of arguments from a computation. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_GetArgFromComputationByIdx (const odla_computation computation, const odla_uint32 arg_idx, odla_value *arg_value) |
| Get the #idx argument value from a computation. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_GetNumOfOutputsFromComputation (const odla_computation computation, odla_uint32 *num_outputs) |
| Get the number of outputs from a computation. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_GetOutputFromComputationByIdx (const odla_computation computation, const odla_uint32 output_idx, odla_value *output_value) |
| Get the #idx output value from a computation. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_DestroyComputation (odla_computation computation) |
| Destroy a created computation. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_SetComputationItem (odla_computation computation, odla_item_type type, odla_item_value value) |
| Set the computation with a property item. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_SetValueShapeInfo (odla_value value, odla_item_type type, odla_value_shape value_shape) |
| Set the computation arguments shape info with a property item. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_SetInputValueInfo (odla_value value, odla_item_type type, odla_item_value value_input) |
| Set the computation arguments shape info with a property item. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_SetRuntimeShape (odla_context context, odla_value value, odla_value_shape value_shape) |
| Set the context runtime shapes to an odla_value. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_GetRuntimeShape (odla_context context, odla_value value, odla_value_shape *value_shape_ptr) |
| Get the context runtime shapes. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_CreateConstantsArray (odla_constants_array *constants_array) |
| Create a constants array object. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_LoadConstantsArray (const odla_char *file_name, odla_constants_array *constants_array) |
| Load a constants array from the file system. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_StoreConstantsArray (const odla_char *file_name, const odla_constants_array constants_array) |
| Store a constants array into the file system. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_DestroyConstantsArray (odla_constants_array constants_array) |
| Destroy a created constants array object. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_LoadExecutable (odla_resource_location location, odla_device device, odla_executable *executable) |
| Load an executable from the file system. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_StoreExecutable (odla_resource_location, odla_executable executable) |
| Store an executable object into the file system. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_LaunchExecutable (odla_executable executable, odla_context context) |
| Launch an executable. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_AsyncLaunchExecutable (const odla_executable executable, const odla_constants_array constants_array, const odla_context context, const odla_compute_mode mode, odla_device device) |
| Asynchronously launch an executable. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_GetNumOfArgsFromExecutable (const odla_executable executable, odla_uint32 *num_args) |
| Get the number of arguments from an Executable. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_GetArgFromExecutableByIdx (const odla_executable executable, const odla_uint32 arg_idx, odla_value *arg_value) |
| Get the #idx argument value from an executable. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_GetNumOfOutputsFromExecutable (const odla_executable executable, odla_uint32 *num_outputs) |
| Get the number of outputs from an executable. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_GetOutputFromExecutableByIdx (const odla_executable executable, const odla_uint32 output_idx, odla_value *output_value) |
| Get the #idx output value from an executable. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_DestroyExecutable (odla_executable executable) |
| Destroy a created executable. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_CreateContext (odla_context *context) |
| Create a context object. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_SetContextItem (odla_context context, odla_item_type type, odla_item_value value) |
| Set the context with a property item. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_DestroyContext (odla_context context) |
| Destroy a created context. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_BindToArgument (odla_value value, const odla_void *data_ptr, odla_context context) |
| Bind data to an argument. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_BindToArgumentById (const odla_value_id value_id, const odla_void *data_ptr, odla_context context) |
| Bind data to an argument by id. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_BindValueToArgumentById (const odla_value_id value_id, odla_value data, odla_context context) |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_BindToOutput (odla_value value, odla_void *data_ptr, odla_context context) |
| Bind memory to an output value. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_BindToOutputById (const odla_value_id value_id, odla_void *data_ptr, odla_context context) |
| Bind memory to an output value by id. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_BindValueToOutputById (const odla_value_id value_id, odla_value data, odla_context context) |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_SetRuntimeValueType (odla_context context, odla_value value, odla_value_type value_type) |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_GetRuntimeValueType (odla_context context, odla_value value, odla_value_type *value_type_ptr) |
| Get the context runtime value type to an odla_value. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_GetRuntimeNumOfOutputs (odla_context context, odla_uint32 *num_output_ptr) |
| Get the context runtime number of outputs. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_GetValueData (const odla_value value, odla_void *data_ptr, odla_context context) |
| Get a value data. More... | |
This file defines the ODLA compute related APIs.
Definition in file odla_compute.h.
| typedef struct _odla_computation* odla_computation |
Computation object.
Definition at line 100 of file odla_compute.h.
| typedef struct _odla_constants_array* odla_constants_array |
Constants array object.
Definition at line 112 of file odla_compute.h.
| typedef struct _odla_context* odla_context |
Context object.
Definition at line 106 of file odla_compute.h.
| typedef struct _odla_executable* odla_executable |
Executable object.
Definition at line 103 of file odla_compute.h.
| typedef struct _odla_item_value* odla_item_value |
Property item value object.
Definition at line 109 of file odla_compute.h.
| enum odla_bf16_mode |
BF16 mode.
Definition at line 73 of file odla_compute.h.
| enum odla_compute_mode |
Compute mode.
Definition at line 34 of file odla_compute.h.
| enum odla_item_type |
Property item type.
Definition at line 41 of file odla_compute.h.
Type of resource location.
Definition at line 81 of file odla_compute.h.
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_AsyncExecuteComputation | ( | const odla_computation | computation, |
| const odla_context | context, | ||
| const odla_compute_mode | mode, | ||
| odla_device | device | ||
| ) |
Asynchronously execute a computation.
| computation | the computation object |
| context | the context object |
| mode | the compute mode |
| device | the device object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_AsyncLaunchExecutable | ( | const odla_executable | executable, |
| const odla_constants_array | constants_array, | ||
| const odla_context | context, | ||
| const odla_compute_mode | mode, | ||
| odla_device | device | ||
| ) |
Asynchronously launch an executable.
| executable | the executable object |
| constants_array | the constants array object (can be NULL) |
| context | the context object |
| mode | the compute mode |
| device | the device object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_BindToArgument | ( | odla_value | value, |
| const odla_void * | data_ptr, | ||
| odla_context | context | ||
| ) |
Bind data to an argument.
Bind input data to an argument of computation. An error will be returned if value is not an argument.
| value | the argument |
| data_ptr | the pointer to the host memory |
| context | the context object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_BindToArgumentById | ( | const odla_value_id | value_id, |
| const odla_void * | data_ptr, | ||
| odla_context | context | ||
| ) |
Bind data to an argument by id.
Bind input data to an argument of computation. An error will be returned if the value specified by value_id is not an argument.
| value_id | the value id for the argument |
| data_ptr | the pointer to the host memory |
| context | the context object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_BindToOutput | ( | odla_value | value, |
| odla_void * | data_ptr, | ||
| odla_context | context | ||
| ) |
Bind memory to an output value.
Bind a memory buffer to an output of computation. An error will be returned if the value specified by value_id is not set as output value.
| value | the output value |
| data_ptr | the pointer to the host data buffer |
| context | the context object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_BindToOutputById | ( | const odla_value_id | value_id, |
| odla_void * | data_ptr, | ||
| odla_context | context | ||
| ) |
Bind memory to an output value by id.
Bind a memory buffer to an output of computation by id. An error will be returned if the value specified by value_id is not set as output value.
| value_id | the id for the output value |
| data_ptr | the pointer to the host data buffer |
| context | the context object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_CompileComputation | ( | const odla_computation | computation, |
| const odla_device | device, | ||
| odla_executable * | executable | ||
| ) |
Compile a computation object into executable.
| computation | the computation object |
| excecutable | the pointer to the compiled excecutable object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_CreateComputation | ( | odla_computation * | computation | ) |
Create a computation object.
| computation | the pointer to the created computation object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_CreateConstantsArray | ( | odla_constants_array * | constants_array | ) |
Create a constants array object.
| constants_array | the pointer to the created constants array object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_CreateContext | ( | odla_context * | context | ) |
Create a context object.
| context | the pointer to the created context object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_DestroyComputation | ( | odla_computation | computation | ) |
Destroy a created computation.
| computation | the computation object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_DestroyConstantsArray | ( | odla_constants_array | constants_array | ) |
Destroy a created constants array object.
| constants_array | the constants array object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_DestroyContext | ( | odla_context | context | ) |
Destroy a created context.
| context | the context object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_DestroyExecutable | ( | odla_executable | executable | ) |
Destroy a created executable.
| executable | the executable object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_DifferentiateComputation | ( | odla_computation | computation | ) |
Differentiate a computation.
| computation | the computation object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_ExecuteComputation | ( | const odla_computation | computation, |
| const odla_context | context, | ||
| const odla_compute_mode | mode, | ||
| odla_device | device | ||
| ) |
Execute a computation.
| computation | the computation object |
| context | the context object |
| mode | the compute mode |
| device | the device object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_GetArgFromComputationByIdx | ( | const odla_computation | computation, |
| const odla_uint32 | arg_idx, | ||
| odla_value * | arg_value | ||
| ) |
Get the #idx argument value from a computation.
| computation | the computation object |
| arg_idx | the index of argument |
| arg_value | the pointer to the retrieved argument value |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_GetArgFromExecutableByIdx | ( | const odla_executable | executable, |
| const odla_uint32 | arg_idx, | ||
| odla_value * | arg_value | ||
| ) |
Get the #idx argument value from an executable.
| executable | the executable object |
| arg_idx | the index of argument |
| arg_value | the pointer to the retrieved argument value |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_GetNumOfArgsFromComputation | ( | const odla_computation | computation, |
| odla_uint32 * | num_args | ||
| ) |
Get the number of arguments from a computation.
| computation | the computation object |
| num_args | the pointer to the retrieved number of args |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_GetNumOfArgsFromExecutable | ( | const odla_executable | executable, |
| odla_uint32 * | num_args | ||
| ) |
Get the number of arguments from an Executable.
| executable | the executable object |
| num_args | the pointer to the retrieved number of args |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_GetNumOfOutputsFromComputation | ( | const odla_computation | computation, |
| odla_uint32 * | num_outputs | ||
| ) |
Get the number of outputs from a computation.
| computation | the computation object |
| num_outputs | the pointer to the retrieved number of outputs |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_GetNumOfOutputsFromExecutable | ( | const odla_executable | executable, |
| odla_uint32 * | num_outputs | ||
| ) |
Get the number of outputs from an executable.
| executable | the executable object |
| num_outputs | the pointer to the retrieved number of outputs |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_GetOutputFromComputationByIdx | ( | const odla_computation | computation, |
| const odla_uint32 | output_idx, | ||
| odla_value * | output_value | ||
| ) |
Get the #idx output value from a computation.
| computation | the computation object |
| output_idx | the index of output |
| output_value | the pointer to the retrieved output value |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_GetOutputFromExecutableByIdx | ( | const odla_executable | executable, |
| const odla_uint32 | output_idx, | ||
| odla_value * | output_value | ||
| ) |
Get the #idx output value from an executable.
| executable | the executable object |
| output_idx | the index of output |
| output_value | the pointer to the retrieved output value |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_GetRuntimeNumOfOutputs | ( | odla_context | context, |
| odla_uint32 * | num_output_ptr | ||
| ) |
Get the context runtime number of outputs.
| context | the context object |
| num_output_ptr | the pointer to hold the number of outputs |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_GetRuntimeShape | ( | odla_context | context, |
| odla_value | value, | ||
| odla_value_shape * | value_shape_ptr | ||
| ) |
Get the context runtime shapes.
| context | the context object |
| value | the property odla value |
| value_shape_ptr | the pointer to the value_shape |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_GetRuntimeValueType | ( | odla_context | context, |
| odla_value | value, | ||
| odla_value_type * | value_type_ptr | ||
| ) |
Get the context runtime value type to an odla_value.
| context | the context object |
| value | the property odla value |
| value_type_ptr | the odla_value_type object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_GetValueData | ( | const odla_value | value, |
| odla_void * | data_ptr, | ||
| odla_context | context | ||
| ) |
Get a value data.
| value | the value |
| data_ptr | the pointer to the retrieved data buffer |
| context | the context associated with the value data |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_LaunchExecutable | ( | odla_executable | executable, |
| odla_context | context | ||
| ) |
Launch an executable.
| executable | the executable object |
| context | the context object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_LoadComputation | ( | odla_resource_location | location, |
| odla_computation * | computation | ||
| ) |
Load a computation from the file system.
| location | the location of the computation file |
| computation | the pointer to the loaded computation object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_LoadConstantsArray | ( | const odla_char * | file_name, |
| odla_constants_array * | constants_array | ||
| ) |
Load a constants array from the file system.
| file_name | the file name |
| constants_array | the pointer to the loaded constants array object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_LoadExecutable | ( | odla_resource_location | location, |
| odla_device | device, | ||
| odla_executable * | executable | ||
| ) |
Load an executable from the file system.
| file_name | the file name |
| device | the device object |
| executable | the pointer to the loaded executable object |
| context | the pointer to the loaded context object |
| computation | the pointer to the loaded computation object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_SetComputationItem | ( | odla_computation | computation, |
| odla_item_type | type, | ||
| odla_item_value | value | ||
| ) |
Set the computation with a property item.
| computation | the computation object |
| type | the property item type |
| value | the property item value |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_SetContextItem | ( | odla_context | context, |
| odla_item_type | type, | ||
| odla_item_value | value | ||
| ) |
Set the context with a property item.
| context | the context object |
| type | the property item type |
| value | the property item value |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_SetInputValueInfo | ( | odla_value | value, |
| odla_item_type | type, | ||
| odla_item_value | value_input | ||
| ) |
Set the computation arguments shape info with a property item.
| value | the odla_value |
| type | the property item type |
| value_input | the property value_shape |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_SetRuntimeShape | ( | odla_context | context, |
| odla_value | value, | ||
| odla_value_shape | value_shape | ||
| ) |
Set the context runtime shapes to an odla_value.
| context | the context object |
| value | the property odla value |
| value_shape | the property value_shape |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_SetValueShapeInfo | ( | odla_value | value, |
| odla_item_type | type, | ||
| odla_value_shape | value_shape | ||
| ) |
Set the computation arguments shape info with a property item.
| value | the odla_value |
| type | the property item type |
| value_shape | the property value_shape |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_StoreComputation | ( | odla_resource_location | location, |
| odla_computation | computation | ||
| ) |
Store a computation object into the file system.
| location | the location of the computation file |
| computation | the computation object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_StoreConstantsArray | ( | const odla_char * | file_name, |
| const odla_constants_array | constants_array | ||
| ) |
Store a constants array into the file system.
| file_name | the file name |
| constants_array | the constants array object |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_StoreExecutable | ( | odla_resource_location | , |
| odla_executable | executable | ||
| ) |
Store an executable object into the file system.
| location | the location of the executable |
| executable | the executable object |