expf.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 build_dir="$1" 29 BUILD=${BUILD:="build/$build_dir"} 30 31 declare -a ranges 32 ranges=(-127.0,-111.9 \ 33 -111.99,-109.99 \ 34 -109.9,108.0 \ 35 -107.9999,-10 \ 36 -10.0,-1 \ 37 -1.0,-0 \ 38 -1.0,1 \ 39 0.0,1 \ 40 0,1 \ 41 1,2 \ 42 2,10 \ 43 10,88.7 \ 44 88.7,90 \ 45 87,89 \ 46 89,200) 47 48 #ranges=(-740,710) 49 50 run_test() 51 { 52 export LD_LIBRARY_PATH=`pwd`/${BUILD}/src 53 for r in ${ranges[@]}; do 54 echo " testing for [${r}] " 55 ${BUILD}/tests/exp/test_exp -i $1 -t $2 -r ${r} -c 1000000 -l 1000 56 done 57 } 58 59 echo "Running tests for exp()" 60 run_test "s1d" "perf" 61 run_test "s1d" "accu" 62 run_test "s1d" "conf" 63 run_test "s1d" "special" 64 65 run_test "s1f" "perf" 66 run_test "s1f" "accu" 67 run_test "s1f" "conf" 68 run_test "s1f" "special" 69 70 run_test "v2d" "perf" 71 run_test "v2d" "accu" 72 73 run_test "v4d" "perf" 74 run_test "v4d" "accu" 75 76 run_test "v4s" "perf" 77 run_test "v4s" "accu" 78 echo "Ran tests for exp()"