PDA

View Full Version : Whare are the Buffer objects stored ??



Sayantan
05-29-2011, 09:27 PM
I have the following questions::
1.Where is the buffer object stored in the following cases??ie. In host memory(RAM) or device memory(GPU VRAM)??Considering context created with only one device , a GPU.
case1:clCreateBuffer() with flag CL_MEM_READ_WRITE or CL_MEM_READ_ONLY or CL_MEM_WRITE_ONLY
case2:flag CL_MEM_USE_HOST_PTR
case3:flag CL_MEM_ALLOC_HOST_PTR
case4:flag CL_MEM_COPY_HOST_PTR
case5:flag CL_MEM_COPY_HOST_PTR|CL_MEM_ALLOC_HOST_PTR
What is the difference between case4 and case5??

2.How do I verify where the buffer object has been stored??I mean if the object is stored in RAM there should an increase in memory usage shown by task manger of windows.Similarly if the buffer is stored in VRAM ,is there a way I can check VRAM usage??

Thank You

david.garcia
05-30-2011, 05:17 AM
As a rule of thumb I would expect allocations to occur in device memory except for those buffers and images created with CL_MEM_ALLOC_HOST_PTR or CL_MEM_USE_HOST_PTR.

However, this is only a general rule and there will be exceptions. I don't think there's any way to determine where an allocation took place. Even if there was, there's no guarantee that memory objects will remain always in the same place.

I would not worry about these sort of questions.

david.garcia
05-30-2011, 05:17 AM
As a rule of thumb I would expect allocations to occur in device memory except for those buffers and images created with CL_MEM_ALLOC_HOST_PTR or CL_MEM_USE_HOST_PTR.

However, this is only a general rule and there will be exceptions. I don't think there's any way to determine where an allocation took place. Even if there was, there's no guarantee that memory objects will remain always in the same place.

I would not worry about these sort of questions.