Changeset a1c60b56 in rtems


Ignore:
Timestamp:
Mar 28, 2017, 12:04:44 PM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
bba48d9
Parents:
3785f937
git-author:
Sebastian Huber <sebastian.huber@…> (03/28/17 12:04:44)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/29/17 05:42:50)
Message:

benchmarks/whetstone: Port to RTEMS

Update #2958.

Location:
testsuites/benchmarks/whetstone
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • testsuites/benchmarks/whetstone/Makefile.am

    r3785f937 ra1c60b56  
    11rtems_tests_PROGRAMS = whetstone
    2 whetstone_SOURCES = init.c
     2whetstone_SOURCES = init.c whetstone.c
     3whetstone_LDADD = -lm
    34
    45dist_rtems_tests_DATA = whetstone.scn whetstone.doc
     
    910
    1011AM_CPPFLAGS += -I$(top_srcdir)/../support/include
     12AM_CFLAGS += -fno-inline -fno-builtin
    1113
    12 LINK_OBJS = $(whetstone_OBJECTS)
     14LINK_OBJS = $(whetstone_OBJECTS) $(whetstone_LDADD)
    1315LINK_LIBS = $(whetstone_LDLIBS)
    1416
  • testsuites/benchmarks/whetstone/init.c

    r3785f937 ra1c60b56  
    2121const char rtems_test_name[] = "WHETSTONE";
    2222
    23 static void test(void)
    24 {
    25 }
     23int main(int argc, char **argv);
    2624
    2725static void Init(rtems_task_argument arg)
    2826{
     27  char *argv[] = {
     28    "whetstone",
     29    "10000",
     30    NULL
     31  };
     32
    2933  TEST_BEGIN();
    3034
    31   test();
     35  main(2, argv);
    3236
    3337  TEST_END();
     
    4246#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
    4347
     48#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT
     49
    4450#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
    4551
  • testsuites/benchmarks/whetstone/whetstone.c

    r3785f937 ra1c60b56  
    5959
    6060/* the following is optional depending on the timing function used */
    61 #include <time.h>
     61#include <sys/time.h>
    6262
    6363/* map the FORTRAN math functions, etc. to the C versions */
     
    8383int J,K,L;
    8484
     85static double
     86Time(void)
     87{
     88        struct timeval tv;
     89
     90        gettimeofday(&tv, NULL);
     91        return (double)tv.tv_sec + (double)tv.tv_usec * 1e-6;
     92}
     93
    8594int
    8695main(int argc, char *argv[])
     
    95104        /* added for this version */
    96105        long loopstart;
    97         long startsec, finisec;
    98         float KIPS;
     106        double startsec, finisec;
     107        double KIPS;
    99108        int continuous;
    100109
     
    121130C
    122131*/
    123         startsec = time(0);
     132        startsec = Time();
    124133
    125134/*
     
    356365C
    357366*/
    358         finisec = time(0);
     367        finisec = Time();
    359368
    360369/*
     
    373382        }
    374383
    375         printf("Loops: %ld, Iterations: %d, Duration: %ld sec.\n",
     384        printf("Loops: %ld, Iterations: %d, Duration: %f sec.\n",
    376385                        LOOP, II, finisec-startsec);
    377386
    378         KIPS = (100.0*LOOP*II)/(float)(finisec-startsec);
     387        KIPS = (100.0*LOOP*II)/(finisec-startsec);
    379388        if (KIPS >= 1000.0)
    380389                printf("C Converted Double Precision Whetstones: %.1f MIPS\n", KIPS/1000.0);
  • testsuites/benchmarks/whetstone/whetstone.scn

    r3785f937 ra1c60b56  
     1*** BEGIN OF TEST WHETSTONE ***
     2
     3Loops: 10000, Iterations: 1, Duration: 347.679499 sec.
     4C Converted Double Precision Whetstones: 2.9 MIPS
     5*** END OF TEST WHETSTONE ***
Note: See TracChangeset for help on using the changeset viewer.