Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Draft] Configurable parallelism #2677

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ BUILD_TYPE?=Debug
CROSS_BUILD?=0
HOST_OS?=linux
TARGET_OS?=linux
PARALLEL_BUILD?=1
PARALLEL_BUILD?=1 # TODO Rename to `ALL_PROCESSOR_BUILD` or remove this
COVERAGE_BUILD?=0
BENCHMARK_ACL_BUILD?=0
OPTIONS?=
Expand Down Expand Up @@ -139,7 +139,7 @@ endif
touch $(TIMESTAMP_CONFIGURE)

build_internal: $(BUILD_FOLDER)
NNFW_WORKSPACE="$(WORKSPACE)" NPROCS="$(NPROCS)" PARALLEL_BUILD="1" ./nnfw build
NNFW_WORKSPACE="$(WORKSPACE)" NPROCS="$(NPROCS)" PARALLEL_BUILD="$(PARALLEL_BUILD)" ./nnfw build
rm -rf $(BUILD_ALIAS)
ln -s $(BUILD_FOLDER) $(BUILD_ALIAS)
touch $(TIMESTAMP_BUILD)
Expand Down
10 changes: 8 additions & 2 deletions infra/nnfw/cmake/packages/ARMComputeConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions infra/nnfw/command/build
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import "build.configuration"

set -x

if [[ ! -d "${BUILD_PATH}" ]]; then
echo "[ERROR] '${BUILD_PATH}' does not exist. Please run 'configure' first"
exit 255
Expand Down