Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ CMakeLists.txt @rapidsai/cuvs-cmake-codeowners
#CI code owners
/.github/ @rapidsai/ci-codeowners
/ci/ @rapidsai/ci-codeowners
/.shellcheckrc @rapidsai/ci-codeowners

#packaging code owners
/.pre-commit-config.yaml @rapidsai/packaging-codeowners
Expand Down
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ repos:
rev: v0.10.0.1
hooks:
- id: shellcheck
args: ["--severity=warning"]

default_language_version:
python: python3
2 changes: 2 additions & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Disable file checks (otherwise every use of `gha-tools` will get flagged)
disable=SC1091
Comment thread
gforsyth marked this conversation as resolved.
163 changes: 83 additions & 80 deletions build.sh

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions ci/checks/black_lists.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
# Copyright (c) 2020-2023, NVIDIA CORPORATION.
# Copyright (c) 2020-2025, NVIDIA CORPORATION.
##########################################
# RAFT black listed function call Tester #
##########################################

# PR_TARGET_BRANCH is set by the CI environment

git checkout --quiet $PR_TARGET_BRANCH
git checkout --quiet "$PR_TARGET_BRANCH"

# Switch back to tip of PR branch
git checkout --quiet current-pr-branch
Expand Down
10 changes: 5 additions & 5 deletions cpp/scripts/run-cmake-format.sh
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense (if it's possible) to exclude this file from cpp-ownership?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd support that change.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright (c) 2022-2023, NVIDIA CORPORATION.
# Copyright (c) 2022-2025, NVIDIA CORPORATION.

# This script is a wrapper for cmakelang that may be used with pre-commit. The
# wrapping is necessary because RAPIDS libraries split configuration for
Expand Down Expand Up @@ -38,7 +38,7 @@ if ! [ ${status} -eq 0 ]; then
echo "This script must be run inside the raft repository, or the RAFT_ROOT environment variable must be set."
else
echo "Script failed with unknown error attempting to determine project root:"
echo ${RAFT_BUILD_DIR}
echo "${RAFT_BUILD_DIR}"
fi
exit 1
fi
Expand All @@ -49,7 +49,7 @@ DEFAULT_FORMAT_FILE_LOCATIONS=(

if [ -z ${RAPIDS_CMAKE_FORMAT_FILE:+PLACEHOLDER} ]; then
for file_path in "${DEFAULT_FORMAT_FILE_LOCATIONS[@]}"; do
if [ -f ${file_path} ]; then
if [ -f "${file_path}" ]; then
RAPIDS_CMAKE_FORMAT_FILE=${file_path}
break
fi
Expand All @@ -68,12 +68,12 @@ else
fi

if [[ $1 == "cmake-format" ]]; then
cmake-format -i --config-files cpp/cmake/config.json ${RAPIDS_CMAKE_FORMAT_FILE} -- "${@:2}"
cmake-format -i --config-files cpp/cmake/config.json "${RAPIDS_CMAKE_FORMAT_FILE}" -- "${@:2}"
elif [[ $1 == "cmake-lint" ]]; then
# Since the pre-commit hook is verbose, we have to be careful to only
# present cmake-lint's output (which is quite verbose) if we actually
# observe a failure.
OUTPUT=$(cmake-lint --config-files cpp/cmake/config.json ${RAPIDS_CMAKE_FORMAT_FILE} -- "${@:2}")
OUTPUT=$(cmake-lint --config-files cpp/cmake/config.json "${RAPIDS_CMAKE_FORMAT_FILE}" -- "${@:2}")
status=$?

if ! [ ${status} -eq 0 ]; then
Expand Down
32 changes: 16 additions & 16 deletions examples/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright (c) 2023-2024, NVIDIA CORPORATION.
# Copyright (c) 2023-2025, NVIDIA CORPORATION.

# cuvs empty project template build script

Expand All @@ -11,7 +11,7 @@ NUMARGS=$#
ARGS=$*

function hasArg {
(( ${NUMARGS} != 0 )) && (echo " ${ARGS} " | grep -q " $1 ")
(( NUMARGS != 0 )) && (echo " ${ARGS} " | grep -q " $1 ")
}

if hasArg clean; then
Expand All @@ -22,26 +22,26 @@ fi

function gpuArch {

if hasArg --allgpuarch && [[ -n $(echo $ARGS | { grep -E "\-\-gpu\-arch" || true; } ) ]]; then
if hasArg --allgpuarch && [[ -n $(echo "$ARGS" | { grep -E "\-\-gpu\-arch" || true; } ) ]]; then
echo "Error: Cannot specify both --gpu-arch and --allgpuarch"
echo "Use either:"
echo " --gpu-arch=\"80-real;90-real\" (for specific architectures)"
echo " --allgpuarch (for all supported architectures)"
exit 1
fi

if [[ $(echo $ARGS | { grep -Eo "\-\-gpu\-arch" || true; } | wc -l ) -gt 1 ]]; then
if [[ $(echo "$ARGS" | { grep -Eo "\-\-gpu\-arch" || true; } | wc -l ) -gt 1 ]]; then
echo "Error: Multiple --gpu-arch options were provided. Please combine architectures into a single option."
echo "Instead of: --gpu-arch=80-real --gpu-arch=90-real"
echo "Use: --gpu-arch=\"80-real;90-real\""
exit 1
fi

if [[ -n $(echo $ARGS | { grep -E "\-\-gpu\-arch" || true; } ) ]]; then
GPU_ARCH_ARG=$(echo $ARGS | { grep -Eo "\-\-gpu\-arch=.+( |$)" || true; })
if [[ -n $(echo "$ARGS" | { grep -E "\-\-gpu\-arch" || true; } ) ]]; then
GPU_ARCH_ARG=$(echo "$ARGS" | { grep -Eo "\-\-gpu\-arch=.+( |$)" || true; })
if [[ -n ${GPU_ARCH_ARG} ]]; then
# Extract just the architecture value
echo ${GPU_ARCH_ARG} | sed -e 's/--gpu-arch=//' -e 's/ .*//'
echo "${GPU_ARCH_ARG}" | sed -e 's/--gpu-arch=//' -e 's/ .*//'
return
fi
fi
Expand All @@ -57,10 +57,10 @@ function gpuArch {
}

# Set up build configuration
PARALLEL_LEVEL=${PARALLEL_LEVEL:=`nproc`}
PARALLEL_LEVEL=${PARALLEL_LEVEL:=$(nproc)}
BUILD_TYPE=Release
CUVS_REPO_REL=""
EXTRA_CMAKE_ARGS=""
EXTRA_CMAKE_ARGS=()


CUVS_CMAKE_CUDA_ARCHITECTURES=$(gpuArch)
Expand All @@ -74,11 +74,11 @@ esac
EXAMPLES_DIR=$(dirname "$(realpath "$0")")

if [[ ${CUVS_REPO_REL} != "" ]]; then
CUVS_REPO_PATH="`readlink -f \"${CUVS_REPO_REL}\"`"
EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DCPM_cuvs_SOURCE=${CUVS_REPO_PATH}"
CUVS_REPO_PATH=$(readlink -f "${CUVS_REPO_REL}")
EXTRA_CMAKE_ARGS+=("-DCPM_cuvs_SOURCE=${CUVS_REPO_PATH}")
else
LIB_BUILD_DIR=${LIB_BUILD_DIR:-$(readlink -f "${EXAMPLES_DIR}/../cpp/build")}
EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -Dcuvs_ROOT=${LIB_BUILD_DIR}"
EXTRA_CMAKE_ARGS+=("-Dcuvs_ROOT=${LIB_BUILD_DIR}")
fi

################################################################################
Expand All @@ -90,14 +90,14 @@ build_example() {
build_dir="${example_dir}/build"

# Configure
cmake -S ${example_dir} -B ${build_dir} \
cmake -S "${example_dir}" -B "${build_dir}" \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCUVS_NVTX=OFF \
-DCMAKE_CUDA_ARCHITECTURES=${CUVS_CMAKE_CUDA_ARCHITECTURES} \
-DCMAKE_CUDA_ARCHITECTURES="${CUVS_CMAKE_CUDA_ARCHITECTURES}" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
${EXTRA_CMAKE_ARGS}
"${EXTRA_CMAKE_ARGS[@]}"
# Build
cmake --build ${build_dir} -j${PARALLEL_LEVEL}
cmake --build "${build_dir}" -j"${PARALLEL_LEVEL}"
}

build_example c
Expand Down
4 changes: 3 additions & 1 deletion java/build.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/bin/bash

# Copyright (c) 2025, NVIDIA CORPORATION.

set -e -u -o pipefail

ARGS="$*"
NUMARGS=$#

CURDIR=$(cd "$(dirname $0)"; pwd)
CURDIR=$(cd "$(dirname "$0")"; pwd)
VERSION="25.08.0" # Note: The version is updated automatically when ci/release/update-version.sh is invoked
GROUP_ID="com.nvidia.cuvs"

Expand Down
16 changes: 9 additions & 7 deletions java/panama-bindings/generate-bindings.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/bash

# Copyright (c) 2025, NVIDIA CORPORATION.

set -e -u -o pipefail

echo "Starting Panama FFM API bindings generation ..."
REPODIR=$(cd "$(dirname $0)"; cd ../../ ; pwd)
CURDIR=$(cd "$(dirname $0)"; pwd)
REPODIR=$(cd "$(dirname "$0")"; cd ../../ ; pwd)
CURDIR=$(cd "$(dirname "$0")"; pwd)
TARGET_PACKAGE="com.nvidia.cuvs.internal.panama"

TARGET_DIR="targets/x86_64-linux/include"
Expand All @@ -17,7 +19,7 @@ else
exit 1
fi

if [[ `command -v jextract` == "" ]];
if [[ $(command -v jextract) == "" ]];
then
JEXTRACT_FILENAME="openjdk-22-jextract+6-47_linux-x64_bin.tar.gz"
JEXTRACT_DOWNLOAD_URL="https://download.java.net/java/early_access/jextract/22/6/${JEXTRACT_FILENAME}"
Expand All @@ -31,12 +33,12 @@ fi

# Use Jextract utility to generate panama bindings
jextract \
--include-dir ${REPODIR}/java/internal/build/_deps/dlpack-src/include/ \
--include-dir ${CUDA_INCLUDE_DIR} \
--include-dir ${REPODIR}/cpp/include \
--include-dir "${REPODIR}"/java/internal/build/_deps/dlpack-src/include/ \
--include-dir "${CUDA_INCLUDE_DIR}" \
--include-dir "${REPODIR}"/cpp/include \
--output "${REPODIR}/java/cuvs-java/src/main/java22/" \
--target-package ${TARGET_PACKAGE} \
--library cuvs_c \
${CURDIR}/headers.h
"${CURDIR}"/headers.h

echo "Panama FFM API bindings generation done"
Loading