cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

ymgve
Journeyman III

Map/copy only part of global buffer

I'm developing a program that keeps a lot of data in GPU memory, and it seems like the global buffer does the job.

However, when I want to read the results back after kernel execution, there doesn't seem to be a way to only map or copy parts of the global memory, which slows my application down considerably, since it seems like even mapping the memory uses time proportional to the amount of global memory allocated, even though I only need to read back one word per thread.

I tried to allocate several global buffers, but that doesn't seem to work. Is there any solution to this problem?

0 Likes
3 Replies
himanshu_gautam
Grandmaster

ymgve,

You can use clEnqueueReadBuffer to write back only a part of any global buffer to host buffer.Refer to openCL spec 1.1.

I tried to read just 3 float variables from a 128MB global buffer using the following commands:

Status = clEnqueueReadBuffer(CommandQueue,OutputBuffer,CL_TRUE,12,12,Output,0,NULL,NULL);

0 Likes

I am using ATI CAL, not OpenCL, so that won't help me. Or are you saying that CAL/OpenCL can be mixed?

0 Likes

There is no CAL functionality to map just a part of buffer/image.


0 Likes