OpenCL, beginner help

I have to ask because I just don’t know what the problem is, I’m sure why I don’t understand what’s wrong because the book I’m reading is in C++, but the Issue is that the return is just complete 0.0
and doesn’t do what I intended which is to multiply A with B and put it in C then print out the FloatBuffer C. I usually wouldn’t post the whole code and ask for someone to help, but I don’t know the point of the issue. but hey atleast the code isn’t long :slight_smile:

EDIT: okay so I used Util.checkCLError( … ) to get any returned errors and found a few, which I’ve solved. There were a few with memory allocation. But it hasn’t changed the final results.

The Code is here:
http://pastebin.java-gaming.org/8056e321e31
and Kernal is here:
http://pastebin.java-gaming.org/2b805161e32

Simple soultion, the work size wasn’t being defined correctly, it should of been this.


PointerBuffer globalWorkSize = BufferUtils.createPointerBuffer(1);
globalWorkSize.put(0, A.length);

not this


PointerBuffer globalWorkSize = BufferUtils.createPointerBuffer(A.length);