Skip to content

Commit

Permalink
Fix formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhemstad committed Jul 13, 2023
1 parent 5848f62 commit c8f9be6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ci/build_cub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ 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() { [ "$1" = "$(echo -e "$1\n$2" | sort -Vr | head -n1)" ] }
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
Expand All @@ -14,7 +20,6 @@ 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 @@ -26,7 +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}" \
-DCUB_ENABLE_BENCHMARKS="$ENABLE_CUB_BENCHMARKS"\
"

configure_and_build "CUB" "$CMAKE_OPTIONS"

0 comments on commit c8f9be6

Please sign in to comment.