[arrayfire] 34/61: Compile fixes for older compilers

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Dec 8 11:55:07 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 4d75c78dc7e141cad201bb99cf2f271d4f7026d7
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date:   Tue Dec 1 12:15:21 2015 -0500

    Compile fixes for older compilers
---
 src/backend/cpu/Array.cpp    | 2 ++
 src/backend/cpu/Array.hpp    | 2 +-
 src/backend/cuda/Array.cpp   | 2 ++
 src/backend/cuda/Array.hpp   | 2 +-
 src/backend/opencl/Array.cpp | 3 ++-
 src/backend/opencl/Array.hpp | 4 ++--
 6 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/backend/cpu/Array.cpp b/src/backend/cpu/Array.cpp
index 3829a9a..8cf1b75 100644
--- a/src/backend/cpu/Array.cpp
+++ b/src/backend/cpu/Array.cpp
@@ -279,6 +279,8 @@ namespace cpu
     template       Array<T>  createNodeArray<T>       (const dim4 &size, TNJ::Node_ptr node); \
     template       void Array<T>::eval();                               \
     template       void Array<T>::eval() const;                         \
+    template       Array<T>::Array(af::dim4 dims, const T * const in_data, \
+                                   bool is_device, bool copy_device);   \
     template       TNJ::Node_ptr Array<T>::getNode() const;             \
     template       void      writeHostDataArray<T>    (Array<T> &arr, const T * const data, const size_t bytes); \
     template       void      writeDeviceDataArray<T>  (Array<T> &arr, const void * const data, const size_t bytes); \
diff --git a/src/backend/cpu/Array.hpp b/src/backend/cpu/Array.hpp
index e9e40db..471a674 100644
--- a/src/backend/cpu/Array.hpp
+++ b/src/backend/cpu/Array.hpp
@@ -163,7 +163,7 @@ namespace cpu
         T* device()
         {
             if (!isOwner() || data.use_count() > 1) {
-                *this = Array(dims(), get(), true, true);
+                *this = Array<T>(dims(), get(), true, true);
             }
             return this->data.get();
         }
diff --git a/src/backend/cuda/Array.cpp b/src/backend/cuda/Array.cpp
index 8b05fc0..275ea13 100644
--- a/src/backend/cuda/Array.cpp
+++ b/src/backend/cuda/Array.cpp
@@ -281,6 +281,8 @@ namespace cuda
     template       void      destroyArray<T>          (Array<T> *A);    \
     template       void      evalArray<T>             (const Array<T> &A); \
     template       Array<T>  createNodeArray<T>       (const dim4 &size, JIT::Node_ptr node); \
+    template       Array<T>::Array(af::dim4 dims, const T * const in_data, \
+                                   bool is_device, bool copy_device);   \
     template       Array<T>::~Array        ();                          \
     template       void Array<T>::eval();                               \
     template       void Array<T>::eval() const;                         \
diff --git a/src/backend/cuda/Array.hpp b/src/backend/cuda/Array.hpp
index 3117675..598fdfd 100644
--- a/src/backend/cuda/Array.hpp
+++ b/src/backend/cuda/Array.hpp
@@ -172,7 +172,7 @@ namespace cuda
         T* device()
         {
             if (!isOwner() || data.use_count() > 1) {
-                *this = Array(dims(), get(), true, true);
+                *this = Array<T>(dims(), get(), true, true);
             }
             return this->data.get();
         }
diff --git a/src/backend/opencl/Array.cpp b/src/backend/opencl/Array.cpp
index 00635e1..0860098 100644
--- a/src/backend/opencl/Array.cpp
+++ b/src/backend/opencl/Array.cpp
@@ -218,7 +218,7 @@ namespace opencl
     {
         verifyDoubleSupport<T>();
 
-        return Array<T>(size, (cl_mem)(data));
+        return Array<T>(size, (cl_mem)(data), 0, false);
     }
 
     template<typename T>
@@ -314,6 +314,7 @@ namespace opencl
     template       void      destroyArray<T>          (Array<T> *A);    \
     template       void      evalArray<T>             (const Array<T> &A); \
     template       Array<T>  createNodeArray<T>       (const dim4 &size, JIT::Node_ptr node); \
+    template       Array<T>::Array(af::dim4 dims, cl_mem mem, size_t src_offset, bool copy); \
     template       Array<T>::~Array        ();                          \
     template       void Array<T>::eval();                               \
     template       void Array<T>::eval() const;                         \
diff --git a/src/backend/opencl/Array.hpp b/src/backend/opencl/Array.hpp
index 50da72e..1db0ab6 100644
--- a/src/backend/opencl/Array.hpp
+++ b/src/backend/opencl/Array.hpp
@@ -101,7 +101,7 @@ namespace opencl
         Array(Param &tmp);
         explicit Array(af::dim4 dims, JIT::Node_ptr n);
         explicit Array(af::dim4 dims, const T * const in_data);
-        explicit Array(af::dim4 dims, cl_mem mem, size_t offset = 0, bool copy = false);
+        explicit Array(af::dim4 dims, cl_mem mem, size_t offset, bool copy);
 
     public:
 
@@ -154,7 +154,7 @@ namespace opencl
         cl::Buffer* device()
         {
             if (!isOwner() || data.use_count() > 1) {
-                *this = Array(dims(), (*get())(), getOffset(), true);
+                *this = Array<T>(dims(), (*get())(), (size_t)getOffset(), true);
             }
             return this->data.get();
         }

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