[arrayfire] 23/61: BUGFIX: GFOR assignment when other dimensions have step indices

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Dec 8 11:55:04 UTC 2015


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

ghisvail-guest pushed a commit to branch dfsg-clean
in repository arrayfire.

commit 75c217280dc0188e73558a84935be296bb30f4e8
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date:   Sun Nov 29 16:09:33 2015 -0500

    BUGFIX: GFOR assignment when other dimensions have step indices
---
 src/api/cpp/array.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/api/cpp/array.cpp b/src/api/cpp/array.cpp
index 208f60e..03de174 100644
--- a/src/api/cpp/array.cpp
+++ b/src/api/cpp/array.cpp
@@ -493,15 +493,16 @@ namespace af
         bool batch_assign = false;
         bool is_reordered = false;
         if (dim >= 0) {
+            //FIXME: Figure out a faster, cleaner way to do this
+            dim4 out_dims = seqToDims(impl->indices, this_dims, false);
+
             batch_assign = true;
             for (int i = 0; i < AF_MAX_DIMS; i++) {
                 if (this->impl->indices[i].isBatch) batch_assign &= (other_dims[i] == 1);
-                else                          batch_assign &= (other_dims[i] == this_dims[i]);
+                else                          batch_assign &= (other_dims[i] == out_dims[i]);
             }
 
             if (batch_assign) {
-                //FIXME: Figure out a faster, cleaner way to do this
-                dim4 out_dims = seqToDims(impl->indices, this_dims, false);
                 af_array out;
                 AF_THROW(af_tile(&out, other_arr,
                                  out_dims[0] / other_dims[0],
@@ -510,7 +511,7 @@ namespace af
                                  out_dims[3] / other_dims[3]));
                 other_arr = out;
 
-            } else if (this_dims != other_dims) {
+            } else if (out_dims != other_dims) {
                 // HACK: This is a quick check to see if other has been reordered inside gfor
                 // TODO: Figure out if this breaks and implement a cleaner method
                 other_arr = gforReorder(other_arr, dim);

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