return ANEURALNETWORKS_NO_ERROR;
}
-#if 0 // REF-ANN
-int ModelArgumentInfo::setFromTemporaryMemory(const Operand& operand,
- uint32_t poolIndex, uint32_t offset) {
- dimensions = operand.dimensions;
- state = ModelArgumentInfo::MEMORY;
- locationAndLength =
- {.poolIndex = poolIndex, .offset = offset, .length = sizeOfData(operand)};
- buffer = nullptr;
- return ANEURALNETWORKS_NO_ERROR;
-}
-
-#endif
int ModelArgumentInfo::updateDimensionInfo(const Operand& operand,
const ANeuralNetworksOperandType* newType) {
if (newType == nullptr) {
}
}
-int StepExecutor::setInputOrOutputFromTemporaryMemory(const Operand& inputOrOutputOperand,
- const Memory* memory, uint32_t offset,
- ModelArgumentInfo* inputOrOutputInfo) {
- // Should be similar to
- // ExecutionBuilder::setInputFromMemory()
- // ExecutionBuilder::setOutputFromMemory()
-
- uint32_t poolIndex = mMemories.add(memory);
- return inputOrOutputInfo->setFromTemporaryMemory(inputOrOutputOperand, poolIndex, offset);
-}
#endif // REF-ANN
int StepExecutor::startCompute(sp<ExecutionCallback>* synchronizationCallback) {
#if 0 // REF-ANN
uint32_t length);
int setFromMemory(const Operand& operand, const ANeuralNetworksOperandType* type,
uint32_t poolIndex, uint32_t offset, uint32_t length);
-#if 0 // REF-ANN
- int setFromTemporaryMemory(const Operand& operand, uint32_t poolIndex, uint32_t offset);
-#endif
int updateDimensionInfo(const Operand& operand, const ANeuralNetworksOperandType* newType);
};
&mOutputs[executorIndex]);
}
- // The input or output is assumed to have the size of the
- // corresponding operand.
- int setInputFromTemporaryMemory(uint32_t inputIndex, const Memory* memory, uint32_t offset) {
- return setInputOrOutputFromTemporaryMemory(mModel->getInputOperand(inputIndex),
- memory, offset,
- &mInputs.at(inputIndex));
- }
- int setOutputFromTemporaryMemory(uint32_t outputIndex, const Memory* memory, uint32_t offset) {
- return setInputOrOutputFromTemporaryMemory(mModel->getOutputOperand(outputIndex),
- memory, offset,
- &mOutputs.at(outputIndex));
- }
#endif // REF-ANN
// Executes using the (driver, preparedModel) specified at construction time.
int startCompute(sp<ExecutionCallback>* synchronizationCallback);
void mapInputOrOutput(const ModelArgumentInfo& builderInputOrOutput,
ModelArgumentInfo* executorInputOrOutput);
- int setInputOrOutputFromTemporaryMemory(const Operand& inputOrOutputOperand,
- const Memory* memory, uint32_t offset,
- ModelArgumentInfo* inputOrOutputInfo);
-
// describes the full (possibly multiple-"step") execution
#endif // REF-ANN
private: