Skip to content

Commit

Permalink
Merge pull request #216 from jrhemstad/build-cub-benchmarks
Browse files Browse the repository at this point in the history
Build cub benchmarks in build_cub.sh
  • Loading branch information
jrhemstad authored Jul 14, 2023
2 parents db2be5f + c8f9be6 commit 644f944
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
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"

0 comments on commit 644f944

Please sign in to comment.