X-Git-Url: http://git.euphorik.ch/?p=GPU.git;a=blobdiff_plain;f=WCudaMSE%2FStudent_Cuda_Image%2Fsrc%2Fcpp%2Fcore%2F02_Mandelbrot_Julia%2Fmoo%2Fhost%2FFractal.cu;h=92280002291cf66835fc1da41968959f794755ec;hp=67c8b74734c00c35b7faf8b53b0ff1189a7cf442;hb=4182eb3a07b7143afb8ebebfe77e8ef8e8abc266;hpb=fd0031be0a39a5d902750affaff6322fcd5229b1 diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/moo/host/Fractal.cu b/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/moo/host/Fractal.cu index 67c8b74..9228000 100755 --- a/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/moo/host/Fractal.cu +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/moo/host/Fractal.cu @@ -79,6 +79,25 @@ FractalMandelbrot::FractalMandelbrot(int w, int h, int dn, bool multiGPU) : } } +FractalMandelbrot::~FractalMandelbrot() + { + if (this->multiGPU) + { + const int nbDevice = Device::getDeviceCount(); + + for (int i = 0; i < nbDevice - 1; ++i) + { + HANDLE_ERROR(cudaSetDevice(i + 1)); + HANDLE_ERROR(cudaFree(this->ptrDevPixelsMultGPU[i])); + } + + HANDLE_ERROR(cudaSetDevice(0)); + delete[] this->ptrDevPixelsMultGPU; + } + + cout << "OKOKOKOK" << endl; + } + void FractalMandelbrot::animationStep() { this->n = this->variateurAnimationN.varierAndGet();