diff --git a/.gitignore b/.gitignore index 5a000c17d..4eed7b156 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ build/ *.pb.h makefile.config etc/config +sysroot/debian-buster diff --git a/Makefile b/Makefile index 85ee784cf..7b418c5a4 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,15 @@ include makefile.config +ifdef SYSROOT + SYSROOT_FLAGS:=--sysroot=${SYSROOT} -L/usr/lib/aarch64-linux-gnu -L/usr/lib/aarch64-linux-gnu/blas + SYSROOT_RPATH:=:/usr/lib/aarch64-linux-gnu/blas:/usr/lib/aarch64-linux-gnu/lapack +else + SYSROOT_FLAGS:= + SYSROOT_RPATH:= +endif + +export CROSS_COMPILE SYSROOT SYSROOT_FLAGS SYSROOT_RPATH + MAKEBUILD=$(shell pwd)/scripts/makefile.build BUILD_DIR=$(shell pwd)/build @@ -48,10 +58,9 @@ install: $(SUB_DIRS) $(APP_SUB_DIRS): $(LIB_SUB_DIRS) -$(SUB_DIRS): +$(SUB_DIRS): ${SYSROOT} @$(MAKE) -C $@ BUILD_DIR=$(BUILD_DIR)/$@ $(MAKECMDGOALS) - distclean: find . -name $(BUILD_DIR) | xargs rm -rf find . -name $(INSTALL_DIR) | xargs rm -rf diff --git a/core/Makefile b/core/Makefile index 48bf02360..0c96fdd99 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1,21 +1,20 @@ -CC=gcc -std=gnu99 -CXX=g++ -std=c++11 -LD=g++ - +CC=${CROSS_COMPILE}gcc -std=gnu99 ${SYSROOT_FLAGS} +CXX=${CROSS_COMPILE}g++ -std=c++11 ${SYSROOT_FLAGS} +LD=${CROSS_COMPILE}g++ ${SYSROOT_FLAGS} BUILD_DIR?=$(shell pwd)/build INSTALL_DIR?=$(shell pwd)/install MAKEBUILD?=$(shell pwd)/makefile.build -export CC CXX CFLAGS LD LDFLAGS CXXFLAGS COMMON_CFLAGS +export CC CXX CFLAGS LD LDFLAGS CXXFLAGS COMMON_CFLAGS INC_DIR+=-I$(shell pwd)/../include -I$(shell pwd)/include -I$(shell pwd)/include #INC_DIR+=-I$(shell pwd)/../operator/include -CXXFLAGS+= +CXXFLAGS+= -COMMON_CFLAGS+= -Wall -g -I$(shell pwd)/include -fPIC $(INC_DIR) +COMMON_CFLAGS+= -Wall -g -I$(shell pwd)/include -fPIC $(INC_DIR) libsubdir_list=lib @@ -54,7 +53,7 @@ $(BIN_OBJS): $(binsubdir_list) build: default install -LDFLAGS+=-rdynamic +LDFLAGS+=-rdynamic ${SYSROOT_FLAGS} #$(TENGINE_OBJS): $(libsubdir_list) #$(BIN_OBJS):$(binsubdir_list) diff --git a/core/include/notify.hpp b/core/include/notify.hpp index cdfafbb66..89d62a7a2 100644 --- a/core/include/notify.hpp +++ b/core/include/notify.hpp @@ -27,6 +27,7 @@ #include #include #include +#include #include "any.hpp" diff --git a/driver/Makefile b/driver/Makefile index 34de1cd7d..32c1c28f4 100644 --- a/driver/Makefile +++ b/driver/Makefile @@ -1,13 +1,13 @@ -CC=gcc -std=gnu99 -CXX=g++ -std=c++11 -LD=g++ +CC=${CROSS_COMPILE}gcc -std=gnu99 ${SYSROOT_FLAGS} +CXX=${CROSS_COMPILE}g++ -std=c++11 ${SYSROOT_FLAGS} +LD=${CROSS_COMPILE}g++ ${SYSROOT_FLAGS} BUILD_DIR?=$(shell pwd)/build INSTALL_DIR?=$(shell pwd)/install MAKEBUILD?=$(shell pwd)/makefile.build -export CC CXX CFLAGS LD LDFLAGS CXXFLAGS COMMON_CFLAGS +export CC CXX CFLAGS LD LDFLAGS CXXFLAGS COMMON_CFLAGS INC_DIR+=-I$(shell pwd)/include INC_DIR+=-I$(shell pwd)/../include @@ -15,12 +15,12 @@ INC_DIR+=-I$(shell pwd)/../core/include INC_DIR+=-I$(shell pwd)/../operator/include INC_DIR+=-I$(shell pwd)/../executor/include -MODULE_DIR=rk3399 hikey960 plugin +MODULE_DIR=rk3399 hikey960 apq8096 plugin MODULE_NAME=libdriver.so CXXFLAGS+= -COMMON_CFLAGS+= -Wall -g -fPIC $(INC_DIR) +COMMON_CFLAGS+= -Wall -g -fPIC $(INC_DIR) ifeq ($(CONFIG_CAFFE_REF),y) COMMON_CFLAGS+= -DCONFIG_CAFFE_REF=1 endif diff --git a/driver/apq8096/Makefile b/driver/apq8096/Makefile new file mode 100644 index 000000000..97ab485c3 --- /dev/null +++ b/driver/apq8096/Makefile @@ -0,0 +1,7 @@ +obj-y+=apq8096_driver.o +obj-y+=apq8096_executor.o + +apq8096_driver_CXXFLAGS+=-I. +apq8096_executor_CXXFLAGS+=-I. + + diff --git a/driver/apq8096/apq8096_driver.cpp b/driver/apq8096/apq8096_driver.cpp new file mode 100644 index 000000000..e41696847 --- /dev/null +++ b/driver/apq8096/apq8096_driver.cpp @@ -0,0 +1,209 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Copyright (c) 2018, Open AI Lab + * Copyright (c) 2018, Linaro Ltd + * Author: haitao@openailab.com + * Author: Manivannan Sadhasivam + * Author: Mark Charlebois + */ + +#include +#include +#include + +#include "tensor_mem.hpp" +#include "apq8096_driver.hpp" +#include "apq8096_executor.hpp" +#include "logger.hpp" + + +namespace TEngine { + + +APQ8096Driver::APQ8096Driver(void) +{ + SetName("APQ8096"); + + id_table_.push_back("cpu.apq8096.kryo.all"); + id_table_.push_back("cpu.apq8096.c0.all"); + id_table_.push_back("cpu.apq8096.c1.all"); + id_table_.push_back("cpu.apq8096.kryo.0"); + id_table_.push_back("cpu.apq8096.kryo.2"); +} + + +int APQ8096Driver::ProbeDevice(void) +{ + int number=0; + + for(unsigned int i=0; iSetName(dev_id); + InitializeDevice(dev); + device_table_[dev->GetName()]=dev; + return true; + } + else if (dev_id == "cpu.apq8096.c0.all") + { + CPUDevice * dev=new KryoClusterDevice(0); + dev->SetName(dev_id); + InitializeDevice(dev); + device_table_[dev->GetName()]=dev; + return true; + } + else if(dev_id == "cpu.apq8096.c1.all") + { + CPUDevice * dev=new KryoClusterDevice(1); + dev->SetName(dev_id); + InitializeDevice(dev); + device_table_[dev->GetName()]=dev; + return true; + } + else if(dev_id == std::string("cpu.apq8096.kryo.0")) + { + CPUDevice * dev=new SingleKryoDevice(0); + dev->SetName(dev_id); + InitializeDevice(dev); + device_table_[dev->GetName()]=dev; + return true; + + } + else if(dev_id == std::string("cpu.apq8096.kryo.2")) + { + CPUDevice * dev=new SingleKryoDevice(1); + dev->SetName(dev_id); + InitializeDevice(dev); + device_table_[dev->GetName()]=dev; + return true; + } + return false; +} + +int APQ8096Driver::DestroyDevice(void) +{ + auto ir=device_table_.begin(); + auto end=device_table_.end(); + + int count=0; + + while(ir!=end) + { + if(DestroyDevice(ir->second)) { + count++; + } + else { + ir++; + } + } + + return count; +} + +bool APQ8096Driver::DestroyDevice(Device * device) +{ + CPUDevice * cpu_dev=reinterpret_cast(device); + + if(GetDeviceStatus(cpu_dev)!=kDevStopped) { + return false; + } + + ReleaseDevice(cpu_dev); + + device_table_.erase(cpu_dev->GetName()); + + delete cpu_dev; + + return true; +} + +int APQ8096Driver::GetDeviceNum(void) +{ + return device_table_.size(); +} + +Device * APQ8096Driver::GetDevice(int idx) +{ + auto ir=device_table_.begin(); + auto end=device_table_.end(); + + int i; + + for(i=0;isecond; +} + +Device * APQ8096Driver::GetDevice(const std::string& name) +{ + if(device_table_.count(name)==0) { + return nullptr; + } + return device_table_[name]; +} + + + +int APQ8096Driver::GetDevIDTableSize() +{ + return id_table_.size(); +} + +const dev_id_t& APQ8096Driver::GetDevIDbyIdx(int idx) +{ + return id_table_[idx]; +} + +bool APQ8096Driver::GetWorkload(Device * dev, DevWorkload& load) +{ + //TO BE IMPLEMENTED + return false; +} + +bool APQ8096Driver::GetPerf(Device * dev, Subgraph * graph,int policy,GraphPerf& perf) +{ + //TO BE IMPLEMENTED + return false; +} + +float APQ8096Driver::GetFops(Device * dev, Subgraph * graph) +{ + //TO BE IMPLEMENTED + return false; +} + + +} //namespace TEngine diff --git a/driver/apq8096/apq8096_executor.cpp b/driver/apq8096/apq8096_executor.cpp new file mode 100644 index 000000000..ccada539e --- /dev/null +++ b/driver/apq8096/apq8096_executor.cpp @@ -0,0 +1,143 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Copyright (c) 2018, Open AI Lab + * Copyright (c) 2018, Linaro Ltd + * Author: haitao@openailab.com + * Author: Manivannan Sadhasivam + * Author: Mark Charlebois + */ +#include "apq8096_driver.hpp" +#include "apq8096_executor.hpp" + + +namespace TEngine { + +void APQ8096Executor::DevGetWorkload(DevWorkload& load) +{ + //TO BE IMPLEMENTED; +} + + +bool APQ8096Executor::DevGetPerf(Subgraph * graph,int policy,GraphPerf& perf) +{ + //TO BE IMPLEMENTED; + return false; +} + +float APQ8096Executor::DevGetFops(Subgraph * graph) +{ + //TO BE IMPLEMENTED; + return 0; +} + +void * APQ8096Executor::DevCreateGraphHandle(Subgraph * graph) +{ + return backend_dev_->CreateGraphHandle(graph); + +} + +bool APQ8096Executor::DevOptimzeGraph(void * graph_handle) +{ + return backend_dev_->OptimizeGraph(graph_handle); +} + +bool APQ8096Executor::DevPrerun(void * graph_handle) +{ + return backend_dev_->Prerun(graph_handle); +} + +bool APQ8096Executor::DevRun(void * graph_handle) +{ + auto f=std::bind(&APQ8096Executor::OnSubgraphDone,this,std::placeholders::_1, + std::placeholders::_2); + + backend_dev_->SetGraphDoneHook(graph_handle,dev_graph_cb_t(f)); + + return backend_dev_->Run(graph_handle); +} + +bool APQ8096Executor::DevSyncRun(void * graph_handle) +{ + return backend_dev_->SyncRun(graph_handle); +} + +bool APQ8096Executor::DevPostrun(void * graph_handle) +{ + return backend_dev_->Postrun(graph_handle); +} + +bool APQ8096Executor::DevReleaseGraphHandle(void * graph_handle) +{ + return backend_dev_->ReleaseGraphHandle(graph_handle); +} + + +const dev_id_t& APQ8096Executor::DevGetID(void) +{ + return backend_dev_->GetDeviceID(); +} + +const dev_type_t & APQ8096Executor::DevGetType(void) +{ + return backend_dev_->GetDeviceType(); +} + +dev_status_t APQ8096Executor::DevGetStatus(void) +{ + return backend_dev_->GetDeviceStatus(); +} + +bool APQ8096Executor::Init(void) +{ + return true; +} + +bool APQ8096Executor::Release(void) +{ + return true; +} + +void APQ8096Executor::UnbindDevice(void) +{ + backend_dev_=nullptr; +} + +void APQ8096Executor::BindDevice(Device * device) +{ + CPUDevice * dev=dynamic_cast(device); + backend_dev_=dev; +} + +bool APQ8096Executor::DevStart(void) +{ + return backend_dev_->Start(); +} + +bool APQ8096Executor::DevStop(void) +{ + return backend_dev_->Stop(); +} + + +} //namespace TEngine + + + diff --git a/driver/include/apq8096_driver.hpp b/driver/include/apq8096_driver.hpp new file mode 100644 index 000000000..74bf418fa --- /dev/null +++ b/driver/include/apq8096_driver.hpp @@ -0,0 +1,167 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Copyright (c) 2018, Open AI Lab + * Copyright (c) 2018, Linaro Ltd + * Author: haitao@openailab.com + * Author: Manivannan Sadhasivam + * Author: Mark Charlebois + */ + +#ifndef __APQ8096_DRIVER_HPP__ +#define __APQ8096_DRIVER_HPP__ + +#include +#include +#include +#include + +#include "device_driver.hpp" +#include "cpu_driver.hpp" + +namespace TEngine { + +class APQ8096Executor; + + +class APQ8096Driver : public CPUDriver { +public: + + APQ8096Driver(); + + int ProbeDevice(void) override; + bool ProbeDevice(const dev_id_t& dev_id) override; + + int DestroyDevice(void) override; + bool DestroyDevice(Device * device) override; + + int GetDeviceNum(void) override; + Device * GetDevice(int idx) override; + Device * GetDevice(const std::string& name) override; + + bool GetWorkload(Device * dev, DevWorkload& load) override; + bool GetPerf(Device * dev, Subgraph * graph,int policy,GraphPerf& perf) override; + float GetFops(Device * dev, Subgraph * graph) override; + + int GetDevIDTableSize(); + const dev_id_t& GetDevIDbyIdx(int idx); + +protected: + + std::vector id_table_; + std::unordered_map device_table_; +}; + + + +class APQ8096Runner: public CPURunner { +public: + APQ8096Runner(void) { + if(!GetPredefinedSoc("APQ8096",soc_info)) { + throw(std::runtime_error("SoC APQ8096 is not defined yet")); + } + } +}; + + +class APQ8096Device: public CPUDevice { +public: + APQ8096Device(): CPUDevice("cpu.apq8096.kryo.all") + { + for(unsigned int i=0;i<4;i++) + { + CPUCore * cpu=new CPUCore(); + + cpu->hw_cpu_id=i; + cpu->dev=static_cast(this); + + cpu->cpu_type="A72"; + + compute_cores.push_back(cpu); + } + + master_cpu_idx=0; + compute_cores[master_cpu_idx]->master=true; + + APQ8096Runner * runner=new APQ8096Runner(); + + backend_runner=runner; + } +}; + +class SingleKryoDevice : public CPUDevice { +public: + SingleKryoDevice(unsigned int cluster_id): CPUDevice(cluster_id == 0 ? "cpu.apq8096.kryo.0" : "cpu.apq8096.kryo.2") + { + CPUCore * cpu= new CPUCore(); + cpu->hw_cpu_id=0; + cpu->cpu_type="A72"; + cpu->dev=static_cast(this); + compute_cores.push_back(cpu); + + master_cpu_idx=0; + compute_cores[master_cpu_idx]->master=true; + + APQ8096Runner * runner=new APQ8096Runner(); + + std::vector real_cpu={0}; + + runner->SetWorkingCPU(real_cpu,0); + + backend_runner=runner; + } +}; + +class KryoClusterDevice : public CPUDevice { +public: + KryoClusterDevice(unsigned int cluster_id): CPUDevice(cluster_id == 0 ? "cpu.apq8096.c0.all" : "cpu.apq8096.c1.all") + { + if(cluster_id >= 2) { + cluster_id = 1; + } + + unsigned int start = cluster_id*2; + unsigned int end = start+2; + + for(unsigned int i=start;ihw_cpu_id=i; + cpu->cpu_type="A72"; + cpu->dev=static_cast(this); + compute_cores.push_back(cpu); + } + + master_cpu_idx=0; + compute_cores[master_cpu_idx]->master=true; + + APQ8096Runner * runner=new APQ8096Runner(); + + std::vector real_cpu={static_cast(start), static_cast(start+1)}; + + runner->SetWorkingCPU(real_cpu,start); + + backend_runner=runner; + } +}; + +} //namespace TEngine + +#endif diff --git a/driver/include/apq8096_executor.hpp b/driver/include/apq8096_executor.hpp new file mode 100644 index 000000000..c2216e119 --- /dev/null +++ b/driver/include/apq8096_executor.hpp @@ -0,0 +1,78 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Copyright (c) 2018, Open AI Lab + * Copyright (c) 2018, Linaro Ltd. + * Author: haitao@openailab.com + * Author: Manivannan Sadhasivam + */ + +#ifndef __APQ8096_EXECUTOR_HPP__ +#define __APQ8096_EXECUTOR_HPP__ + +#include "generic_dev_executor.hpp" + + +namespace TEngine { + +class CPUDevice; + +class APQ8096Executor: public GenericDevExecutor { + +public: + + APQ8096Executor(const dev_id_t& dev_id) {dev_id_=dev_id;} + + void DevGetWorkload(DevWorkload& load) override; + bool DevGetPerf(Subgraph * graph,int policy,GraphPerf& perf)override; + float DevGetFops(Subgraph * graph) override; + + void * DevCreateGraphHandle(Subgraph * graph) override; + bool DevOptimzeGraph(void * graph_handle) override; + bool DevPrerun(void * graph_handle) override; + bool DevRun(void * graph_handle) override; + bool DevSyncRun(void * graph_handle) override; + bool DevPostrun(void * graph_handle) override; + bool DevReleaseGraphHandle(void * graph_handle) override; + bool DevStart(void) override; + bool DevStop(void) override; + + const dev_id_t& DevGetID(void) override; + const dev_type_t & DevGetType(void) override; + + dev_status_t DevGetStatus(void) override; + + bool Init(void) override; + bool Release(void) override; + + void UnbindDevice(void) override; + void BindDevice(Device * ) override; + + void SetDevice(CPUDevice * dev) {backend_dev_=dev;} + CPUDevice * GetDevice(void) {return backend_dev_;} +protected: + CPUDevice * backend_dev_; + dev_id_t dev_id_; + +}; + +} //namespace TEngine + +#endif diff --git a/driver/plugin/Makefile b/driver/plugin/Makefile index 139bbf562..32693130a 100644 --- a/driver/plugin/Makefile +++ b/driver/plugin/Makefile @@ -1,3 +1,3 @@ obj-y+=init.o -init_CXXFLAGS+=-I../driver/rk3399 -I../driver/hikey960 +init_CXXFLAGS+=-I../driver/rk3399 -I../driver/hikey960 -I../driver/apq8096 \ No newline at end of file diff --git a/driver/plugin/init.cpp b/driver/plugin/init.cpp index a5413e3d4..e74af399d 100644 --- a/driver/plugin/init.cpp +++ b/driver/plugin/init.cpp @@ -29,6 +29,8 @@ #include "rk3399_executor.hpp" #include "hikey960_driver.hpp" #include "hikey960_executor.hpp" +#include "apq8096_driver.hpp" +#include "apq8096_executor.hpp" extern "C" { int tengine_plugin_init(void); @@ -41,8 +43,10 @@ int tengine_plugin_init(void) RK3399Driver * rk3399=new RK3399Driver(); HIKEY960Driver * hikey960=new HIKEY960Driver(); + APQ8096Driver * apq8096=new APQ8096Driver(); DriverManager::RegisterDriver(rk3399->GetName(),rk3399); DriverManager::RegisterDriver(hikey960->GetName(),hikey960); + DriverManager::RegisterDriver(apq8096->GetName(),apq8096); //Executor Factory registration auto dev_executor_factory=DevExecutorFactory::GetFactory(); @@ -62,7 +66,15 @@ int tengine_plugin_init(void) dev_executor_factory-> RegisterInterface(hikey960->GetDevIDbyIdx(i)); } - + + //for each dev_id in driver apq8096, regiser one executor + n=apq8096->GetDevIDTableSize(); + + for(int i=0;i + RegisterInterface(apq8096->GetDevIDbyIdx(i)); + } + std::cout<<"DEV ENGINE PLUGIN INITED\n"; return 0; diff --git a/etc/config.example b/etc/config.example index 95f97ce92..32a52fd03 100644 --- a/etc/config.example +++ b/etc/config.example @@ -32,4 +32,5 @@ device.default= cpu.rk3399.a72.all #device.default= cpu.rk3399.a53.2 #device.default= cpu.rk3399.cpu.all - +#driver.probe.0=APQ8096 +#device.default= cpu.apq8096.kryo.all diff --git a/executor/Makefile b/executor/Makefile index bd7804359..ca3347cdd 100644 --- a/executor/Makefile +++ b/executor/Makefile @@ -1,6 +1,6 @@ -CC=gcc -std=gnu99 -CXX=g++ -std=c++11 -LD=g++ +CC=${CROSS_COMPILE}gcc -std=gnu99 ${SYSROOT_FLAGS} +CXX=${CROSS_COMPILE}g++ -std=c++11 ${SYSROOT_FLAGS} +LD=${CROSS_COMPILE}g++ ${SYSROOT_FLAGS} BUILD_DIR?=$(shell pwd)/build @@ -18,7 +18,7 @@ MODULE_NAME=libexecutor.so CXXFLAGS+= -COMMON_CFLAGS+= -Wall -g -fPIC $(INC_DIR) +COMMON_CFLAGS+= -Wall -g -fPIC $(INC_DIR) ifeq ($(CONFIG_CAFFE_REF),y) COMMON_CFLAGS+= -DCONFIG_CAFFE_REF=1 endif diff --git a/executor/engine/cpu_engine.cpp b/executor/engine/cpu_engine.cpp index 1867fa10b..6a5ea9537 100644 --- a/executor/engine/cpu_engine.cpp +++ b/executor/engine/cpu_engine.cpp @@ -68,7 +68,7 @@ exec_handle_t CPUEngine::AddGraphExecutor(GraphExecutor * graph_executor) if(!initialized_) { SocInfo soc_info; - std::string soc_name="RK3399"; + std::string soc_name="APQ8096"; if(!GetPredefinedSoc(soc_name,soc_info)) { diff --git a/executor/lib/soc_runner.cpp b/executor/lib/soc_runner.cpp index 846a945ee..8f486722e 100644 --- a/executor/lib/soc_runner.cpp +++ b/executor/lib/soc_runner.cpp @@ -442,7 +442,7 @@ void RegisterDefaultSoc(void) CPUInfo cpu_info; - for(int i=0;i<4;i++) + for(int i=0;iGetName()=="ReLu") - node->SetAttr("dev_id",std::string("cpu.rk3399.a53.all")); - else if(op->GetName()=="Convolution") - node->SetAttr("dev_id",std::string("cpu.rk3399.a72.all")); + node->SetAttr("dev_id",std::string("cpu.apq8096.c1.all")); + if(op->GetName()=="Convolution") + node->SetAttr("dev_id",std::string("cpu.apq8096.c0.all")); else - node->SetAttr("dev_id",std::string("cpu.rk3399.cpu.all")); + node->SetAttr("dev_id",std::string("cpu.apq8096.kyro.all")); } } diff --git a/tests/bin/test_two_dev.cpp b/tests/bin/test_two_dev.cpp index 37da896a1..35172f7f6 100644 --- a/tests/bin/test_two_dev.cpp +++ b/tests/bin/test_two_dev.cpp @@ -67,11 +67,11 @@ void assign_dev_executor(graph_t graph) continue; if(op->GetName()=="ReLu") - node->SetAttr("dev_id",std::string("cpu.rk3399.a53.all")); + node->SetAttr("dev_id",std::string("cpu.rk3399.c1.all")); else if(op->GetName()=="Convolution") - node->SetAttr("dev_id",std::string("cpu.rk3399.a72.all")); + node->SetAttr("dev_id",std::string("cpu.rk3399.c0.all")); else - node->SetAttr("dev_id",std::string("cpu.rk3399.cpu.all")); + node->SetAttr("dev_id",std::string("cpu.rk3399.kryo.all")); } } diff --git a/wrapper/Makefile b/wrapper/Makefile index 4acb4d00f..1d10e4cb6 100644 --- a/wrapper/Makefile +++ b/wrapper/Makefile @@ -1,6 +1,7 @@ -CC=gcc -std=gnu99 -CXX=g++ -std=c++11 -LD=g++ +CC=${CROSS_COMPILE}gcc -std=gnu99 ${SYSROOT_FLAGS} +CXX=${CROSS_COMPILE}g++ -std=c++11 ${SYSROOT_FLAGS} +LD=${CROSS_COMPILE}g++ ${SYSROOT_FLAGS} + BUILD_DIR?=$(shell pwd)/build @@ -19,7 +20,6 @@ MODULE_NAME=libwrapper.so CXXFLAGS+= COMMON_CFLAGS+= -Wall -g -I$(shell pwd)/include -fPIC $(INC_DIR) - libsubdir_list=$(MODULE_DIR) PLUGIN_OBJS =$(addprefix $(BUILD_DIR)/, $(foreach f,$(libsubdir_list),$(f)/built-in.o))