How to "memcpy" on GPU with strings?

Discussion created by diapolo on Dec 25, 2009
Latest reply on Dec 27, 2009 by genaganna

I'm an OpenCL beginner, and I currently try to work with strings in Kernels. I need some kind of memcpy and read, that such a things is n/a in OpenCL, so I wrote a function by myself.

I know, that I have to use cl_khr_byte_addressable_store in order to use my function, but cl_khr_byte_addressable_store is missing for my HD5870, it´s only available on the CPU device.

So how could I implement that kind of function on a GPU? Or perhaps are there better ways to do that? Help is really appreciated!




void memcpy(uchar *dest, __constant uchar *source, uint Len) { for(uint i = 0; i < Len; ++i) { dest[i] = source[i]; } }