}
// Create Code Block Builder
+ SubnetBlockCompiler subnet_compiler{mem};
HostBlockCompiler host_compiler{mem};
for (auto blk = m->block()->head(); blk; blk = blk->next())
if (auto binder = _code->ann()->find(blk))
{
- throw std::runtime_error{"NYI; Android NN codegen is not supported, yet"};
+ // Generate code that invokes Android NN sub-network
+ auto lines = subnet_compiler.compile(binder);
+ invoke.body.append(*lines);
}
else
{
return std::move(res);
}
+std::unique_ptr<pp::MultiLineText> SubnetBlockCompiler::compile(const ANNBinder *binder) const
+{
+ auto res = nncc::foundation::make_unique<pp::LinearDocument>();
+
+ // TODO Generate appropriate code
+ res->append(S(assert("NYI")));
+
+ return std::move(res);
+}
+
} // namespace enco
#include "ANN/Binder.h"
#include "CppGen/Global.h"
+#include "CppGen/MemoryContext.h"
#include <pp/MultiLineText.h>
enco::Global *_global;
};
+/**
+ * @brief Generate C++ code that invokes Android NN subnet
+ */
+class SubnetBlockCompiler
+{
+public:
+ SubnetBlockCompiler(const enco::MemoryContext &mem) : _mem(mem)
+ {
+ // DO NOTHING
+ }
+
+public:
+ std::unique_ptr<pp::MultiLineText> compile(const ANNBinder *binder) const;
+
+private:
+ const enco::MemoryContext &_mem;
+};
+
} // namespace enco
#endif // __ENCO_CPP_GEN_SUBNET_H__