[arrayfire] 230/284: Work around for a bug in AMD's clBuildProgram

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Sun Feb 7 18:59:36 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 34c8c97c8f2a6c8424433ddd89bc5b23c646985e
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date:   Mon Jan 18 19:15:33 2016 -0500

    Work around for a bug in AMD's clBuildProgram
    
     - Get stuck when the kernel is too large
---
 src/backend/opencl/Array.cpp | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/backend/opencl/Array.cpp b/src/backend/opencl/Array.cpp
index 207a4b0..044a632 100644
--- a/src/backend/opencl/Array.cpp
+++ b/src/backend/opencl/Array.cpp
@@ -16,6 +16,8 @@
 #include <memory.hpp>
 #include <platform.hpp>
 #include <cstddef>
+#include <af/opencl.h>
+#include <util.hpp>
 
 using af::dim4;
 
@@ -23,6 +25,7 @@ namespace opencl
 {
 
     const int MAX_JIT_LEN = 20;
+    const int MAX_JIT_LEN_AMD = 16; //FIXME: Change this when bug is fixed
     using JIT::BufferNode;
     using JIT::Node;
     using JIT::Node_ptr;
@@ -153,6 +156,14 @@ namespace opencl
 
     using af::dim4;
 
+    inline bool is_max_jit_len(const unsigned &len)
+    {
+        if (getActivePlatform() == AFCL_PLATFORM_AMD) {
+            return len >= MAX_JIT_LEN_AMD;
+        }
+        return len >= MAX_JIT_LEN;
+    }
+
     template<typename T>
     Array<T> createNodeArray(const dim4 &dims, Node_ptr node)
     {
@@ -166,7 +177,7 @@ namespace opencl
         n->getInfo(length, buf_count, bytes);
         n->resetFlags();
 
-        if (length > MAX_JIT_LEN ||
+        if (is_max_jit_len(length) ||
             buf_count >= MAX_BUFFERS ||
             bytes >= MAX_BYTES) {
             out.eval();

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