run.sh
1 #!/bin/bash 2 3 # 4 # Copyright (C) 2008-2020 Advanced Micro Devices, Inc. All rights reserved. 5 # 6 # Redistribution and use in source and binary forms, with or without modification, 7 # are permitted provided that the following conditions are met: 8 # 1. Redistributions of source code must retain the above copyright notice, 9 # this list of conditions and the following disclaimer. 10 # 2. Redistributions in binary form must reproduce the above copyright notice, 11 # this list of conditions and the following disclaimer in the documentation 12 # and/or other materials provided with the distribution. 13 # 3. Neither the name of the copyright holder nor the names of its contributors 14 # may be used to endorse or promote products derived from this software without 15 # specific prior written permission. 16 # 17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 21 # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 22 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 23 # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 # POSSIBILITY OF SUCH DAMAGE. 27 28 #script to build and run the libm compliancy test suite 29 git checkout master 30 git pull 31 32 #check for no of arguments 33 if [ $# -ne 3 ]; then 34 echo "Usage: run.sh <build_type> <test_type> <compiler_type>" 35 echo "Build type: debug/release/glibc/amdlibm" 36 echo "Test type: perf/accu/special/conf/all" 37 echo "Compiler: gcc/aocc" 38 exit 1 39 fi 40 41 build_type=$1 42 test_type=$2 43 compiler_type=$3 44 45 echo "Build Type:- " + $build_type 46 echo "Test type:- " + $test_type 47 echo "Compiler: " + $compiler_type 48 49 #check if compiler is aocc then is clang is added to path? 50 if [ $compiler_type = "aocc" ]; then 51 var="clang" 52 if [[ -z "${var}" ]]; then 53 echo "Error! Clang is not added to path" 54 exit 1 55 fi 56 fi 57 58 scons -c; 59 60 if [ $build_type = "debug" ]; 61 then 62 scons --debug_mode=all tests --compiler=$compiler_type 63 build_dir="aocl-debug" 64 65 elif [ $build_type = "release" ]; 66 then 67 scons tests --compiler=$compiler_type 68 build_dir="aocl-release" 69 70 elif [ $build_type = "developer" ]; 71 then 72 scons tests --developer=2 --compiler=$compiler_type 73 build_dir="aocl-dev2" 74 75 elif [ $build_type = "amdlibm" ]; 76 then 77 scons tests --libabi=amdlibm --compiler=$compiler_type 78 build_dir="amdlibm-release" 79 80 elif [ $build_type = "glibc" ]; 81 then 82 scons tests --libabi=glibc --compiler=$compiler_type 83 build_dir="glibc-release" 84 85 else 86 echo "Invalid option:choose from debug/release/developer/amdlibm/glibc" 87 exit 1 88 fi 89 90 `pwd`/scripts/run/pow.sh "$build_dir" "$test_type" 91 `pwd`/scripts/run/log.sh "$build_dir" "$test_type" 92 `pwd`/scripts/run/exp.sh "$build_dir" "$test_type" 93 `pwd`/scripts/run/fabs.sh "$build_dir" "$test_type" 94 `pwd`/scripts/run/atan.sh "$build_dir" "$test_type"