[arrayfire] 11/41: BUGFIX clFFT plans when using multiple devices

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Mar 21 14:56:21 UTC 2016


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/experimental
in repository arrayfire.

commit 82144954a13273ef23253cf52bf5d0bf607ae1e9
Author: Shehzan Mohammed <shehzan at arrayfire.com>
Date:   Wed Mar 9 15:12:15 2016 -0500

    BUGFIX clFFT plans when using multiple devices
---
 src/backend/opencl/fft.cpp | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/backend/opencl/fft.cpp b/src/backend/opencl/fft.cpp
index d5922f0..7777887 100644
--- a/src/backend/opencl/fft.cpp
+++ b/src/backend/opencl/fft.cpp
@@ -42,12 +42,16 @@ class clFFTPlanner
 
     public:
         static clFFTPlanner& getInstance() {
-            static clFFTPlanner single_instance;
-            return single_instance;
+            static clFFTPlanner instances[opencl::DeviceManager::MAX_DEVICES];
+            return instances[opencl::getActiveDeviceId()];
         }
 
         ~clFFTPlanner() {
-            CLFFT_CHECK(clfftTeardown());
+            static bool flag = true;
+            if(flag) {
+                CLFFT_CHECK(clfftTeardown());
+                flag = false;
+            }
         }
 
     private:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git



More information about the debian-science-commits mailing list