3 # Copyright © 2017 Arm Ltd. All rights reserved.
4 # SPDX-License-Identifier: MIT
10 echo "Usage: $CMD -g <GITHUB_USERNAME>"
14 function AssertZeroExitCode {
16 if [ $EXITCODE -ne 0 ]; then
18 echo "+++ Command exited with code $EXITCODE. Please fix the above errors and re-run"
23 # process the options given
24 while getopts "g:h" opt; do
26 g) GITHUB_USERNAME="$OPTARG";;
33 # This script is designed to be called from anywhere
34 # so it will resolve where to checkout out the clframework
35 # relative to its own location in armnn/scripts
37 SRC="${BASH_SOURCE[0]}"
38 # resolve $SRC until it is no longer a symlink
39 while [ -h "$SRC" ]; do
40 DIR="$( cd -P "$( dirname "$SRC" )" >/dev/null && pwd )"
41 SRC="$(readlink "$SRC")"
42 # if $SRC was a relative symlink, we need to resolve it
43 # relative to the path where the symlink file originally was
44 [[ $SRC != /* ]] && SRC="$DIR/$SRC"
46 DIR="$( cd -P "$( dirname "$SRC" )" >/dev/null && pwd )"
47 pushd ${DIR} > /dev/null
49 if [ -z "$USERNAME" ]; then
52 if [ -z "$GITHUB_USERNAME" ]; then
53 GITHUB_USERNAME=$USERNAME
54 echo "setting GITHUB_USERNAME: ${GITHUB_USERNAME} use -g command line option to change"
57 if [ ! -d clframework ]; then
58 echo "+++ Cloning clframework"
59 git clone ssh://$GITHUB_USERNAME@review.mlplatform.org:29418/ml/ComputeLibrary clframework
60 AssertZeroExitCode "Cloning CL Framework failed"
62 pushd clframework > /dev/null
64 # Use the latest pinned version of the CL framework
66 # For pinnning to a ref use this:
67 # CLFRAMEWORKREVISION="branches/arm_compute_18_11" # Release 18.11
68 # git fetch ssh://$GITHUB_USERNAME@review.mlplatform.org:29418/ml/ComputeLibrary $CLFRAMEWORKREVISION && git checkout FETCH_HEAD
70 # For pinning to a revision use this:
71 CLFRAMEWORKREVISION="92fd94336e4b169005d88af401fe57bcbd50521b" # commit on CL elementwise min, max, and squared diff
72 git fetch ssh://$GITHUB_USERNAME@review.mlplatform.org:29418/ml/ComputeLibrary && git checkout ${CLFRAMEWORKREVISION}
75 # Set commit hook so we can submit reviews to gerrit
76 scp -p -P 29418 $GITHUB_USERNAME@review.mlplatform.org:hooks/commit-msg .git/hooks/
79 popd > /dev/null # out of clframework
80 popd > /dev/null # back to wherever we were when called