Commit 8adf2b8cd1dcc0b047d30c16bfedb7eccdc40bd8

Authored by manumachu
1 parent e68f204c

IEE MOP TC: Adding DGEMM MOP results...

tests/dgemmmop160GHz.cpp 0 → 100644
  1 +
  2 +/*--------------------------------------------------------*/
  3 +
  4 +#include <stdio.h>
  5 +#include <stdlib.h>
  6 +#include <sys/time.h>
  7 +
  8 +/*--------------------------------------------------------*/
  9 +
  10 +#include <ephomo.h>
  11 +#include <eperr.h>
  12 +
  13 +/*--------------------------------------------------------*/
  14 +
  15 +#include "helpers.h"
  16 +#include "dgemmparams160GHz.h"
  17 +
  18 +/*--------------------------------------------------------*/
  19 +
  20 +int main(int argc, char** argv)
  21 +{
  22 + if (argc != 5)
  23 + {
  24 + fprintf(
  25 + stderr,
  26 + "Usage: %s <n in granularity> <p> <verbosity> <objType>.\n"
  27 + "if p is 0, then 2 to 64 values are evaluated.\n"
  28 + "objtype: [0-5]\n"
  29 + "0 - ENERGY\n"
  30 + "1 - PERFORMANCE\n"
  31 + "2 - MOPEP\n"
  32 + "3 - EDP\n"
  33 + "4 - EDDP\n"
  34 + "5 - EDDDP.\n",
  35 + argv[0]);
  36 + exit(EXIT_FAILURE);
  37 + }
  38 +
  39 + size_t n = strtoul(argv[1], NULL, 10) * deltaX;
  40 + size_t p = strtoul(argv[2], NULL, 10);
  41 + unsigned int verbosity = strtoul(argv[3], NULL, 10);
  42 + HclOptObjective objType = (HclOptObjective)strtoul(argv[4], NULL, 10);
  43 +
  44 + size_t npoints = sizeof(etimes)/sizeof(size_t);
  45 + size_t point, *psizes = (size_t*)malloc(sizeof(size_t)*npoints);
  46 +
  47 + for (point = 0; point < npoints; point++)
  48 + {
  49 + psizes[point] = (point + 1) * deltaX;
  50 + }
  51 +
  52 + for (point = 0; point < npoints; point++)
  53 + {
  54 + energies[point] -= etimes[point] * 100.0;
  55 +
  56 + if (energies[point] < 0.0)
  57 + {
  58 + energies[point] = energiesSD[point];
  59 + }
  60 + }
  61 +
  62 + printf(
  63 + "MOP for n:%zu, dX:%u, Num points in S:%zu.\n",
  64 + n, deltaX, npoints);
  65 +
  66 + size_t nSolutions, nParetoSolutions;
  67 + double* path, *paretoFront;
  68 + int rc = hcl_mop(
  69 + verbosity,
  70 + objType,
  71 + n, p, deltaX,
  72 + npoints, psizes, etimes, energies,
  73 + &nSolutions, &path,
  74 + 1,
  75 + &nParetoSolutions, &paretoFront);
  76 +
  77 + if (rc != HCL_SUCCESS)
  78 + {
  79 + fprintf(
  80 + stderr,
  81 + "%s\n",
  82 + hcl_get_error_message(rc)
  83 + );
  84 + exit(EXIT_FAILURE);
  85 + }
  86 +
  87 + free(psizes);
  88 +
  89 + printf("Objective %s path.\n", hcl_get_objective_type(objType));
  90 + printf("===============================================\n");
  91 + printPESolutions(
  92 + nSolutions, path
  93 + );
  94 +
  95 + printf("Pareto Optimal Front.\n");
  96 + printf("===============================================\n");
  97 + printPESolutions(
  98 + nParetoSolutions, paretoFront
  99 + );
  100 +
  101 + if (nSolutions)
  102 + {
  103 + free(path);
  104 + }
  105 +
  106 + if (nParetoSolutions)
  107 + {
  108 + free(paretoFront);
  109 + }
  110 +
  111 + exit(EXIT_SUCCESS);
  112 +}
  113 +
  114 +/*--------------------------------------------------------*/
... ...
tests/dgemmmop2GHz.cpp
... ... @@ -49,6 +49,16 @@ int main(int argc, char** argv)
49 49 psizes[point] = (point + 1) * deltaX;
50 50 }
51 51  
  52 + for (point = 0; point < npoints; point++)
  53 + {
  54 + energies[point] -= etimes[point] * 100.0;
  55 +
  56 + if (energies[point] < 0.0)
  57 + {
  58 + energies[point] = energiesSD[point];
  59 + }
  60 + }
  61 +
52 62 printf(
53 63 "MOP for n:%zu, dX:%u, Num points in S:%zu.\n",
54 64 n, deltaX, npoints);
... ...
tests/dgemmparams160GHz.h 0 → 100644
  1 +
  2 +/*--------------------------------------------------------*/
  3 +
  4 +#ifndef _DGEMM_PARAMS_HH
  5 +#define _DGEMM_PARAMS_HH
  6 +
  7 +/*--------------------------------------------------------*/
  8 +
  9 +#include "dgemmetimes160GHz.h"
  10 +#include "dgemmenergies160GHz.h"
  11 +#include "dgemmenergies160GHzSD.h"
  12 +
  13 +/*--------------------------------------------------------*/
  14 +
  15 +unsigned int deltaX = 1024 * 1024;
  16 +
  17 +/*--------------------------------------------------------*/
  18 +
  19 +#endif
  20 +
  21 +/*--------------------------------------------------------*/
... ...
tests/dgemmparams2GHz.h
... ... @@ -8,6 +8,7 @@
8 8  
9 9 #include "dgemmetimes2GHz.h"
10 10 #include "dgemmenergies2GHz.h"
  11 +#include "dgemmenergies2GHzSD.h"
11 12  
12 13 /*--------------------------------------------------------*/
13 14  
... ...
tests/fftwmop160GHz.cpp
... ... @@ -51,14 +51,12 @@ int main(int argc, char** argv)
51 51  
52 52 for (point = 0; point < npoints; point++)
53 53 {
54   - energies[point] -= etimes[point] * 205.0;
  54 + energies[point] -= etimes[point] * 100.0;
55 55  
56 56 if (energies[point] < 0.0)
57 57 {
58 58 energies[point] = energiesSD[point];
59 59 }
60   -
61   - energies[point] *= p;
62 60 }
63 61  
64 62 printf(
... ...
tests/fftwmop2GHz.cpp
... ... @@ -51,14 +51,12 @@ int main(int argc, char** argv)
51 51  
52 52 for (point = 0; point < npoints; point++)
53 53 {
54   - energies[point] -= etimes[point] * 205.0;
  54 + energies[point] -= etimes[point] * 100.0;
55 55  
56 56 if (energies[point] < 0.0)
57 57 {
58 58 energies[point] = energiesSD[point];
59 59 }
60   -
61   - energies[point] *= p;
62 60 }
63 61  
64 62 printf(
... ...