Re: using shared memory using jocl

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: using shared memory using jocl

Michael Bien
Hello Harish,

do you have a self contained testcase? I would like to take a look this weekend.

regards,
michael


On 10/01/2010 06:15 AM, harishd [via jogamp] wrote:
Hi,

I'm trying to get the hang of jocl, and I seem to be unable to find a way to use local variables in the kernel.
This is done by the cl call clSetKernelArg(kernel, index, size, NULL) in c, but I'm unable to find the corresponding api call in jocl to do this.

when I try it by calling kernel.setArg(index, clBuffer), where clBuffer has the given size, but not initialized, I get the following exception
Exception in thread "main" com.jogamp.opencl.CLException$CLInvalidArgValueException: error setting arg 6 to value java.nio.DirectByteBuffer[pos=0 lim=24 cap=24] of size 4 of CLKernel [id: 160042672 name: init]
error: CL_INVALID_ARG_VALUE

Am I missing out something?

thanks,
Harish.


View message @ http://jogamp.762907.n3.nabble.com/using-shared-memory-using-jocl-tp1612561p1612561.html
To start a new topic under jogamp, email [hidden email]
To unsubscribe from jogamp, click here.


-- 
http://michael-bien.com/
Reply | Threaded
Open this post in threaded view
|

Re: using shared memory using jocl

harishd
Hi Micheal,

Actually I was calling the wrong function. I later found that I should actually be using
kernel.setNullArg(argumentIndex, size). This resolved the issue.

thanks,
Harish.
Reply | Threaded
Open this post in threaded view
|

Re: using shared memory using jocl

Michael Bien
good that its working for you.

Would setArgToNull be a better name for this method? Hmm, or maybe even exposing setArg(int argumentIndex, Buffer value) directly...

feedback is very appreciated,

best regards,
michael

On 10/02/2010 01:19 PM, harishd [via jogamp] wrote:
Hi Micheal,

Actually I was calling the wrong function. I later found that I should actually be using
kernel.setNullArg(argumentIndex, size). This resolved the issue.

thanks,
Harish.



View message @ http://jogamp.762907.n3.nabble.com/Re-using-shared-memory-using-jocl-tp1614904p1619518.html
To start a new topic under jogamp, email [hidden email]
To unsubscribe from jogamp, click here.


-- 
- - - -
http://michael-bien.com
Reply | Threaded
Open this post in threaded view
|

Re: using shared memory using jocl

harishd
I agree that "setArgToNull" would be a better name for this method and would recommend that the name is changed.

regards,
Harish.