summaryrefslogtreecommitdiff
path: root/runtimes/template
diff options
context:
space:
mode:
Diffstat (limited to 'runtimes/template')
-rw-r--r--runtimes/template/CMakeLists.txt5
-rw-r--r--runtimes/template/src/compilation.cc14
-rw-r--r--runtimes/template/src/compilation.h8
-rw-r--r--runtimes/template/src/event.cc13
-rw-r--r--runtimes/template/src/event.h8
-rw-r--r--runtimes/template/src/execution.cc33
-rw-r--r--runtimes/template/src/execution.h8
-rw-r--r--runtimes/template/src/memory.cc16
-rw-r--r--runtimes/template/src/memory.h8
-rw-r--r--runtimes/template/src/model.cc63
-rw-r--r--runtimes/template/src/model.h8
11 files changed, 184 insertions, 0 deletions
diff --git a/runtimes/template/CMakeLists.txt b/runtimes/template/CMakeLists.txt
new file mode 100644
index 000000000..146824ddc
--- /dev/null
+++ b/runtimes/template/CMakeLists.txt
@@ -0,0 +1,5 @@
+file(GLOB_RECURSE SOURCES "src/*.cc")
+
+add_library(nnapi_template SHARED ${SOURCES})
+target_include_directories(nnapi_template PUBLIC ${NNFW_INCLUDE_DIR})
+set_target_properties(nnapi_template PROPERTIES OUTPUT_NAME neuralnetworks)
diff --git a/runtimes/template/src/compilation.cc b/runtimes/template/src/compilation.cc
new file mode 100644
index 000000000..db3f3e180
--- /dev/null
+++ b/runtimes/template/src/compilation.cc
@@ -0,0 +1,14 @@
+#include <NeuralNetworks.h>
+
+#include "compilation.h"
+
+int ANeuralNetworksCompilation_create(ANeuralNetworksModel *model,
+ ANeuralNetworksCompilation **compilation)
+{
+ return ANEURALNETWORKS_NO_ERROR;
+}
+
+int ANeuralNetworksCompilation_finish(ANeuralNetworksCompilation *compilation)
+{
+ return ANEURALNETWORKS_NO_ERROR;
+}
diff --git a/runtimes/template/src/compilation.h b/runtimes/template/src/compilation.h
new file mode 100644
index 000000000..7a28742b4
--- /dev/null
+++ b/runtimes/template/src/compilation.h
@@ -0,0 +1,8 @@
+#ifndef __COMPILATION_H__
+#define __COMPILATION_H__
+
+struct ANeuralNetworksCompilation
+{
+};
+
+#endif
diff --git a/runtimes/template/src/event.cc b/runtimes/template/src/event.cc
new file mode 100644
index 000000000..56b794608
--- /dev/null
+++ b/runtimes/template/src/event.cc
@@ -0,0 +1,13 @@
+#include <NeuralNetworks.h>
+
+#include "event.h"
+
+int ANeuralNetworksEvent_wait(ANeuralNetworksEvent *event)
+{
+ return ANEURALNETWORKS_NO_ERROR;
+}
+
+void ANeuralNetworksEvent_free(ANeuralNetworksEvent *event)
+{
+ delete event;
+}
diff --git a/runtimes/template/src/event.h b/runtimes/template/src/event.h
new file mode 100644
index 000000000..7197f0410
--- /dev/null
+++ b/runtimes/template/src/event.h
@@ -0,0 +1,8 @@
+#ifndef __EVENT_H__
+#define __EVENT_H__
+
+struct ANeuralNetworksEvent
+{
+};
+
+#endif
diff --git a/runtimes/template/src/execution.cc b/runtimes/template/src/execution.cc
new file mode 100644
index 000000000..3a418195a
--- /dev/null
+++ b/runtimes/template/src/execution.cc
@@ -0,0 +1,33 @@
+#include <NeuralNetworks.h>
+
+#include "execution.h"
+
+int ANeuralNetworksExecution_create(ANeuralNetworksCompilation *compilation,
+ ANeuralNetworksExecution **execution)
+{
+ return ANEURALNETWORKS_NO_ERROR;
+}
+
+int ANeuralNetworksExecution_setInput(ANeuralNetworksExecution *execution, int32_t index,
+ const ANeuralNetworksOperandType *type,
+ const void *buffer, size_t length)
+{
+ return ANEURALNETWORKS_NO_ERROR;
+}
+
+int ANeuralNetworksExecution_setOutput(ANeuralNetworksExecution *execution, int32_t index,
+ const ANeuralNetworksOperandType *type, void *buffer,
+ size_t length)
+{
+ return ANEURALNETWORKS_NO_ERROR;
+}
+
+int ANeuralNetworksExecution_startCompute(ANeuralNetworksExecution *execution,
+ ANeuralNetworksEvent **event)
+{
+ return ANEURALNETWORKS_NO_ERROR;
+}
+
+void ANeuralNetworksExecution_free(ANeuralNetworksExecution *execution)
+{
+}
diff --git a/runtimes/template/src/execution.h b/runtimes/template/src/execution.h
new file mode 100644
index 000000000..84d4e88e9
--- /dev/null
+++ b/runtimes/template/src/execution.h
@@ -0,0 +1,8 @@
+#ifndef __EXECUTION_H__
+#define __EXECUTION_H__
+
+struct ANeuralNetworksExecution
+{
+};
+
+#endif
diff --git a/runtimes/template/src/memory.cc b/runtimes/template/src/memory.cc
new file mode 100644
index 000000000..9579f6e71
--- /dev/null
+++ b/runtimes/template/src/memory.cc
@@ -0,0 +1,16 @@
+#include <NeuralNetworks.h>
+
+#include "memory.h"
+
+int ANeuralNetworksMemory_createFromFd(size_t size, int protect, int fd, size_t offset,
+ ANeuralNetworksMemory **memory)
+{
+ *memory = new ANeuralNetworksMemory{};
+
+ return ANEURALNETWORKS_NO_ERROR;
+}
+
+void ANeuralNetworksMemory_free(ANeuralNetworksMemory *memory)
+{
+ delete memory;
+}
diff --git a/runtimes/template/src/memory.h b/runtimes/template/src/memory.h
new file mode 100644
index 000000000..a4fed8221
--- /dev/null
+++ b/runtimes/template/src/memory.h
@@ -0,0 +1,8 @@
+#ifndef __MEMORY_H__
+#define __MEMORY_H__
+
+struct ANeuralNetworksMemory
+{
+};
+
+#endif // __MEMORY_H__
diff --git a/runtimes/template/src/model.cc b/runtimes/template/src/model.cc
new file mode 100644
index 000000000..f2d65d2b2
--- /dev/null
+++ b/runtimes/template/src/model.cc
@@ -0,0 +1,63 @@
+#include <NeuralNetworks.h>
+#include <NeuralNetworksEx.h>
+
+#include "model.h"
+
+int ANeuralNetworksModel_create(ANeuralNetworksModel **model)
+{
+ return ANEURALNETWORKS_NO_ERROR;
+}
+
+void ANeuralNetworksModel_free(ANeuralNetworksModel *model)
+{
+}
+
+int ANeuralNetworksModel_addOperand(ANeuralNetworksModel *model,
+ const ANeuralNetworksOperandType *type)
+{
+ return ANEURALNETWORKS_NO_ERROR;
+}
+
+int ANeuralNetworksModel_setOperandValue(ANeuralNetworksModel *model, int32_t index,
+ const void *buffer, size_t length)
+{
+ return ANEURALNETWORKS_NO_ERROR;
+}
+
+int ANeuralNetworksModel_setOperandValueFromMemory(ANeuralNetworksModel *model,
+ int32_t index,
+ const ANeuralNetworksMemory *memory,
+ size_t offset, size_t length)
+{
+ return ANEURALNETWORKS_NO_ERROR;
+}
+
+int ANeuralNetworksModel_addOperation(ANeuralNetworksModel *model,
+ ANeuralNetworksOperationType type, uint32_t inputCount,
+ const uint32_t *inputs, uint32_t outputCount,
+ const uint32_t *outputs)
+{
+ return ANEURALNETWORKS_NO_ERROR;
+}
+
+int ANeuralNetworksModel_addOperationEx(ANeuralNetworksModel* model,
+ ANeuralNetworksOperationTypeEx type, uint32_t inputCount,
+ const uint32_t* inputs, uint32_t outputCount,
+ const uint32_t* outputs)
+{
+ return ANEURALNETWORKS_NO_ERROR;
+}
+
+int ANeuralNetworksModel_identifyInputsAndOutputs(ANeuralNetworksModel *model,
+ uint32_t inputCount,
+ const uint32_t *inputs,
+ uint32_t outputCount,
+ const uint32_t *outputs)
+{
+ return ANEURALNETWORKS_NO_ERROR;
+}
+
+int ANeuralNetworksModel_finish(ANeuralNetworksModel *model)
+{
+ return ANEURALNETWORKS_NO_ERROR;
+}
diff --git a/runtimes/template/src/model.h b/runtimes/template/src/model.h
new file mode 100644
index 000000000..8da8f747f
--- /dev/null
+++ b/runtimes/template/src/model.h
@@ -0,0 +1,8 @@
+#ifndef __MODEL_H__
+#define __MODEL_H__
+
+struct ANeuralNetworksModel
+{
+};
+
+#endif // __MODEL_H__