Skip to content

Commit

Permalink
Clean up API
Browse files Browse the repository at this point in the history
  • Loading branch information
sleeepyjack committed Nov 17, 2023
1 parent 164b778 commit f9abd06
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dispatch-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
with:
cpu: ${{ matrix.cpu }}
test_name: ${{matrix.compiler.name}}${{matrix.compiler.version}}/C++${{matrix.std}}
build_script: "./ci/build.sh -cxx ${{matrix.compiler.exe}} -std ${{matrix.std}} -arch ${{matrix.gpu_build_archs}} -i ${{matrix.compiler.name}}${{matrix.compiler.version}}-cuda${{matrix.cuda}}"
test_script: "./ci/test.sh -cxx ${{matrix.compiler.exe}} -std ${{matrix.std}} -arch ${{matrix.gpu_build_archs}} -i ${{matrix.compiler.name}}${{matrix.compiler.version}}-cuda${{matrix.cuda}}"
build_script: "./ci/build.sh --cxx ${{matrix.compiler.exe}} --std ${{matrix.std}} -arch ${{matrix.gpu_build_archs}} -i ${{matrix.compiler.name}}${{matrix.compiler.version}}-cuda${{matrix.cuda}}"
test_script: "./ci/test.sh --cxx ${{matrix.compiler.exe}} --std ${{matrix.std}} -arch ${{matrix.gpu_build_archs}} -i ${{matrix.compiler.name}}${{matrix.compiler.version}}-cuda${{matrix.cuda}}"
container_image: rapidsai/devcontainers:${{inputs.devcontainer_version}}-cpp-${{matrix.compiler.name}}${{matrix.compiler.version}}-cuda${{matrix.cuda}}-${{matrix.os}}
run_tests: ${{ contains(matrix.jobs, 'test') && !contains(github.event.head_commit.message, 'skip-tests') }}
42 changes: 21 additions & 21 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ function usage {
echo
echo "Options:"
echo " -v/--verbose: enable shell echo for debugging"
echo " -prefix: Build directory prefix (Defaults to <repo_root>/build)"
echo " -i/-infix: Build directory infix (Defaults to local)"
echo " -d/-debug: Debug build"
echo " -c/-clean: Clean (re-)build"
echo " -cuda: CUDA compiler (Defaults to \$CUDACXX if set, otherwise nvcc)"
echo " -cxx: Host compiler (Defaults to \$CXX if set, otherwise g++)"
echo " -arch: Target CUDA arches, e.g. \"60-real;70;80-virtual\" (Defaults to the system's native GPU archs)"
echo " -std: CUDA/C++ standard (Defaults to 17)"
echo " -p/-par: Build parallelism (Defaults to \$PARALLEL_LEVEL if set, otherwise the system's number of CPU cores)"
echo " --prefix: Build directory prefix (Defaults to <repo_root>/build)"
echo " -i/--infix: Build directory infix (Defaults to local)"
echo " -d/--debug: Debug build"
echo " -c/--clean: Clean (re-)build"
echo " -p/--parallel: Build parallelism (Defaults to \$PARALLEL_LEVEL if set, otherwise the system's number of CPU cores)"
echo " --cuda: CUDA compiler (Defaults to \$CUDACXX if set, otherwise nvcc)"
echo " --cxx: Host compiler (Defaults to \$CXX if set, otherwise g++)"
echo " --arch: Target CUDA arches, e.g. \"60-real;70;80-virtual\" (Defaults to the system's native GPU archs)"
echo " --std: CUDA/C++ standard (Defaults to 17)"
echo
echo "Examples:"
echo " $ PARALLEL_LEVEL=8 CXX=g++-9 $0"
echo " $ $0 -cxx g++-9 -par 8 -i my_build"
echo " $ $0 -cxx g++-8 -std 14 -arch 80-real -v -cuda /usr/local/bin/nvcc"
echo " $ $0 --cxx g++-9 -p 8 -i my_build --debug"
echo " $ $0 --cxx g++-8 --prefix /usr/local --arch 80-real -v --cuda /usr/local/bin/nvcc"
exit 1
}

Expand All @@ -63,15 +63,15 @@ echo "Args: ${args[@]}"
while [ "${#args[@]}" -ne 0 ]; do
case "${args[0]}" in
-v | --verbose) VERBOSE=1; args=("${args[@]:1}");;
-prefix) BUILD_PREFIX="${args[1]}"; args=("${args[@]:2}");;
-i | -infix) BUILD_INFIX="${args[1]}"; args=("${args[@]:2}");;
-d | -debug) DEBUG_BUILD=1; args=("${args[@]:1}");;
-c | -clean) CLEAN_BUILD=1; args=("${args[@]:1}");;
-cuda) CUDA_COMPILER="${args[1]}"; args=("${args[@]:2}");;
-cxx) HOST_COMPILER="${args[1]}"; args=("${args[@]:2}");;
-arch) CUDA_ARCHS="${args[1]}"; args=("${args[@]:2}");;
-std) CXX_STANDARD="${args[1]}"; args=("${args[@]:2}");;
-p | -par) PARALLEL_LEVEL="${args[1]}"; args=("${args[@]:2}");;
--prefix) BUILD_PREFIX="${args[1]}"; args=("${args[@]:2}");;
-i | --infix) BUILD_INFIX="${args[1]}"; args=("${args[@]:2}");;
-d | --debug) DEBUG_BUILD=1; args=("${args[@]:1}");;
-c | --clean) CLEAN_BUILD=1; args=("${args[@]:1}");;
-p | --parallel) PARALLEL_LEVEL="${args[1]}"; args=("${args[@]:2}");;
--cuda) CUDA_COMPILER="${args[1]}"; args=("${args[@]:2}");;
--cxx) HOST_COMPILER="${args[1]}"; args=("${args[@]:2}");;
--arch) CUDA_ARCHS="${args[1]}"; args=("${args[@]:2}");;
--std) CXX_STANDARD="${args[1]}"; args=("${args[@]:2}");;
-h | -help | --help) usage ;;
*) echo "Unrecognized option: ${args[0]}"; usage ;;
esac
Expand All @@ -96,7 +96,7 @@ if [ "$BUILD_INFIX" = "latest" ] || [ -z "$BUILD_INFIX" ]; then
fi

# Trigger clean (re-)build
if [ "${CLEAN_BUILD:-0}" -eq 1 ]; then
if [ "$CLEAN_BUILD" -eq 1 ]; then
rm -rf BUILD_DIR
fi

Expand Down

0 comments on commit f9abd06

Please sign in to comment.