CMD=$( basename $0 )
+# For pinnning to a ref use this:
+#DEFAULT_CLFRAMEWORKREVISION="branches/arm_compute_19_08" # Release 19.08
+#
+# For pinning to a revision use this:
+DEFAULT_CLFRAMEWORKREVISION="5c4a8e96460eb83a6caef1c69ea5cbb4893858d7" #COMPMID-2592 Create a new kernel for CLPad with SYMMETRIC and REFLECT
+
usage() {
- echo "Usage: $CMD -g <GITHUB_USERNAME>"
- exit 1
+ echo "Usage: $CMD (Use the default clframework SHA)"
+ echo "Usage: $CMD -s <CLFRAMEWORK_SHA>"
+ echo "Usage: $CMD -p (Print current default clframework SHA)"
+ exit 0
+}
+
+PrintDefaultClframeworkSha() {
+ echo $DEFAULT_CLFRAMEWORKREVISION
+ exit 0;
}
function AssertZeroExitCode {
}
# process the options given
-while getopts "g:h" opt; do
+while getopts "s:phg:" opt; do
case "$opt" in
- g) GITHUB_USERNAME="$OPTARG";;
+ s) CLFRAMEWORK_SHA="$OPTARG";;
+ p) PrintDefaultClframeworkSha;;
+ g) DUMMY="$OPTARG";; # continue to accept -g for backward compatibility
h|\?) usage;;
esac
done
DIR="$( cd -P "$( dirname "$SRC" )" >/dev/null && pwd )"
pushd ${DIR} > /dev/null
cd ../..
-if [ -z "$USERNAME" ]; then
- USERNAME=$USER
-fi
-if [ -z "$GITHUB_USERNAME" ]; then
- GITHUB_USERNAME=$USERNAME
- echo "setting GITHUB_USERNAME: ${GITHUB_USERNAME} use -g command line option to change"
-fi
if [ ! -d clframework ]; then
-echo "+++ Cloning clframework"
git clone https://review.mlplatform.org/ml/ComputeLibrary clframework
AssertZeroExitCode "Cloning CL Framework failed"
fi
pushd clframework > /dev/null
-# Use the latest pinned version of the CL framework
-
-# For pinnning to a ref use this:
-# CLFRAMEWORKREVISION="branches/arm_compute_19_02" # Release 19.02
-# git fetch https://review.mlplatform.org/ml/ComputeLibrary $CLFRAMEWORKREVISION && git checkout FETCH_HEAD
+CLFRAMEWORKREVISION=$DEFAULT_CLFRAMEWORKREVISION
+if [ ! -z "$CLFRAMEWORK_SHA" ]; then
+ CLFRAMEWORKREVISION=$CLFRAMEWORK_SHA
+fi
-# For pinning to a revision use this:
-CLFRAMEWORKREVISION="b4a44ff3aa98d2b51f1621a7525db3f81108a1bd" # COMPMID-1995: Removed layout checks from Reduction ops
-git fetch https://review.mlplatform.org/ml/ComputeLibrary && git checkout ${CLFRAMEWORKREVISION}
-AssertZeroExitCode
+git fetch && git fetch https://review.mlplatform.org/ml/ComputeLibrary && git checkout ${CLFRAMEWORKREVISION}
+AssertZeroExitCode "Fetching and checking out ${CLFRAMEWORKREVISION} failed"
# Set commit hook so we can submit reviews to gerrit
(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)
-AssertZeroExitCode
+AssertZeroExitCode "Setting commit hooks failed"
popd > /dev/null # out of clframework
popd > /dev/null # back to wherever we were when called
+# Make sure the SHA of the revision that was checked out is the last line
+# of output from the script... just in case we ever need it.
+echo $CLFRAMEWORKREVISION
exit 0