chore(ci): use cpu_count.sh where possible

This commit is contained in:
Mayeul@Zama
2024-11-08 15:48:58 +01:00
committed by mayeul-zama
parent bb327b09ae
commit b2e8ef6010
2 changed files with 3 additions and 15 deletions

View File

@@ -61,15 +61,10 @@ if [[ "${BUILD_ONLY}" == "1" ]]; then
exit 0
fi
nproc_bin=nproc
# macOS detects CPUs differently
if [[ $(uname) == "Darwin" ]]; then
nproc_bin="sysctl -n hw.logicalcpu"
fi
if [ "${WITH_FEATURE_GPU}" == "ON" ]; then
ctest --output-on-failure --test-dir "." --parallel "$(${nproc_bin})" --tests-regex ".*cuda.*"
ctest --output-on-failure --test-dir "." --parallel "${CPU_COUNT}" --tests-regex ".*cuda.*"
else
ctest --output-on-failure --test-dir "." --parallel "$(${nproc_bin})" --exclude-regex ".*cuda.*"
ctest --output-on-failure --test-dir "." --parallel "${CPU_COUNT}" --exclude-regex ".*cuda.*"
fi

View File

@@ -67,14 +67,7 @@ fi
CURR_DIR="$(dirname "$0")"
ARCH_FEATURE="$("${CURR_DIR}/get_arch_feature.sh")"
nproc_bin=nproc
# macOS detects CPUs differently
if [[ $(uname) == "Darwin" ]]; then
nproc_bin="sysctl -n hw.logicalcpu"
fi
n_threads_small="$(${nproc_bin})"
n_threads_small="$("${CURR_DIR}"/cpu_count.sh)"
n_threads_big="${n_threads_small}"
# TODO: automate thread selection by measuring host machine ram and loading the key sizes from the