Skip to content

Commit

Permalink
Changing to double-brace syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
ChSonnabend committed Nov 26, 2024
1 parent f28a341 commit 4813226
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions onnxruntime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,30 @@ mkdir -p $INSTALLROOT

# Check ROCm build conditions

if [ "$ALIBUILD_O2_FORCE_GPU" -eq 1 ] || [ "$ALIBUILD_ENABLE_HIP" -eq 1 ] || \
( ( [ -z "$DISABLE_GPU" ] || [ "$DISABLE_GPU" -eq 0 ] ) && \
if [[ "$ALIBUILD_O2_FORCE_GPU" -eq 1 ]] || [[ "$ALIBUILD_ENABLE_HIP" -eq 1 ]] || \
( ( [[ -z "$DISABLE_GPU" ]] || [[ "$DISABLE_GPU" -eq 0 ]] ) && \
( command -v /opt/rocm/bin/rocminfo >/dev/null 2>&1 ) && \
[ -d /opt/rocm/include/hiprand ] && \
[ -d /opt/rocm/include/hipblas ] && \
[ -d /opt/rocm/include/hipsparse ] && \
[ -d /opt/rocm/include/hipfft ] && \
[ -d /opt/rocm/include/rocblas ] && \
[ -d /opt/rocm/include/rocrand ] && \
[ -d /opt/rocm/include/miopen ] && \
[ -d /opt/rocm/include/rccl ] && \
[ -z "$ORT_ROCM_BUILD" ] ); then
[[ -d /opt/rocm/include/hiprand ]] && \
[[ -d /opt/rocm/include/hipblas ]] && \
[[ -d /opt/rocm/include/hipsparse ]] && \
[[ -d /opt/rocm/include/hipfft ]] && \
[[ -d /opt/rocm/include/rocblas ]] && \
[[ -d /opt/rocm/include/rocrand ]] && \
[[ -d /opt/rocm/include/miopen ]] && \
[[ -d /opt/rocm/include/rccl ]] && \
[[ -z "$ORT_ROCM_BUILD" ]] ); then
export ORT_ROCM_BUILD=1
: ${ALIBUILD_O2_OVERRIDE_HIP_ARCHS:="gfx906,gfx908"}
else
export ORT_ROCM_BUILD=0
fi

# Check CUDA build conditions
if [ "$ALIBUILD_O2_FORCE_GPU" -eq 1 ] || [ "$ALIBUILD_ENABLE_CUDA" -eq 1 ] || \
( ( [ -z "$DISABLE_GPU" ] || [ "$DISABLE_GPU" -eq 0 ] ) && \
if [[ "$ALIBUILD_O2_FORCE_GPU" -eq 1 ]] || [[ "$ALIBUILD_ENABLE_CUDA" -eq 1 ]] || \
( ( [[ -z "$DISABLE_GPU" ]] || [[ "$DISABLE_GPU" -eq 0 ]] ) && \
( command -v nvcc >/dev/null 2>&1 ) && \
[ -f /usr/include/cudnn.h ] && \
[ -z "$ORT_CUDA_BUILD" ] ); then
[[ -f /usr/include/cudnn.h ]] && \
[[ -z "$ORT_CUDA_BUILD" ]] ); then
export ORT_CUDA_BUILD=1
: ${ALIBUILD_O2_OVERRIDE_CUDA_ARCHS:="sm_86"}
else
Expand All @@ -53,17 +53,17 @@ fi

# Optional builds
### MIGraphX
if ( [ "$ORT_ROCM_BUILD" -eq 1 ] && [ $(find /opt/rocm* -name "libmigraphx*" -print -quit | wc -l 2>&1) -eq 1 ] ) && \
[ -z "$ORT_MIGRAPHX_BUILD" ]; then
if ( [[ "$ORT_ROCM_BUILD" -eq 1 ]] && [[ $(find /opt/rocm* -name "libmigraphx*" -print -quit | wc -l 2>&1) -eq 1 ]] ) && \
[[ -z "$ORT_MIGRAPHX_BUILD" ]]; then
export ORT_MIGRAPHX_BUILD=1
elif [ -z "$ORT_MIGRAPHX_BUILD" ]; then
elif [[ -z "$ORT_MIGRAPHX_BUILD" ]]; then
export ORT_MIGRAPHX_BUILD=0
fi
### TensorRT
if ( [ "$ORT_CUDA_BUILD" -eq 1 ] && [ $(find /usr -name "libnvinfer*" -print -quit | wc -l 2>&1) -eq 1 ] ) && \
[ -z "$ORT_MIGRAPHX_BUILD" ]; then
if ( [[ "$ORT_CUDA_BUILD" -eq 1 ]] && [[ $(find /usr -name "libnvinfer*" -print -quit | wc -l 2>&1) -eq 1 ]] ) && \
[[ -z "$ORT_MIGRAPHX_BUILD" ]]; then
export ORT_TENSORRT_BUILD=1
elif [ -z "$ORT_TENSORRT_BUILD" ]; then
elif [[ -z "$ORT_TENSORRT_BUILD" ]]; then
export ORT_TENSORRT_BUILD=0
fi

Expand Down

0 comments on commit 4813226

Please sign in to comment.