cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

evk8888
Journeyman III

Using data with using opencl buffer

Can I have arguments for a kernel which are not cl buffer

Hi all,

 

Is it possible to have, say a array temp []  to be a argument for a kernel without it being written into a cl buffer. I know in GPU we need to transfer but in smp machines, is it always needed to create a cl buffer for a kernel to access??

Thanks

vk.

0 Likes
3 Replies
tonyo_au
Journeyman III

I believe there are just 2 types of arguments

A pointer to an opencl buffer (which can be an OpenGL buffer or a DirectX surface) and local buffers.

 

Local buffers are space reserved in local memory (might be the wrong term) for the duration of the kernel execution.

you create these by the call

  clSetKernelArg(kernel, arg++, localMemBufferSizeInBytes, (void *)NULL);

 

I assume this is what you mean by a temporary array

0 Likes

well you can also use single value as kernel parameter. for example one float, int or vector or even single struct which can contain array which have static size. i think that for example montecarlo example from SDK use struct as parameter for kernel.

0 Likes

Thanks guys..

0 Likes