3 # Copyright © 2017 Arm Ltd. All rights reserved.
4 # SPDX-License-Identifier: MIT
9 # For pinning to a ref use this:
10 #DEFAULT_CLFRAMEWORKREVISION="branches/arm_compute_20_02" # Release 20.02
12 # For pinning to a revision use this:
13 DEFAULT_CLFRAMEWORKREVISION="6cd1c9bc312b65137da52a973489ba6a0f0180e3" #COMPMID-3277: (3RDPARTY_UPDATE) fix build issue related to constructors
17 echo "Usage: $CMD (Use the default clframework SHA)"
18 echo "Usage: $CMD -s <CLFRAMEWORK_SHA>"
19 echo "Usage: $CMD -p (Print current default clframework SHA)"
23 PrintDefaultClframeworkSha() {
24 echo $DEFAULT_CLFRAMEWORKREVISION
28 function AssertZeroExitCode {
30 if [ $EXITCODE -ne 0 ]; then
32 echo "+++ Command exited with code $EXITCODE. Please fix the above errors and re-run"
37 # process the options given
38 while getopts "s:phg:" opt; do
40 s) CLFRAMEWORK_SHA="$OPTARG";;
41 p) PrintDefaultClframeworkSha;;
42 g) DUMMY="$OPTARG";; # continue to accept -g for backward compatibility
49 # This script is designed to be called from anywhere
50 # so it will resolve where to checkout out the clframework
51 # relative to its own location in armnn/scripts
53 SRC="${BASH_SOURCE[0]}"
54 # resolve $SRC until it is no longer a symlink
55 while [ -h "$SRC" ]; do
56 DIR="$( cd -P "$( dirname "$SRC" )" >/dev/null && pwd )"
57 SRC="$(readlink "$SRC")"
58 # if $SRC was a relative symlink, we need to resolve it
59 # relative to the path where the symlink file originally was
60 [[ $SRC != /* ]] && SRC="$DIR/$SRC"
62 DIR="$( cd -P "$( dirname "$SRC" )" >/dev/null && pwd )"
63 pushd ${DIR} > /dev/null
66 if [ ! -d clframework ]; then
67 git clone https://review.mlplatform.org/ml/ComputeLibrary clframework
68 AssertZeroExitCode "Cloning CL Framework failed"
70 pushd clframework > /dev/null
72 CLFRAMEWORKREVISION=$DEFAULT_CLFRAMEWORKREVISION
73 if [ ! -z "$CLFRAMEWORK_SHA" ]; then
74 CLFRAMEWORKREVISION=$CLFRAMEWORK_SHA
77 git fetch && git fetch https://review.mlplatform.org/ml/ComputeLibrary && git checkout ${CLFRAMEWORKREVISION}
78 AssertZeroExitCode "Fetching and checking out ${CLFRAMEWORKREVISION} failed"
80 # Set commit hook so we can submit reviews to gerrit
81 (curl -Lo `git rev-parse --git-dir`/hooks/commit-msg https://review.mlplatform.org/tools/hooks/commit-msg; chmod +x `git rev-parse --git-dir`/hooks/commit-msg)
82 AssertZeroExitCode "Setting commit hooks failed"
84 popd > /dev/null # out of clframework
85 popd > /dev/null # back to wherever we were when called
86 # Make sure the SHA of the revision that was checked out is the last line
87 # of output from the script... just in case we ever need it.
88 echo $CLFRAMEWORKREVISION