Skip to content

Commit

Permalink
update CGraph to latest version, small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zpye committed May 11, 2023
1 parent 61c1706 commit b665bb8
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@
[submodule "3rdparty/Catch2"]
path = 3rdparty/Catch2
url = https://github.com/catchorg/Catch2.git
[submodule "3rdparty/pybind11"]
path = 3rdparty/pybind11
url = https://github.com/pybind/pybind11.git
[submodule "3rdparty/highway"]
path = 3rdparty/highway
url = https://github.com/google/highway.git
2 changes: 1 addition & 1 deletion 3rdparty/CGraph
Submodule CGraph updated 71 files
+2 −0 CGraph-build.sh
+23 −0 CGraph-docker-env.sh
+40 −12 CMakeLists.txt
+32 −14 README.md
+9 −7 README_en.md
+14 −1 cmake/CGraph-env-include.cmake
+ doc/xmind/CGraph Intro.xmind
+13 −0 dockerfile
+2 −0 src/CBasic/CDescInfo.h
+1 −1 src/CBasic/CException.h
+17 −17 src/CBasic/CStatus.h
+7 −5 src/CBasic/CStrDefine.h
+0 −2 src/GraphCtrl/GraphAspect/GAspectDefine.h
+1 −3 src/GraphCtrl/GraphAspect/GAspectManager.h
+1 −1 src/GraphCtrl/GraphDaemon/GDaemon.cpp
+1 −1 src/GraphCtrl/GraphDaemon/GDaemon.h
+1 −1 src/GraphCtrl/GraphDaemon/GDaemonManager.h
+33 −8 src/GraphCtrl/GraphElement/GElement.cpp
+34 −9 src/GraphCtrl/GraphElement/GElement.h
+4 −3 src/GraphCtrl/GraphElement/GElementDefine.h
+8 −1 src/GraphCtrl/GraphElement/GElementManager.cpp
+2 −6 src/GraphCtrl/GraphElement/GElementManager.h
+12 −1 src/GraphCtrl/GraphElement/GGroup/GCluster/GCluster.cpp
+7 −1 src/GraphCtrl/GraphElement/GGroup/GCluster/GCluster.h
+2 −1 src/GraphCtrl/GraphElement/GGroup/GRegion/GRegion.cpp
+0 −10 src/GraphCtrl/GraphElement/GNode/GNode.cpp
+0 −8 src/GraphCtrl/GraphElement/GNode/GNode.h
+18 −7 src/GraphCtrl/GraphElement/_GEngine/GDynamicEngine/GDynamicEngine.cpp
+2 −1 src/GraphCtrl/GraphElement/_GEngine/GDynamicEngine/GDynamicEngine.h
+16 −0 src/GraphCtrl/GraphElement/_GEngine/GEngine.h
+10 −8 src/GraphCtrl/GraphElement/_GEngine/GStaticEngine/GStaticEngine.cpp
+1 −1 src/GraphCtrl/GraphManager.h
+4 −3 src/GraphCtrl/GraphMessage/GMessage.h
+6 −4 src/GraphCtrl/GraphMessage/GMessageManager.h
+25 −18 src/GraphCtrl/GraphMessage/GMessageUtils.h
+4 −0 src/GraphCtrl/GraphParam/GParam.cpp
+2 −2 src/GraphCtrl/GraphParam/GParam.h
+23 −12 src/GraphCtrl/GraphPipeline/GPipeline.cpp
+11 −1 src/GraphCtrl/GraphPipeline/GPipeline.h
+0 −1 src/GraphCtrl/GraphPipeline/GPipelineInclude.h
+1 −1 src/GraphCtrl/GraphPipeline/GPipelineManager.cpp
+1 −1 src/GraphCtrl/GraphPipeline/GPipelineManager.h
+76 −0 src/GraphCtrl/GraphPipeline/_GSchedule/GSchedule.cpp
+51 −0 src/GraphCtrl/GraphPipeline/_GSchedule/GSchedule.h
+23 −0 src/GraphCtrl/GraphPipeline/_GSchedule/GScheduleDefine.h
+15 −0 src/GraphCtrl/GraphPipeline/_GSchedule/GScheduleInclude.h
+11 −18 src/UtilsCtrl/Lru/ULru.h
+2 −3 src/UtilsCtrl/Random/URandom.h
+1 −1 src/UtilsCtrl/ThreadPool/Queue/UAtomicPriorityQueue.h
+12 −4 src/UtilsCtrl/ThreadPool/Queue/UAtomicQueue.h
+11 −4 src/UtilsCtrl/ThreadPool/Queue/UAtomicRingBufferQueue.h
+2 −2 src/UtilsCtrl/ThreadPool/Task/UTaskGroup.h
+36 −2 src/UtilsCtrl/ThreadPool/Thread/UThreadBase.h
+4 −21 src/UtilsCtrl/ThreadPool/Thread/UThreadPrimary.h
+3 −19 src/UtilsCtrl/ThreadPool/Thread/UThreadSecondary.h
+10 −15 src/UtilsCtrl/ThreadPool/UThreadPool.cpp
+8 −3 src/UtilsCtrl/ThreadPool/UThreadPool.h
+2 −2 src/UtilsCtrl/ThreadPool/UThreadPool.inl
+1 −13 src/UtilsCtrl/ThreadPool/UThreadPoolConfig.h
+2 −3 src/UtilsCtrl/ThreadPool/UThreadPoolDefine.h
+4 −6 src/UtilsCtrl/Timer/UTimer.h
+1 −0 src/UtilsCtrl/UtilsDefine.h
+0 −34 tutorial/CMakeLists.txt
+1 −1 tutorial/MyGNode/MyHoldNode.h
+1 −1 tutorial/MyParams/MyMessageParam.h
+7 −0 tutorial/T01-Simple.cpp
+5 −1 tutorial/T05-Param.cpp
+17 −9 tutorial/T07-MultiPipeline.cpp
+1 −1 tutorial/T09-Aspect.cpp
+16 −4 tutorial/TU02-Lru.cpp
+1 −1 xmake.lua
1 change: 1 addition & 0 deletions 3rdparty/highway
Submodule highway added at 091fe0
1 change: 1 addition & 0 deletions 3rdparty/pybind11
Submodule pybind11 added at 956390
15 changes: 13 additions & 2 deletions src/engine_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,17 @@ Status EngineImpl::CreatePipeline() {
}
}

