This commit partially implements ANeuralNetworksCompilation_create with
partially defined ANeuralNetworksCompilation.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
#include <nnapi.h>
#include "compilation.h"
+#include "model.h"
ResultCode
ANeuralNetworksCompilation_create(ANeuralNetworksModel* model, ANeuralNetworksCompilation** compilation)
{
+ std::shared_ptr<const internal::tflite::Model> internal;
+
+ model->release(internal);
+
+ *compilation = new ANeuralNetworksCompilation(internal);
+
return ANEURALNETWORKS_NO_ERROR;
}
#ifndef __COMPILATION_H__
#define __COMPILATION_H__
+#include "internal/Model.h"
+
struct ANeuralNetworksCompilation
{
+public:
+ ANeuralNetworksCompilation(const std::shared_ptr<const internal::tflite::Model> &model)
+ : _model{model}
+ {
+ // DO NOTHING
+ }
+
+public:
+ const internal::tflite::Model &model(void) const { return *_model; }
+
+private:
+ std::shared_ptr<const internal::tflite::Model> _model;
};
#endif