-
Notifications
You must be signed in to change notification settings - Fork 288
Expand file tree
/
Copy pathbuild_tests.sh
More file actions
executable file
·25 lines (21 loc) · 1.18 KB
/
build_tests.sh
File metadata and controls
executable file
·25 lines (21 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
UNAME=$(uname)
if [ "$UNAME" == "Linux" ] ; then
SCRIPTPATH=$(dirname $(realpath "$0"))
export CPLUS_INCLUDE_PATH=${SCRIPTPATH}/../../cuda/core/_include:$CUDA_HOME/include:$CPLUS_INCLUDE_PATH
elif [[ "$UNAME" == CYGWIN* || "$UNAME" == MINGW* || "$UNAME" == MSYS* ]] ; then
SCRIPTPATH="$(dirname $(cygpath -w $(realpath "$0")))"
CUDA_CORE_INCLUDE_PATH=$(echo "${SCRIPTPATH}\..\..\cuda\core\_include" | sed 's/\\/\\\\/g')
export CL="/I\"${CUDA_CORE_INCLUDE_PATH}\" /I\"${CUDA_HOME}\\include\" ${CL}"
else
exit 1
fi
# pixi-build's editable install exposes the cuda namespace package via a
# finder hook that Cython's filesystem .pxd resolver does not consult.
# Surface the package's parent directory on PYTHONPATH so `cimport
# cuda.bindings.*` can locate the .pxd files.
CUDA_PKG_PARENT=$(python -c "import cuda.bindings as m, os; print(os.path.dirname(os.path.dirname(os.path.dirname(m.__file__))))")
export PYTHONPATH="${CUDA_PKG_PARENT}${PYTHONPATH:+:${PYTHONPATH}}"
cythonize -3 -i -Xfreethreading_compatible=True ${SCRIPTPATH}/test_*.pyx