From 37875b07745913c8a4b201423c7cf8527862c8f6 Mon Sep 17 00:00:00 2001 From: Cheongyo Bahk Date: Fri, 26 Jun 2020 16:37:16 +0900 Subject: [PATCH 1/2] User can set 'ACL_BUILD_THREADS' for parallel build This commit introduces `ACL_BUILD_THREADS`. ACL build will be done by `ACL_BUILD_THREADS` number of degree of parallelism. Note that default behavior, without `ACL_BUILD_THREADS` specified, is conserved. Signed-off-by: Cheongyo Bahk --- infra/nnfw/cmake/packages/ARMComputeConfig.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/infra/nnfw/cmake/packages/ARMComputeConfig.cmake b/infra/nnfw/cmake/packages/ARMComputeConfig.cmake index 4ee0351c6e9..67f6ef8a2da 100644 --- a/infra/nnfw/cmake/packages/ARMComputeConfig.cmake +++ b/infra/nnfw/cmake/packages/ARMComputeConfig.cmake @@ -136,8 +136,14 @@ function(_ARMCompute_Build ARMCompute_INSTALL_PREFIX) list(APPEND SCONS_OPTIONS "examples=0") list(APPEND SCONS_OPTIONS "Werror=0") list(APPEND SCONS_OPTIONS "os=${TARGET_OS}") - include(ProcessorCount) - ProcessorCount(N) + + if(DEFINED ACL_BUILD_THREADS) + set(N ${ACL_BUILD_THREADS}) + else(DEFINED ACL_BUILD_THREADS) + include(ProcessorCount) + ProcessorCount(N) + endif(DEFINED ACL_BUILD_THREADS) + if((NOT N EQUAL 0) AND BUILD_EXT_MULTITHREAD) list(APPEND SCONS_OPTIONS -j${N}) endif() From 2cc95de4cd823f3edcb138bb6523e2841767ab68 Mon Sep 17 00:00:00 2001 From: Cheongyo Bahk Date: Mon, 29 Jun 2020 12:26:49 +0900 Subject: [PATCH 2/2] Use NPROCS to set ACL parallel build --- Makefile.template | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.template b/Makefile.template index 81182eb3589..cfd07d1f240 100644 --- a/Makefile.template +++ b/Makefile.template @@ -135,6 +135,7 @@ endif NNFW_WORKSPACE="$(WORKSPACE)" NNFW_INSTALL_PREFIX=$(INSTALL_PATH) ./nnfw configure \ -DCMAKE_BUILD_TYPE=$(BUILD_TYPE_LC) \ -DNNFW_OVERLAY_DIR=$(OVERLAY_FOLDER) \ + -DACL_BUILD_THREADS=$(NPROCS) \ $(OPTIONS) touch $(TIMESTAMP_CONFIGURE)