18#ifndef _ODLA_COMPUTE_H_
19#define _ODLA_COMPUTE_H_
36 ODLA_COMPUTE_INFERENCE,
37 ODLA_COMPUTE_TRAINING,
59 ODLA_BATCHES_PER_STEP,
61 ODLA_LOAD_ENGINE_MODE,
64 ODLA_QUANT_TABLE_SIZE,
66 ODLA_ENABLE_ENGINE_CACHE,
68 ODLA_ASYNC_CALLBACK_FUNC,
69 ODLA_ASYNC_CALLBACK_ARG,
#define ODLA_API_EXPORT
API export directives.
odla_status
Return status.
__UINT32_TYPE__ odla_uint32
__SIZE_TYPE__ odla_size_t
size_t
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.
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.
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_LaunchExecutable(odla_executable executable, odla_context context)
Launch an executable.
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.
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.
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.
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_DifferentiateComputation(odla_computation computation)
Differentiate a computation.
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.
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.
struct _odla_executable * odla_executable
Executable object.
odla_compute_mode
Compute mode.
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.
odla_resource_location_type
Type of resource location.
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.
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.
odla_item_type
Property item type.
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.
struct _odla_context * odla_context
Context object.
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.
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.
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.
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.
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.
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.
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.
struct _odla_computation * odla_computation
Computation object.
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_DestroyExecutable(odla_executable executable)
Destroy a created executable.
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_StoreExecutable(odla_resource_location, odla_executable executable)
Store an executable object into the file system.
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.
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_DestroyConstantsArray(odla_constants_array constants_array)
Destroy a created constants array 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.
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.
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.
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_LoadComputation(odla_resource_location location, odla_computation *computation)
Load a computation from the file system.
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_CreateContext(odla_context *context)
Create a context 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.
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_CreateConstantsArray(odla_constants_array *constants_array)
Create a constants array object.
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.
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.
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_DestroyContext(odla_context context)
Destroy a created context.
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.
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.
struct _odla_item_value * odla_item_value
Property item value object.
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.
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.
struct _odla_constants_array * odla_constants_array
Constants array object.
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_CreateComputation(odla_computation *computation)
Create a computation object.
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_DestroyComputation(odla_computation computation)
Destroy a created computation.
struct _odla_device * odla_device
Device object.
struct _odla_value_id * odla_value_id
Unique id of each value.
struct _odla_value * odla_value
Value definition.