Nicolas Winkler před 5 roky
rodič
revize
022f587a83
3 změnil soubory, kde provedl 8 přidání a 12 odebrání
  1. 2 2
      Almond.pro
  2. 5 9
      benchmarkdialog.cpp
  3. 1 1
      libmandel/src/Generators.cpp

+ 2 - 2
Almond.pro

@@ -129,8 +129,8 @@ unix|win32: LIBS += -L$$PWD/libmandel/ -lmandel -lqd
 INCLUDEPATH += $$PWD/libmandel/include
 DEPENDPATH += $$PWD/libmandel/include
 
-win32:!win32-g++: PRE_TARGETDEPS += $$PWD/libmandel/mandel.lib
-else:unix|win32-g++: PRE_TARGETDEPS += $$PWD/libmandel/libmandel.a
+win32:!win32-g++: PRE_TARGETDEPS += $$PWD/libmandel/mandel.lib  $$PWD/libmandel/qd.lib
+else:unix|win32-g++: PRE_TARGETDEPS += $$PWD/libmandel/libmandel.a $$PWD/libmandel/qd.lib
 
 
 win32:CONFIG(release, debug|release): LIBS += -L$$PWD/'../../../../../Program Files (x86)/OCL_SDK_Light/lib/x86/' -lopencl

+ 5 - 9
benchmarkdialog.cpp

@@ -71,30 +71,26 @@ double Benchmarker::benchmarkResult(mnd::Generator& mg) const
 
     for (size_t i = 0; i < benches.size(); i++) {
         const mnd::MandelInfo& mi = benches[i];
-        //auto data = std::make_unique<float[]>(size_t(mi.bWidth * mi.bHeight));
         Bitmap<float> bmp(mi.bWidth, mi.bHeight);
         auto [iters, time] = measureMips([&mg, &mi, &bmp]() {
             mg.generate(mi, bmp.pixels.get());
             return &bmp;
         });
-        //printf("benchmark lvl %d, time %d ms\n", i, time.count() / 1000 / 1000);
-        //fflush(stdout);
-        if (time > std::chrono::milliseconds(1000)) {
-            testIndex = i + 1;
+        if (time > std::chrono::milliseconds(500)) {
+            testIndex = i + 0;
+            //printf("testing index %d\n", testIndex);
+            fflush(stdout);
             break;
         }
     }
 
 
     const mnd::MandelInfo& mi = benches[(testIndex >= benches.size()) ? (benches.size() - 1) : testIndex];
-    //auto data = std::make_unique<float[]>(mi.bWidth * mi.bHeight);
     Bitmap<float> bmp(mi.bWidth, mi.bHeight);
     auto [iters, time] = measureMips([&mg, &mi, &bmp]() {
         mg.generate(mi, bmp.pixels.get());
         return &bmp;
     });
-    //printf("bench time %d ms\n", time.count() / 1000 / 1000);
-    //fflush(stdout);
 
     return double(iters) / time.count() * 1000;
 }
@@ -195,7 +191,7 @@ void Benchmarker::start(void)
 
 
 BenchmarkDialog::BenchmarkDialog(mnd::MandelContext& mndContext, QWidget *parent) :
-    QDialog(parent),
+    QDialog{ parent },
     mndContext{ mndContext },
     benchmarker{ mndContext }
 {

+ 1 - 1
libmandel/src/Generators.cpp

@@ -25,7 +25,7 @@ AdaptiveGenerator::AdaptiveGenerator(Generator* floatGen, Generator* doubleGen,
 }*/
 
 
-void AdaptiveGenerator::addGenerator(const Real& precision, Generator& generator)
+void AdaptiveGenerator::addGenerator(const mnd::Real& precision, mnd::Generator& generator)
 {
     generators.insert({ precision, &generator });
 }