[arrayfire] 236/284: BUGFIX Fix how streams are created in setActiveDevice (CUDA)

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Sun Feb 7 18:59:37 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 3ce49a5dd347892d9a9226dc9d31360e7aa2851c
Author: Shehzan Mohammed <shehzan at arrayfire.com>
Date:   Wed Jan 20 14:40:28 2016 -0500

    BUGFIX Fix how streams are created in setActiveDevice (CUDA)
    
    Ref 968ae4e80ce8e6263fdc3f4381ae8b895df44bc4
---
 src/backend/cuda/platform.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/backend/cuda/platform.cpp b/src/backend/cuda/platform.cpp
index 6919a04..d172903 100644
--- a/src/backend/cuda/platform.cpp
+++ b/src/backend/cuda/platform.cpp
@@ -395,7 +395,11 @@ int DeviceManager::setActiveDevice(int device, int nId)
     int old = activeDev;
     if(nId == -1) nId = getDeviceNativeId(device);
     CUDA_CHECK(cudaSetDevice(nId));
-    cudaError_t err = cudaStreamCreate(&streams[device]);
+
+    cudaError_t err = cudaSuccess;
+    if(!streams[device])
+        err = cudaStreamCreate(&streams[device]);
+
     activeDev = device;
 
     if (err == cudaSuccess) return old;

-- 
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