clMathLibraries / clSPARSE

a software library containing Sparse functions written in OpenCL
Apache License 2.0
173 stars 61 forks source link

reduce_block with ATOMIC_INT needs volatile _global kernel arguments #157

Closed nhaustov closed 9 years ago

nhaustov commented 9 years ago

I'm getting: atomic_reduce.cl:85:5: error: no matching function for call to 'atomic_add' atomic_add(&pSum[0], pX[idx]); ^~~~~~ opencl20_builtins.h:4254:35: note: candidate function not viable: no known conversion from 'global float ' to 'volatile __global int ' for 1st argument int __attribute((overloadable)) atomic_add(volatile __global int *p, int val);

jlgreathouse commented 9 years ago

That seems to imply that VALUE_TYPE is float while ATOMIC_INT is being passed to the kernel. I'm not yet sure how that could happen.

Is this on the master branch or the develop branch?

What program are you running that causes this error? What inputs are you giving it?

kknox commented 9 years ago

Also, please give details on the HW, OS, drivers etc.

nhaustov commented 9 years ago

I am actually doing offline compilation with an experimental compiler based on clang. I thought it was not allowing conversions from int * to volatile __global int *, but it seems the reason was wrong defines passed to clang. I'm closing the issue as it is my error.