Nicolas Winkler 6 年之前
父节点
当前提交
4299100d30
共有 3 个文件被更改,包括 6 次插入6 次删除
  1. 3 3
      MandelWidget.cpp
  2. 2 2
      libmandel/src/CpuGeneratorsAVX.cpp
  3. 1 1
      libmandel/src/mandel.cpp

+ 3 - 3
MandelWidget.cpp

@@ -216,7 +216,7 @@ void MandelView::adaptViewport(const MandelInfo mi)
 MandelWidget::MandelWidget(mnd::MandelContext& ctxt, QWidget* parent) :
     QGLWidget{ QGLFormat(QGL::SampleBuffers), parent },
     mndContext{ ctxt },
-    mv{ ctxt.getDefaultGenerator(), this }
+    mv{ ctxt.getCpuGeneratorFloat(), this }
 {
     this->setContentsMargins(0, 0, 0, 0);
     this->setSizePolicy(QSizePolicy::Expanding,
@@ -224,11 +224,11 @@ MandelWidget::MandelWidget(mnd::MandelContext& ctxt, QWidget* parent) :
     QObject::connect(&mv, &MandelView::updated, this, &MandelWidget::viewUpdated, Qt::AutoConnection);
     QObject::connect(this, &MandelWidget::needsUpdate, &mv, &MandelView::adaptViewport, Qt::DirectConnection);
 
-    if (!ctxt.getDevices().empty()) {
+    /*if (!ctxt.getDevices().empty()) {
         if (auto* gen = ctxt.getDevices()[0].getGeneratorDouble(); gen) {
             mv.setGenerator(*gen);
         }
-    }
+    }*/
 }
 
 

+ 2 - 2
libmandel/src/CpuGeneratorsAVX.cpp

@@ -48,7 +48,7 @@ void CpuGeneratorAvxFloat::generate(const mnd::MandelInfo& info, float* data)
                 __m256i cmp = _mm256_castps_si256(_mm256_cmp_ps(_mm256_add_ps(aa, bb), threshold, _CMP_LE_OQ));
                 adder = _mm256_and_ps(adder, _mm256_castsi256_ps(cmp));
                 counter = _mm256_add_ps(counter, adder);
-                if (_mm256_testz_si256(cmp, cmp) != 0) {
+                if ((k & 0x7) == 0 && _mm256_testz_si256(cmp, cmp) != 0) {
                     break;
                 }
             }
@@ -108,7 +108,7 @@ void CpuGeneratorAvxDouble::generate(const mnd::MandelInfo& info, float* data)
                 __m256i cmp = _mm256_castpd_si256(_mm256_cmp_pd(_mm256_add_pd(aa, bb), threshold, _CMP_LE_OQ));
                 adder = _mm256_and_pd(adder, _mm256_castsi256_pd(cmp));
                 counter = _mm256_add_pd(counter, adder);
-                if (_mm256_testz_si256(cmp, cmp) != 0) {
+                if ((k & 0x7) == 0 && _mm256_testz_si256(cmp, cmp) != 0) {
                     break;
                 }
             }

+ 1 - 1
libmandel/src/mandel.cpp

@@ -87,7 +87,7 @@ std::vector<MandelDevice> MandelContext::createDevices(void)
 #ifdef WITH_OPENCL
     std::vector<cl::Platform> platforms;
     cl::Platform::get(&platforms);
-    //platforms.erase(platforms.begin() + 1);
+    platforms.erase(platforms.begin() + 1);
 
     for (auto& platform : platforms) {
         std::string name = platform.getInfo<CL_PLATFORM_NAME>();