file(GLOB_RECURSE SOURCES_INTERNAL "src/internal/*.cc")
file(GLOB_RECURSE SOURCES_GRAPH "src/graph/*.cc")
file(GLOB_RECURSE SOURCES_LINEAR "src/linear/*.cc")
-file(GLOB_RECURSE SOURCES_CODEGEN "src/codegen/*.cc")
file(GLOB_RECURSE SOURCES_DUMPER "src/dumper/*.cc")
file(GLOB_RECURSE SOURCES_COMPILER "src/compiler/*.cc")
file(GLOB_RECURSE SOURCES_VERIFIER "src/verifier/*.cc")
file(GLOB_RECURSE SOURCES_VERIFIER "src/util/*.cc")
-set(SOURCES ${SOURCES} ${SOURCES_FRONTEND} ${SOURCES_BACKEND} ${SOURCES_INTERNAL} ${SOURCES_GRAPH} ${SOURCES_LINEAR} ${SOURCES_CODEGEN} ${SOURCES_DUMPER} ${SOURCES_COMPILER} ${SOURCES_VERIFIER})
+set(SOURCES ${SOURCES} ${SOURCES_FRONTEND} ${SOURCES_BACKEND} ${SOURCES_INTERNAL} ${SOURCES_GRAPH} ${SOURCES_LINEAR} ${SOURCES_DUMPER} ${SOURCES_COMPILER} ${SOURCES_VERIFIER})
# NOTE For now ARMCompute is necessary
# TODO Remove required package below(should be optional)
#define __NEURUN_COMPILER_COMPILE_H_
#include "graph/Graph.h"
-#include "codegen/Plan.h"
+#include "Plan.h"
namespace neurun
{
* @brief Construct a new Compiler object
* @param[in] model Graph model
*/
- Compiler(const std::shared_ptr<graph::Graph> &model) : _plan{new codegen::Plan{model}}
+ Compiler(const std::shared_ptr<graph::Graph> &model) : _plan{new Plan{model}}
{
// DO NOTHING
}
* @brief Return plan
* @return Plan
*/
- codegen::Plan &plan(void) { return *_plan; }
+ Plan &plan(void) { return *_plan; }
/**
* @brief Run compilation
*/
* @brief Pass plan reference
* @param[out] plan Plan reference to return
*/
- void release(std::shared_ptr<const codegen::Plan> &plan) { plan = _plan; }
+ void release(std::shared_ptr<const Plan> &plan) { plan = _plan; }
private:
- std::shared_ptr<codegen::Plan> _plan;
+ std::shared_ptr<Plan> _plan;
};
} // namespace compiler
namespace compiler
{
-ConstantInitializer::ConstantInitializer(const graph::Graph &graph, codegen::Plan &plan)
+ConstantInitializer::ConstantInitializer(const graph::Graph &graph, Plan &plan)
: _graph{graph}, _plan{plan}
{
}
#define __NEURUN_COMPILER_CONSTANT_INITIALIZER_H__
#include "graph/Graph.h"
-#include "codegen/Plan.h"
+#include "Plan.h"
namespace neurun
{
class ConstantInitializer
{
public:
- ConstantInitializer(const graph::Graph &graph, codegen::Plan &plan);
+ ConstantInitializer(const graph::Graph &graph, Plan &plan);
void operator()();
private:
const graph::Graph &_graph;
- codegen::Plan &_plan;
+ Plan &_plan;
};
} // namespace compiler
#define __NEURUN_CODEGEN_PLAN_H__
#include "graph/Graph.h"
-#include "codegen/operand/Context.h"
-#include "codegen/operation/Sequence.h"
+#include "compiler/operand/Context.h"
+#include "compiler/operation/Sequence.h"
namespace neurun
{
-namespace codegen
+namespace compiler
{
class Plan
operation::Sequence _ops;
};
-} // namespace codegen
+} // namespace compiler
} // namespace neurun
#endif // __NEURUN_CODEGEN_PLAN_H__
#ifndef __NEURUN_COMPILER_PLAN_BUILDER_H__
#define __NEURUN_COMPILER_PLAN_BUILDER_H__
-#include "codegen/Plan.h"
+#include "Plan.h"
#include "backend/interface/IStageGenerator.h"
#include "backend/interface/ITensorBuilder.h"
class ExecutionBuilder final : public IExecutionBuilder
{
public:
- ExecutionBuilder(codegen::Plan &plan) : _plan{plan}
+ ExecutionBuilder(Plan &plan) : _plan{plan}
{
// DO NOTHING
}
}
private:
- codegen::Plan &_plan;
+ Plan &_plan;
};
class PlanBuilder
{
public:
- PlanBuilder(codegen::Plan &plan) : _plan{plan}
+ PlanBuilder(Plan &plan) : _plan{plan}
{
// DO NOTHING
}
void finalize(const backend::TensorBuilderSet &tensor_builders);
private:
- codegen::Plan &_plan;
+ Plan &_plan;
private:
std::vector<Stage> _stages;
namespace neurun
{
-namespace codegen
+namespace compiler
{
namespace operand
{
}
} // namespace operand
-} // namespace codegen
+} // namespace compiler
} // namespace neurun
* limitations under the License.
*/
-#ifndef __NEURUN_CODEGEN_OPERAND_CONTEXT_H__
-#define __NEURUN_CODEGEN_OPERAND_CONTEXT_H__
+#ifndef __NEURUN_COMPILER_OPERAND_CONTEXT_H__
+#define __NEURUN_COMPILER_OPERAND_CONTEXT_H__
#include "backend/interface/operand/IObject.h"
#include "graph/operand/Index.h"
namespace neurun
{
-namespace codegen
+namespace compiler
{
namespace operand
{
};
} // namespace operand
-} // namespace codegen
+} // namespace compiler
} // namespace neurun
-#endif // __NEURUN_CODEGEN_OPERAND_CONTEXT_H__
+#endif // __NEURUN_COMPILER_OPERAND_CONTEXT_H__
namespace neurun
{
-namespace codegen
+namespace compiler
{
namespace operation
{
// NO IMPLEMENTATION YET
} // namespace operation
-} // namespace codegen
+} // namespace compiler
} // namespace neurun
* limitations under the License.
*/
-#ifndef __NEURUN_CODEGEN_OPERATION_SEQUENCE_H__
-#define __NEURUN_CODEGEN_OPERATION_SEQUENCE_H__
-
+#ifndef __NEURUN_COMPILER_OPERATION_SEQUENCE_H__
+#define __NEURUN_COMPILER_OPERATION_SEQUENCE_H__
#include <stdint.h>
#include "exec/interface/IFunction.h"
#include <memory>
namespace neurun
{
-namespace codegen
+namespace compiler
{
namespace operation
{
};
} // namespace operation
-} // namespace codegen
+} // namespace compiler
} // namespace neurun
-#endif // __NEURUN_CODEGEN_OPERATION_SEQUENCE_H__
+#endif // __NEURUN_COMPILER_OPERATION_SEQUENCE_H__
return ANEURALNETWORKS_UNEXPECTED_NULL;
}
- std::shared_ptr<const neurun::codegen::Plan> plan;
+ std::shared_ptr<const neurun::compiler::Plan> plan;
compilation->publish(plan);
#ifndef __COMPILATION_H__
#define __COMPILATION_H__
-#include "codegen/Plan.h"
-#include "graph/Graph.h"
#include "compiler/Compiler.h"
+#include "graph/Graph.h"
struct ANeuralNetworksCompilation
{
}
public:
- neurun::codegen::Plan &plan(void) { return _compiler->plan(); }
+ neurun::compiler::Plan &plan(void) { return _compiler->plan(); }
public:
- void publish(std::shared_ptr<const neurun::codegen::Plan> &plan) { _compiler->release(plan); }
+ void publish(std::shared_ptr<const neurun::compiler::Plan> &plan) { _compiler->release(plan); }
int finish();
private:
#ifndef __EXECUTION_H__
#define __EXECUTION_H__
-#include "codegen/Plan.h"
+#include "compiler/Plan.h"
#include "exec/Source.h"
#include "exec/Sink.h"
struct ANeuralNetworksExecution
{
public:
- ANeuralNetworksExecution(const std::shared_ptr<const neurun::codegen::Plan> &plan) : _plan{plan}
+ ANeuralNetworksExecution(const std::shared_ptr<const neurun::compiler::Plan> &plan) : _plan{plan}
{
_sources.resize(_plan->model().getInputs().size());
_sinks.resize(_plan->model().getOutputs().size());
}
public:
- const neurun::codegen::Plan &plan(void) const { return *_plan; }
+ const neurun::compiler::Plan &plan(void) const { return *_plan; }
private:
- std::shared_ptr<const neurun::codegen::Plan> _plan;
+ std::shared_ptr<const neurun::compiler::Plan> _plan;
public:
// TODO Use InputIndex instead of int
{
case Type::NHWC_TO_NCHW:
{
+ // TODO Fix this workaround (We may need backend::operand::IObject instead of ITensor)
auto &queue = ::arm_compute::CLScheduler::get().queue();
auto _output_cl = dynamic_cast<::arm_compute::ICLTensor *>(_output);
_output_cl->map(queue);
feature, reinterpret_cast<const float *>(input_buffer), input_size};
util::feature::nchw::View<float> into{_output};
- // TODO Fix this workaround (We may need codegen::operand::Object instead of ITensor)
::nnfw::util::feature::iterate(feature)
<< [&](uint32_t batch, uint32_t ch, uint32_t row, uint32_t col) {
const auto value = from.at(batch, ch, row, col);
}
case Type::NCHW_TO_NHWC:
{
+ // TODO Fix this workaround (We may need backend::operand::IObject instead of ITensor)
auto &queue = ::arm_compute::CLScheduler::get().queue();
auto _input_cl = dynamic_cast<::arm_compute::ICLTensor *>(_input);
_input_cl->map(queue);
{
auto feature = _shape.asFeature();
- // TODO Fix this workaround (We may need codegen::operand::Object instead of ITensor)
const util::feature::nchw::View<float> from{_input};
util::feature::nhwc::View<float> into{feature, reinterpret_cast<float *>(output_buffer),
output_size};