diff.sql 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. .headers ON
  2. /*
  3. Select the core to be used as reference. Only last day of measurements is used.
  4. */
  5. CREATE TEMP VIEW if not exists refCore AS select *
  6. from Unary
  7. where coreid=5 AND DATE BETWEEN datetime('now','localtime','-23 hours') AND datetime('now', 'localtime');
  8. ;
  9. /*
  10. Select the cores to be benchmarked compared with the reference. Only last day of measurements is used.
  11. */
  12. CREATE TEMP VIEW if not exists otherCores AS select *
  13. from Unary
  14. where coreid != 5 AND DATE BETWEEN datetime('now','localtime','-23 hours') AND datetime('now', 'localtime');
  15. ;
  16. /*
  17. Using regression database, compute the ratio using max cycles
  18. and max degree regression coefficient.
  19. Change name of columns for result
  20. USING(ID,categoryid,NAME) : would have to be extended with any parameter defining the regression
  21. formula.
  22. For instamce, for FFT, if ifft is an external parameter then ifft flag should be
  23. here.
  24. Here we assume ref and others are generated with same settings and currentConfig.csv
  25. If not the case, the parameters which may be different (like LOOPUNROLL, OPTIMIZED...)
  26. should be added here so that we join the ref and other cores on common benchmark definition.
  27. We should not compute ratio between configuration of benchmarks which are
  28. not matching.
  29. If we want to compute ratio between CORE AND PLATFORM then the view above should
  30. be using CORE AND PLATFORM to filter and define the references.
  31. */
  32. select otherCores.ID as ID,
  33. CATEGORY.category as CATEGORY,
  34. otherCores.NAME as NAME,
  35. (1.0*refCore.MAX / otherCores.MAX) as MAXRATIO,
  36. (1.0*refCore.MAXREGCOEF / otherCores.MAXREGCOEF) as REGRESSIONRATIO,
  37. PLATFORM.platform as PLATFORM,
  38. CORE.core as CORE,
  39. COMPILERKIND.compiler as COMPILER,
  40. COMPILER.version as COMPILERVERSION,
  41. TYPE.type as TYPE,
  42. otherCores.DATE as DATE
  43. from otherCores
  44. INNER JOIN refCore ON refCore.ID = otherCores.ID AND refCore.categoryid = otherCores.categoryid AND refCore.NAME = otherCores.NAME
  45. INNER JOIN CATEGORY ON CATEGORY.categoryid = otherCores.categoryid
  46. INNER JOIN PLATFORM ON PLATFORM.platformid = otherCores.platformid
  47. INNER JOIN CORE ON CORE.coreid = otherCores.coreid
  48. INNER JOIN COMPILER ON COMPILER.compilerid = otherCores.compilerid
  49. INNER JOIN COMPILERKIND ON COMPILERKIND.compilerkindid = COMPILER.compilerkindid
  50. INNER JOIN TYPE ON TYPE.typeid = otherCores.typeid;