#include "Swizzle.h"
+using ::neurun::compiler::IExecutionBuilder;
+
template <typename T> std::unique_ptr<T> make_layer(void) { return std::unique_ptr<T>{new T}; }
std::unique_ptr<::neurun::backend::acl_cl::kernel::CLFunction>
class ActivationBuilder
{
public:
- ActivationBuilder(compiler::IExecutionBuilder &builder) : _builder(builder)
+ ActivationBuilder(IExecutionBuilder &builder) : _builder(builder)
{
// DO NOTHING
}
void append(FuseCode code, ::arm_compute::ICLTensor *tensor);
private:
- compiler::IExecutionBuilder &_builder;
+ IExecutionBuilder &_builder;
};
void ActivationBuilder::appendReLU(::arm_compute::ICLTensor *ifm_alloc)
auto tensors = _tensor_builder;
- returnStage([tensors, param](compiler::IExecutionBuilder &builder) {
+ returnStage([tensors, param](IExecutionBuilder &builder) {
auto ofm_alloc = tensors->at(param.ofm_index).get();
auto ifm_alloc = tensors->at(param.ifm_index).get();
auto tensors = _tensor_builder;
- returnStage([tensors, param](compiler::IExecutionBuilder &builder) {
+ returnStage([tensors, param](IExecutionBuilder &builder) {
auto ofm_alloc = tensors->at(param.ofm_index).get();
auto ifm_alloc = tensors->at(param.ifm_index).get();
auto ker_alloc = tensors->at(param.ker_index).get();
auto tensors = _tensor_builder;
- returnStage([tensors, param](compiler::IExecutionBuilder &builder) {
+ returnStage([tensors, param](IExecutionBuilder &builder) {
auto ofm_alloc = tensors->at(param.ofm_index).get();
auto ifm_alloc = tensors->at(param.ifm_index).get();
auto ker_alloc = tensors->at(param.ker_index).get();
auto tensors = _tensor_builder;
- returnStage([tensors, param](compiler::IExecutionBuilder &builder) {
+ returnStage([tensors, param](IExecutionBuilder &builder) {
auto ofm_alloc = tensors->at(param.ofm_index).get();
auto ifm_alloc = tensors->at(param.ifm_index).get();
auto tensors = _tensor_builder;
- returnStage([tensors, param](compiler::IExecutionBuilder &builder) {
+ returnStage([tensors, param](IExecutionBuilder &builder) {
auto ofm_alloc = tensors->at(param.ofm_index).get();
auto ifm_alloc = tensors->at(param.ifm_index).get();
auto tensors = _tensor_builder;
- returnStage([tensors, param](compiler::IExecutionBuilder &builder) {
+ returnStage([tensors, param](IExecutionBuilder &builder) {
// If tensor allocator allocate as subtensor
bool canEliminate = true;
for (auto ifm_ind : param.input_indexes)
param.needs_reshape = needs_reshape;
param.reshape = reshape;
- returnStage([tensors, param](compiler::IExecutionBuilder &builder) {
+ returnStage([tensors, param](IExecutionBuilder &builder) {
auto output_alloc = tensors->at(param.output_index).get();
auto input_alloc = tensors->at(param.input_index).get();
auto weight_alloc = tensors->at(param.weight_index).get();
auto tensors = _tensor_builder;
- returnStage([tensors, param](compiler::IExecutionBuilder &builder) {
+ returnStage([tensors, param](IExecutionBuilder &builder) {
auto ofm_alloc = tensors->at(param.ofm_index).get();
auto lhs_alloc = tensors->at(param.lhs_index).get();
auto rhs_alloc = tensors->at(param.rhs_index).get();
tensors->dimCorrection(input_index, false);
tensors->dimCorrection(output_index, false);
- returnStage([tensors, param](compiler::IExecutionBuilder &builder) {
+ returnStage([tensors, param](IExecutionBuilder &builder) {
auto output_alloc = tensors->at(param.output_index).get();
auto input_alloc = tensors->at(param.input_index).get();
auto tensors = _tensor_builder;
- returnStage([tensors, param](compiler::IExecutionBuilder &builder) {
+ returnStage([tensors, param](IExecutionBuilder &builder) {
auto output_alloc = tensors->at(param.output_index).get();
auto input_alloc = tensors->at(param.input_index).get();
auto tensors = _tensor_builder;
- returnStage([tensors, param](compiler::IExecutionBuilder &builder) {
+ returnStage([tensors, param](IExecutionBuilder &builder) {
auto output_alloc = tensors->at(param.output_index).get();
auto input_alloc = tensors->at(param.input_index).get();
auto tensors = _tensor_builder;
- returnStage([tensors, param](compiler::IExecutionBuilder &builder) {
+ returnStage([tensors, param](IExecutionBuilder &builder) {
auto outputData_alloc = tensors->at(param.outputData_index).get();
auto inputData_alloc = tensors->at(param.inputData_index).get();
auto tensors = _tensor_builder;
- returnStage([tensors, param](compiler::IExecutionBuilder &builder) {
+ returnStage([tensors, param](IExecutionBuilder &builder) {
auto ofm_alloc = tensors->at(param.ofm_idx).get();
auto ifm_alloc = tensors->at(param.ifm_idx).get();
const auto pv = getARMComputePermutationVector(param.rank, param.pv);
auto tensors = _tensor_builder;
- returnStage([tensors, param](compiler::IExecutionBuilder &builder) {
+ returnStage([tensors, param](IExecutionBuilder &builder) {
auto ofm_alloc = tensors->at(param.ofm_index).get();
auto lhs_alloc = tensors->at(param.lhs_index).get();
auto rhs_alloc = tensors->at(param.rhs_index).get();
auto tensors = _tensor_builder;
- returnStage([tensors, param](compiler::IExecutionBuilder &builder) {
+ returnStage([tensors, param](IExecutionBuilder &builder) {
auto ofm_alloc = tensors->at(param.ofm_index).get();
auto lhs_alloc = tensors->at(param.lhs_index).get();
auto rhs_alloc = tensors->at(param.rhs_index).get();
auto tensors = _tensor_builder;
- returnStage([tensors, param](compiler::IExecutionBuilder &builder) {
+ returnStage([tensors, param](IExecutionBuilder &builder) {
auto ofm_alloc = tensors->at(param.ofm_index).get();
auto lhs_alloc = tensors->at(param.lhs_index).get();
auto rhs_alloc = tensors->at(param.rhs_index).get();