aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/source/changelog.rst5
-rw-r--r--docs/source/using_api.rst6
-rw-r--r--tidl_api/src/subgraph_runtime.cpp10
3 files changed, 18 insertions, 3 deletions
diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst
index 42c4cf1..da4370f 100644
--- a/docs/source/changelog.rst
+++ b/docs/source/changelog.rst
@@ -2,11 +2,12 @@
2Changelog 2Changelog
3######### 3#########
4 4
51.5.0 [Processor Linux SDK 6.3] 51.5.1 [Processor Linux SDK 6.3]
6=============================== 6===============================
7**Changed** 7**Changed**
8 8
9#. Cleaned up subgraph cfg file entries. Added TIDL_SUBGRAPH_DIR env var. 9#. Cleaned up subgraph cfg file entries. Added TIDL_SUBGRAPH_DIR and
10 TIDL_SUBGRAPH_NUM_EVES env var.
10 11
111.4.0 [Processor Linux SDK 6.2] 121.4.0 [Processor Linux SDK 6.2]
12=============================== 13===============================
diff --git a/docs/source/using_api.rst b/docs/source/using_api.rst
index d56bd52..f744690 100644
--- a/docs/source/using_api.rst
+++ b/docs/source/using_api.rst
@@ -326,7 +326,7 @@ Subgraph config file
326 326
327Subgraph config file are named as "subgraph<number>.cfg", while <number> 327Subgraph config file are named as "subgraph<number>.cfg", while <number>
328is the subgraph index in the original graph/network. The environment 328is the subgraph index in the original graph/network. The environment
329variable `TIDL_SUBGRAPH_DIR` speicifies the directory where subgraph config 329variable `TIDL_SUBGRAPH_DIR` specifies the directory where subgraph config
330files reside. If not specified, the current directory is assumed. 330files reside. If not specified, the current directory is assumed.
331 331
332Subgraph config file requires extra parameters to describe data conversion 332Subgraph config file requires extra parameters to describe data conversion
@@ -337,3 +337,7 @@ set of required parameters.
337Subgraph runtime API 337Subgraph runtime API
338==================== 338====================
339Please see `tidl_api/inc/subgraph_runtime.h` for details. 339Please see `tidl_api/inc/subgraph_runtime.h` for details.
340
341The envrionment variable `TIDL_SUBGRAPH_NUM_EVES` specifies the number of
342EVEs used for inferencing. If not specified, all available EVEs will be
343initialized and used.
diff --git a/tidl_api/src/subgraph_runtime.cpp b/tidl_api/src/subgraph_runtime.cpp
index 5ac6e97..12705d5 100644
--- a/tidl_api/src/subgraph_runtime.cpp
+++ b/tidl_api/src/subgraph_runtime.cpp
@@ -218,6 +218,16 @@ void ResM::Init(uint32_t num_subgraphs)
218 num_eves_m = Executor::GetNumDevices(DeviceType::EVE); 218 num_eves_m = Executor::GetNumDevices(DeviceType::EVE);
219 num_dsps_m = Executor::GetNumDevices(DeviceType::DSP); 219 num_dsps_m = Executor::GetNumDevices(DeviceType::DSP);
220 220
221 char *env_subgraph_num_eves = getenv("TIDL_SUBGRAPH_NUM_EVES");
222 if (env_subgraph_num_eves != nullptr)
223 {
224 uint32_t subgraph_num_eves = atoi(env_subgraph_num_eves);
225 if (subgraph_num_eves > 0 && subgraph_num_eves < num_eves_m)
226 num_eves_m = subgraph_num_eves;
227 if (subgraph_num_eves > 0 && subgraph_num_eves < num_dsps_m)
228 num_dsps_m = subgraph_num_eves;
229 }
230
221 assert(num_eves_m > 0 || num_dsps_m > 0); 231 assert(num_eves_m > 0 || num_dsps_m > 0);
222 assert(num_subgraphs_m <= num_eves_m || num_subgraphs_m <= num_dsps_m); 232 assert(num_subgraphs_m <= num_eves_m || num_subgraphs_m <= num_dsps_m);
223 num_es_per_subgraph_m = num_eves_m / num_subgraphs_m; 233 num_es_per_subgraph_m = num_eves_m / num_subgraphs_m;