OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [libstdc++-v3/] [scripts/] [check_performance] - Blame information for rev 866

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 424 jeremybenn
#!/usr/bin/env bash
2
 
3
# Script to do performance testing.
4
 
5
# Invocation
6
# check_performance SRC_DIR BUILD_DIR
7
 
8
# 1: variables
9
#
10
SRC_DIR=$1
11
BUILD_DIR=$2
12
 
13
# Now that we've successfully translated the numerical option into
14
# a symbolic one, we can safely ignore it.
15
shift
16
 
17
# This has been true all along.  Found out about it the hard way...
18
case $BASH_VERSION in
19
    1*)
20
        echo 'You need bash 2.x to run check_performance.  Exiting.';
21
        exit 1 ;;
22
    *)   ;;
23
esac
24
 
25
flags_script=$BUILD_DIR/scripts/testsuite_flags
26
INCLUDES=`$flags_script --build-includes`
27
PCH_FLAGS=`$flags_script --cxxpchflags`
28
FLAGS=`$flags_script --cxxflags`
29
THREAD_FLAG='-pthread'
30
COMPILER=`$flags_script --build-cxx`
31
SH_FLAG="-Wl,--rpath -Wl,$BUILD_DIR/../../gcc \
32
         -Wl,--rpath -Wl,$BUILD_DIR/src/.libs"
33
ST_FLAG="-static"
34
LINK=$SH_FLAG
35
CXX="$COMPILER $INCLUDES $FLAGS -std=gnu++0x $CXXFLAGS $LINK"
36
LIBS="./libtestc++.a"
37
TESTS_FILE="testsuite_files_performance"
38
 
39
echo CXX is $CXX
40
 
41
for NAME in `cat $TESTS_FILE`
42
do
43
  RUN=true
44
  TESTNAME=$SRC_DIR/testsuite/$NAME
45
  FILE_NAME="`basename $NAME`"
46
  FILE_NAME="`echo $FILE_NAME | sed 's/.cc//g'`"
47
 
48
  # TEST_S == single thread
49
  # TEST_B == do both single and multi-thread
50
  # TEST_T == multi-thread
51
  for CYCLE in `sed -n 's,.*\(TEST_[SB][0-9]*\)$,\1,p' $TESTNAME`
52
  do
53
    RUN=false
54
    echo $NAME $CYCLE
55
    EXE_NAME="`echo $FILE_NAME-$CYCLE.exe`"
56
    $CXX -DNOTHREAD -D$CYCLE $TESTNAME $LIBS -o $EXE_NAME
57
    if [ -f $EXE_NAME ]; then
58
      ./$EXE_NAME
59
    else
60
      echo "compile error:"
61
      echo "$CXX -DNOTHREAD -D$CYCLE $TESTNAME $LIBS -o $EXE_NAME"
62
    fi
63
  done
64
 
65
  for CYCLE in `sed -n 's,.*\(TEST_[TB][0-9]*\)$,\1,p' $TESTNAME`
66
  do
67
    RUN=false
68
    echo $NAME $CYCLE thread
69
    EXE_NAME="`echo $FILE_NAME-$CYCLE.exe`"
70
    $CXX $THREAD_FLAG -D$CYCLE $TESTNAME $LIBS -o $EXE_NAME
71
    if [ -f $EXE_NAME ]; then
72
      ./$EXE_NAME
73
    else
74
      echo "compile error:"
75
      echo "$CXX $THREAD_FLAG -D$CYCLE $TESTNAME $LIBS -o $EXE_NAME"
76
    fi
77
  done
78
 
79
  if $RUN; then
80
    echo $NAME
81
    EXE_NAME="`echo $FILE_NAME.exe`"
82
    $CXX $TESTNAME $LIBS -o $EXE_NAME
83
    if [ -f $EXE_NAME ]; then
84
      ./$EXE_NAME >& tmp.$FILE_NAME
85
    else
86
      echo "compile error:"
87
      echo "$CXX $TESTNAME $LIBS -o $EXE_NAME"
88
    fi
89
    if [ -s tmp.$FILE_NAME ]; then
90
        mv tmp.$FILE_NAME $FILE_NAME.xml
91
    fi
92
  fi
93
done
94
 
95
exit 0

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.