Début du TP convolution. Pour l'instant uniquement lecture d'une vidéo.
[GPU.git] / WCudaMSE / Student_Cuda_Image / src / cpp / core / 02_Mandelbrot_Julia / moo / host / Fractal.cu
index 67c8b74..9228000 100755 (executable)
@@ -79,6 +79,25 @@ FractalMandelbrot::FractalMandelbrot(int w, int h, int dn, bool multiGPU) :
         }\r
     }\r
 \r
+FractalMandelbrot::~FractalMandelbrot()\r
+    {\r
+    if (this->multiGPU)\r
+        {\r
+        const int nbDevice = Device::getDeviceCount();\r
+\r
+        for (int i = 0; i < nbDevice - 1; ++i)\r
+            {\r
+            HANDLE_ERROR(cudaSetDevice(i + 1));\r
+            HANDLE_ERROR(cudaFree(this->ptrDevPixelsMultGPU[i]));\r
+            }\r
+\r
+        HANDLE_ERROR(cudaSetDevice(0));\r
+        delete[] this->ptrDevPixelsMultGPU;\r
+        }\r
+\r
+    cout << "OKOKOKOK" << endl;\r
+    }\r
+\r
 void FractalMandelbrot::animationStep()\r
     {\r
     this->n = this->variateurAnimationN.varierAndGet();\r