{
// pipiline config
pipeline_->setGEngineType(CGraph::GEngineType::STATIC);

// TODO: set by user
pipeline_thread_pool_config_.default_thread_size_ = 2;
pipeline_thread_pool_config_.max_thread_size_ = 4;

pipeline_->setUniqueThreadPoolConfig(pipeline_thread_pool_config_);
}

{
CStatus ret = pipeline_->init();
if (!ret.isOK()) {
Expand Down Expand Up @@ -497,7 +508,7 @@ const std::vector<std::string> EngineImpl::OutputNames() {
Status EngineImpl::Input(const std::string& name, const Tensor& input) {
if (input_tensor_nodes_.count(name) <= 0) {
LOG(ERROR) << "tensor [" << name << "] is not an input tensor";
Status::kFail;
return Status::kFail;
}

input_tensor_nodes_[name]->tensor = input;
Expand All @@ -521,7 +532,7 @@ Status EngineImpl::Forward() {
Status EngineImpl::Extract(const std::string& name, Tensor& output) {
if (output_tensor_nodes_.count(name) <= 0) {
LOG(ERROR) << "tensor [" << name << "] is not an output tensor";
Status::kFail;
return Status::kFail;
}

output = output_tensor_nodes_[name]->tensor;
Expand Down
1 change: 1 addition & 0 deletions src/engine_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class EngineImpl {
std::map<std::string, TensorNode*> output_tensor_nodes_;

CGraph::GPipelinePtr pipeline_ = nullptr;
CGraph::UThreadPoolConfig pipeline_thread_pool_config_;
std::map<std::string, PipelineNode*> pipeline_nodes_;
};

Expand Down

0 comments on commit b665bb8

Please sign in to comment.