Forum Discussion
Altera_Forum
Honored Contributor
10 years agoHow can I use local memory.
I read Optimizing Local Memory Accesses of Altera SDK for OpenCL Best Prasctices Guides. and I can see that I can use local memory used by clSetKernelArg. so I write my source as below ...
Altera_Forum
Honored Contributor
10 years agoBut what about copying the value of table into the kernel?
thanks.
--- quote start ---
hi there,
you are not using clsetkernelarg correctly as the proper way to set a pointer to local memory is:
status = clsetkernelarg(kernel, argi++, sizeof(<type>)*<size_of_array>, NULL); So for example, if you want to set an array of chars of size 256, you would have to write: status = clSetKernelArg(kernel[i], argi++, sizeof(char)*256, NULL); That's all. Good luck! --- Quote End ---