[Bug,100105] Make Theano OpenCL support work on Clover and RadeonSI
diff mbox

Message ID bug-100105-502-mVUoEY7Ei5@http.bugs.freedesktop.org/
State New
Headers show

Commit Message

bugzilla-daemon@freedesktop.org Sept. 18, 2017, 10:55 p.m. UTC
https://bugs.freedesktop.org/show_bug.cgi?id=100105

--- Comment #1 from Jan Vesely <jan.vesely@rutgers.edu> ---
*** Testing for AMD Radeon R7 Graphics (CARRIZO / DRM 3.18.0 / 4.11.0-ROC, LLVM
5.0.0)

Ran 6670 tests in 785.274s

FAILED (SKIP=12, errors=580, failures=12)

all errors are caused by:
TypeError: This is for CUDA arrays.

I haven't investigated the failures.


There are couple of patches needed:
https://github.com/Theano/libgpuarray/pull/534
https://github.com/Theano/libgpuarray/pull/535

http://lists.llvm.org/pipermail/libclc-dev/2017-September/002449.html

and:

Patch
diff mbox

diff --git a/src/cluda_opencl.h b/src/cluda_opencl.h
index 6e0095c..e93aa8b 100644
--- a/src/cluda_opencl.h
+++ b/src/cluda_opencl.h
@@ -48,9 +48,9 @@  typedef struct _ga_half {
 } ga_half;

 #define ga_half2float(p) vload_half(0, &((p).data))
-static inline ga_half ga_float2half(ga_float f) {
+inline ga_half ga_float2half(ga_float f) {
   ga_half r;
-  vstore_half_rtn(f, 0, &r.data);
+  vstore_half(f, 0, &r.data);
   return r;
 }
diff --git a/src/gpuarray_buffer_opencl.c b/src/gpuarray_buffer_opencl.c
index 8f12811..2041ca2 100644
--- a/src/gpuarray_buffer_opencl.c
+++ b/src/gpuarray_buffer_opencl.c
@@ -146,7 +146,7 @@  cl_ctx *cl_make_ctx(cl_context ctx, gpucontext_props *p) {
   CL_CHECKN(global_err, clGetDeviceInfo(id, CL_DEVICE_VERSION,
                                         device_version_size,
                                         device_version, NULL));
-  if (device_version[7] == '1' && device_version[9] < '2') {
+  if (device_version[7] == '1' && device_version[9] < '1') {
     error_set(global_err, GA_UNSUPPORTED_ERROR,
               "We only support OpenCL 1.2 and up");
     return NULL;