You need to sign in or sign up before continuing.
Unverified Commit 812395ca authored by guyang3532's avatar guyang3532 Committed by GitHub
Browse files

Fix CPU unit tests (#2465)

parent ad0553c0
...@@ -10,9 +10,15 @@ set -e ...@@ -10,9 +10,15 @@ set -e
eval "$(./conda/bin/conda shell.bash hook)" eval "$(./conda/bin/conda shell.bash hook)"
conda activate ./env conda activate ./env
if [ -z "${CUDA_VERSION:-}" ] ; then if [ "${CU_VERSION:-}" == cpu ] ; then
cudatoolkit="cpuonly" cudatoolkit="cpuonly"
else else
if [[ ${#CU_VERSION} -eq 4 ]]; then
CUDA_VERSION="${CU_VERSION:2:1}.${CU_VERSION:3:1}"
elif [[ ${#CU_VERSION} -eq 5 ]]; then
CUDA_VERSION="${CU_VERSION:2:2}.${CU_VERSION:4:1}"
fi
echo "Using CUDA $CUDA_VERSION as determined by CU_VERSION"
version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")" version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")"
cudatoolkit="cudatoolkit=${version}" cudatoolkit="cudatoolkit=${version}"
fi fi
......
...@@ -12,9 +12,15 @@ this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" ...@@ -12,9 +12,15 @@ this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
eval "$(./conda/Scripts/conda.exe 'shell.bash' 'hook')" eval "$(./conda/Scripts/conda.exe 'shell.bash' 'hook')"
conda activate ./env conda activate ./env
if [ -z "${CUDA_VERSION:-}" ] ; then if [ "${CU_VERSION:-}" == cpu ] ; then
cudatoolkit="cpuonly" cudatoolkit="cpuonly"
else else
if [[ ${#CU_VERSION} -eq 4 ]]; then
CUDA_VERSION="${CU_VERSION:2:1}.${CU_VERSION:3:1}"
elif [[ ${#CU_VERSION} -eq 5 ]]; then
CUDA_VERSION="${CU_VERSION:2:2}.${CU_VERSION:4:1}"
fi
echo "Using CUDA $CUDA_VERSION as determined by CU_VERSION"
version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")" version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")"
cudatoolkit="cudatoolkit=${version}" cudatoolkit="cudatoolkit=${version}"
fi fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment