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

Build cub benchmarks in build_cub.sh #216

Merged
merged 6 commits into from
Jul 14, 2023
Merged
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
2 changes: 2 additions & 0 deletions ci/build_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ readonly CXX_STANDARD=$2
readonly GPU_ARCHS=$(echo $3 | tr ' ,' ';')

readonly PARALLEL_LEVEL=${PARALLEL_LEVEL:=$(nproc)}
readonly NVCC_VERSION=$(nvcc --version | grep release | awk '{print $6}' | cut -c2-)

if [ -z ${DEVCONTAINER_NAME+x} ]; then
BUILD_DIR=../build/local
Expand All @@ -47,6 +48,7 @@ COMMON_CMAKE_OPTIONS="
echo "========================================"
echo "Begin build"
echo "pwd=$(pwd)"
echo "NVCC_VERSION=$NVCC_VERSION"
echo "HOST_COMPILER=$HOST_COMPILER"
echo "CXX_STANDARD=$CXX_STANDARD"
echo "GPU_ARCHS=$GPU_ARCHS"
Expand Down
19 changes: 19 additions & 0 deletions ci/build_cub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

source "$(dirname "$0")/build_common.sh"


# CUB benchmarks require at least CUDA nvcc 11.5 for int128
# Returns "true" if the first version is greater than or equal to the second
version_compare() {
if [[ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" == "$2" ]]; then
echo "true"
else
echo "false"
fi
}
readonly ENABLE_CUB_BENCHMARKS=$(version_compare $NVCC_VERSION 11.5)

if [[ $ENABLE_CUB_BENCHMARKS == "true" ]]; then
echo "CUDA version is $NVCC_VERSION. Building CUB benchmarks."
else
echo "CUDA version is $NVCC_VERSION. Not building CUB benchmarks because CUDA version is less than 11.5."
fi

CMAKE_OPTIONS="
-DCCCL_ENABLE_THRUST=OFF \
-DCCCL_ENABLE_LIBCUDACXX=OFF \
Expand All @@ -13,6 +31,7 @@ CMAKE_OPTIONS="
-DCUB_ENABLE_DIALECT_CPP20=$(if [[ $CXX_STANDARD -ne 20 ]]; then echo "OFF"; else echo "ON"; fi) \
-DTHRUST_IGNORE_DEPRECATED_CPP_DIALECT=ON \
-DCUB_IGNORE_DEPRECATED_CPP_DIALECT=ON \
-DCUB_ENABLE_BENCHMARKS="$ENABLE_CUB_BENCHMARKS"\
"

configure_and_build "CUB" "$CMAKE_OPTIONS"
Loading