[arrayfire] 281/408: BUGFIX: Fixed a bug for unwrap in all backends

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Sep 21 19:12:14 UTC 2015


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

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

commit a958628afb2e1e7bf62d207bc5784a9c367678aa
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date:   Tue Aug 18 16:12:50 2015 -0400

    BUGFIX: Fixed a bug for unwrap in all backends
    
    - The output dimensions were being calculated incorrectly
---
 src/api/c/unwrap.cpp          | 4 ++--
 src/backend/cpu/unwrap.cpp    | 2 +-
 src/backend/cuda/unwrap.cu    | 2 +-
 src/backend/opencl/unwrap.cpp | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/api/c/unwrap.cpp b/src/api/c/unwrap.cpp
index 5bb6fcd..2e80d94 100644
--- a/src/api/c/unwrap.cpp
+++ b/src/api/c/unwrap.cpp
@@ -34,8 +34,8 @@ af_err af_unwrap(af_array *out, const af_array in, const dim_t wx, const dim_t w
         af_dtype type = info.getType();
         af::dim4 idims = info.dims();
 
-        DIM_ASSERT(2, wx > 0 && wx <= idims[0] + px);
-        DIM_ASSERT(3, wy > 0 && wy <= idims[1] + py);
+        ARG_ASSERT(2, wx > 0 && wx <= idims[0] + px);
+        ARG_ASSERT(3, wy > 0 && wy <= idims[1] + py);
         ARG_ASSERT(4, sx > 0);
         ARG_ASSERT(5, sy > 0);
         ARG_ASSERT(6, px >= 0 && px < wx);
diff --git a/src/backend/cpu/unwrap.cpp b/src/backend/cpu/unwrap.cpp
index 0de292e..25a8d32 100644
--- a/src/backend/cpu/unwrap.cpp
+++ b/src/backend/cpu/unwrap.cpp
@@ -79,7 +79,7 @@ namespace cpu
         af::dim4 idims = in.dims();
 
         dim_t nx = (idims[0] + 2 * px - wx) / sx + 1;
-        dim_t ny = (idims[1] + 2 * py - wy) / sx + 1;
+        dim_t ny = (idims[1] + 2 * py - wy) / sy + 1;
 
         af::dim4 odims(wx * wy, nx * ny, idims[2], idims[3]);
 
diff --git a/src/backend/cuda/unwrap.cu b/src/backend/cuda/unwrap.cu
index 5fdfc0e..8600ca1 100644
--- a/src/backend/cuda/unwrap.cu
+++ b/src/backend/cuda/unwrap.cu
@@ -22,7 +22,7 @@ namespace cuda
         af::dim4 idims = in.dims();
 
         dim_t nx = (idims[0] + 2 * px - wx) / sx + 1;
-        dim_t ny = (idims[1] + 2 * py - wy) / sx + 1;
+        dim_t ny = (idims[1] + 2 * py - wy) / sy + 1;
 
         af::dim4 odims;
 
diff --git a/src/backend/opencl/unwrap.cpp b/src/backend/opencl/unwrap.cpp
index 2a1662f..e0676ca 100644
--- a/src/backend/opencl/unwrap.cpp
+++ b/src/backend/opencl/unwrap.cpp
@@ -22,7 +22,7 @@ namespace opencl
         af::dim4 idims = in.dims();
 
         dim_t nx = (idims[0] + 2 * px - wx) / sx + 1;
-        dim_t ny = (idims[1] + 2 * py - wy) / sx + 1;
+        dim_t ny = (idims[1] + 2 * py - wy) / sy + 1;
 
         af::dim4 odims(wx * wy, nx * ny, idims[2], idims[3]);
 

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