Skip to content

Commit 6719810

Browse files
committed
chore(ci): use cpu_count.sh where possible
1 parent b041608 commit 6719810

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

scripts/c_api_tests.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,10 @@ if [[ "${BUILD_ONLY}" == "1" ]]; then
6161
exit 0
6262
fi
6363

64-
nproc_bin=nproc
6564

66-
# macOS detects CPUs differently
67-
if [[ $(uname) == "Darwin" ]]; then
68-
nproc_bin="sysctl -n hw.logicalcpu"
69-
fi
7065

7166
if [ "${WITH_FEATURE_GPU}" == "ON" ]; then
72-
ctest --output-on-failure --test-dir "." --parallel "$(${nproc_bin})" --tests-regex ".*cuda.*"
67+
ctest --output-on-failure --test-dir "." --parallel "${CPU_COUNT}" --tests-regex ".*cuda.*"
7368
else
74-
ctest --output-on-failure --test-dir "." --parallel "$(${nproc_bin})" --exclude-regex ".*cuda.*"
69+
ctest --output-on-failure --test-dir "." --parallel "${CPU_COUNT}" --exclude-regex ".*cuda.*"
7570
fi

scripts/shortint-tests.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,7 @@ fi
6767
CURR_DIR="$(dirname "$0")"
6868
ARCH_FEATURE="$("${CURR_DIR}/get_arch_feature.sh")"
6969

70-
nproc_bin=nproc
71-
72-
# macOS detects CPUs differently
73-
if [[ $(uname) == "Darwin" ]]; then
74-
nproc_bin="sysctl -n hw.logicalcpu"
75-
fi
76-
77-
n_threads_small="$(${nproc_bin})"
70+
n_threads_small="$("${CURR_DIR}"/cpu_count.sh)"
7871
n_threads_big="${n_threads_small}"
7972

8073
# TODO: automate thread selection by measuring host machine ram and loading the key sizes from the

0 commit comments

Comments
 (0)