[arrayfire] 12/41: BUGFIX: Ensuring the data is destroyed using the proper memory manage.

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 5f3bbb9978d4f7a302ec918a4359dcc02fdfbc31
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date:   Sun Mar 6 01:04:28 2016 -0500

    BUGFIX: Ensuring the data is destroyed using the proper memory manage.
---
 src/api/c/data.cpp | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/api/c/data.cpp b/src/api/c/data.cpp
index 522eb7d..4a88899 100644
--- a/src/api/c/data.cpp
+++ b/src/api/c/data.cpp
@@ -24,6 +24,7 @@
 #include <identity.hpp>
 #include <diagonal.hpp>
 #include <triangle.hpp>
+#include <platform.hpp>
 
 using af::dim4;
 using namespace detail;
@@ -404,7 +405,13 @@ af_err af_identity(af_array *out, const unsigned ndims, const dim_t * const dims
 af_err af_release_array(af_array arr)
 {
     try {
-        af_dtype type = getInfo(arr).getType();
+        int dev = getActiveDeviceId();
+
+        ArrayInfo info = getInfo(arr, false);
+
+        setDevice(info.getDevId());
+
+        af_dtype type = info.getType();
 
         switch(type) {
         case f32:   releaseHandle<float   >(arr); break;
@@ -421,6 +428,8 @@ af_err af_release_array(af_array arr)
         case u16:   releaseHandle<ushort  >(arr); break;
         default:    TYPE_ERROR(0, type);
         }
+
+        setDevice(dev);
     }
     CATCHALL
 

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