[arrayfire] 17/75: BUGFIX: Fixed issues with offsets in moddims after using indexing
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Mon Feb 29 08:01:09 UTC 2016
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 2d595034d8eff1d69df86912fa5f72356cbed834
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date: Thu Feb 11 13:41:44 2016 -0500
BUGFIX: Fixed issues with offsets in moddims after using indexing
---
src/api/c/moddims.cpp | 1 +
src/backend/cpu/Array.hpp | 5 +++++
src/backend/cuda/Array.hpp | 5 +++++
src/backend/opencl/Array.hpp | 5 +++++
4 files changed, 16 insertions(+)
diff --git a/src/api/c/moddims.cpp b/src/api/c/moddims.cpp
index 132086a..b8f1faf 100644
--- a/src/api/c/moddims.cpp
+++ b/src/api/c/moddims.cpp
@@ -32,6 +32,7 @@ Array<T> modDims(const Array<T>& in, const af::dim4 &newDims)
}
Out.modDims(newDims);
+ Out.setDataDims(newDims);
return Out;
}
diff --git a/src/backend/cpu/Array.hpp b/src/backend/cpu/Array.hpp
index eb17852..0c6e701 100644
--- a/src/backend/cpu/Array.hpp
+++ b/src/backend/cpu/Array.hpp
@@ -173,6 +173,11 @@ namespace cpu
return isOwner() ? info.dims() : data_dims;
}
+ void setDataDims(const dim4 &new_dims)
+ {
+ data_dims = new_dims;
+ }
+
T* device()
{
getQueue().sync();
diff --git a/src/backend/cuda/Array.hpp b/src/backend/cuda/Array.hpp
index c6cdd21..03bd8b3 100644
--- a/src/backend/cuda/Array.hpp
+++ b/src/backend/cuda/Array.hpp
@@ -168,6 +168,11 @@ namespace cuda
return isOwner() ? dims() : data_dims;
}
+ void setDataDims(const dim4 &new_dims)
+ {
+ data_dims = new_dims;
+ }
+
T* device()
{
if (!isOwner() || data.use_count() > 1) {
diff --git a/src/backend/opencl/Array.hpp b/src/backend/opencl/Array.hpp
index 207e303..f2a217e 100644
--- a/src/backend/opencl/Array.hpp
+++ b/src/backend/opencl/Array.hpp
@@ -200,6 +200,11 @@ namespace opencl
return isOwner() ? dims() : data_dims;
}
+ void setDataDims(const dim4 &new_dims)
+ {
+ data_dims = new_dims;
+ }
+
operator Param() const
{
KParam info = {{dims()[0], dims()[1], dims()[2], dims()[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