6 #define DLNNAPI_FUNCTION_COUNT 23 8 #define DLNNAPI_FLAG_VERSION_MASK 0xFF 10 #define DLNNAPI_FLAG_VERSION_27 0x01 14 typedef int (*ANeuralNetworksMemory_createFromFd_fn)(
size_t size,
int protect,
int fd,
size_t offset,
ANeuralNetworksMemory** memory);
34 typedef int (*ANeuralNetworksModel_setOperandValue_fn)(
ANeuralNetworksModel* model, int32_t index,
const void* buffer,
size_t length);
38 typedef int (*ANeuralNetworksModel_addOperation_fn)(
ANeuralNetworksModel* model, ANeuralNetworksOperationType type, uint32_t inputCount,
const uint32_t* inputs, uint32_t outputCount,
const uint32_t* outputs);
40 typedef int (*ANeuralNetworksModel_identifyInputsAndOutputs_fn)(
ANeuralNetworksModel* model, uint32_t inputCount,
const uint32_t* inputs, uint32_t outputCount,
const uint32_t* outputs);
66 ANeuralNetworksMemory_createFromFd_fn ANeuralNetworksMemory_createFromFd;
67 ANeuralNetworksMemory_free_fn ANeuralNetworksMemory_free;
68 ANeuralNetworksModel_create_fn ANeuralNetworksModel_create;
69 ANeuralNetworksModel_finish_fn ANeuralNetworksModel_finish;
70 ANeuralNetworksModel_free_fn ANeuralNetworksModel_free;
71 ANeuralNetworksCompilation_create_fn ANeuralNetworksCompilation_create;
72 ANeuralNetworksCompilation_free_fn ANeuralNetworksCompilation_free;
73 ANeuralNetworksCompilation_setPreference_fn ANeuralNetworksCompilation_setPreference;
74 ANeuralNetworksCompilation_finish_fn ANeuralNetworksCompilation_finish;
75 ANeuralNetworksModel_addOperand_fn ANeuralNetworksModel_addOperand;
76 ANeuralNetworksModel_setOperandValue_fn ANeuralNetworksModel_setOperandValue;
77 ANeuralNetworksModel_setOperandValueFromMemory_fn ANeuralNetworksModel_setOperandValueFromMemory;
78 ANeuralNetworksModel_addOperation_fn ANeuralNetworksModel_addOperation;
79 ANeuralNetworksModel_identifyInputsAndOutputs_fn ANeuralNetworksModel_identifyInputsAndOutputs;
80 ANeuralNetworksExecution_create_fn ANeuralNetworksExecution_create;
81 ANeuralNetworksExecution_free_fn ANeuralNetworksExecution_free;
82 ANeuralNetworksExecution_setInput_fn ANeuralNetworksExecution_setInput;
83 ANeuralNetworksExecution_setInputFromMemory_fn ANeuralNetworksExecution_setInputFromMemory;
84 ANeuralNetworksExecution_setOutput_fn ANeuralNetworksExecution_setOutput;
85 ANeuralNetworksExecution_setOutputFromMemory_fn ANeuralNetworksExecution_setOutputFromMemory;
86 ANeuralNetworksExecution_startCompute_fn ANeuralNetworksExecution_startCompute;
87 ANeuralNetworksEvent_wait_fn ANeuralNetworksEvent_wait;
88 ANeuralNetworksEvent_free_fn ANeuralNetworksEvent_free;
90 void* functions[DLNNAPI_FUNCTION_COUNT];
99 bool dlnnapi_load(
struct dlnnapi* nnapi, uint32_t flags);
100 void dlnnapi_free(
struct dlnnapi* nnapi);
struct ANeuralNetworksExecution ANeuralNetworksExecution
ANeuralNetworksExecution is an opaque type that can be used to apply a machine learning model to a se...
struct ANeuralNetworksCompilation ANeuralNetworksCompilation
ANeuralNetworksCompilation is an opaque type that can be used to compile a machine learning model...
ANeuralNetworksOperandType describes the type of an operand.
struct ANeuralNetworksModel ANeuralNetworksModel
ANeuralNetworksModel is an opaque type that contains a description of the mathematical operations tha...
struct ANeuralNetworksEvent ANeuralNetworksEvent
ANeuralNetworksEvent is an opaque type that represents an event that will be signaled once an executi...
struct ANeuralNetworksMemory ANeuralNetworksMemory
ANeuralNetworksMemory is an opaque type that represents memory.