#ifndef ANDROID_ML_NN_RUNTIME_EXECUTION_BUILDER_H
#define ANDROID_ML_NN_RUNTIME_EXECUTION_BUILDER_H
-#if 0 // REF-ANN
#include "Callbacks.h"
-#endif
#include "HalInterfaces.h"
#include "Memory.h"
#include "ModelBuilder.h"
#include <vector>
#if 0 // REF-ANN
-using ::android::hardware::neuralnetworks::V1_0::implementation::ExecutionCallback;
using ::android::hardware::neuralnetworks::V1_0::implementation::PreparedModelCallback;
#endif
+using ::android::hardware::neuralnetworks::V1_0::implementation::ExecutionCallback;
namespace android {
namespace nn {
// that implements the functionality.
#include "NeuralNetworks.h"
-
+#include "Callbacks.h"
#include "CompilationBuilder.h"
#include "ExecutionBuilder.h"
#include "ModelBuilder.h"
static_assert(static_cast<int32_t>(FusedActivationFunc::RELU6) == ANEURALNETWORKS_FUSED_RELU6,
"FusedActivationFunc::RELU6 != ANEURALNETWORKS_FUSED_RELU6");
-using android::sp;
#endif
+using android::sp;
using namespace android::nn;
int ANeuralNetworksMemory_createFromFd(size_t size, int prot, int fd, size_t offset,
}
int ANeuralNetworksEvent_wait(ANeuralNetworksEvent* event) {
- // Dummy Implementation
- return ANEURALNETWORKS_NO_ERROR;
-
- // Original code for reference
-#if 0
if (event == nullptr) {
LOG(ERROR) << "ANeuralNetworksEvent_wait passed a nullptr";
return ANEURALNETWORKS_UNEXPECTED_NULL;
sp<ExecutionCallback>* e = reinterpret_cast<sp<ExecutionCallback>*>(event);
(*e)->wait();
return ANEURALNETWORKS_NO_ERROR;
-#endif
}
void ANeuralNetworksEvent_free(ANeuralNetworksEvent* event) {
- // Original code for reference
-#if 0
// No validation. Free of nullptr is valid.
if (event) {
sp<ExecutionCallback>* e = reinterpret_cast<sp<ExecutionCallback>*>(event);
(*e)->wait();
delete e;
}
-#endif
}