cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

roger512
Adept II

Maximum memory block size allocable

Hi,

I'd like to know if there is a way to determine the maximum memory block size allocable  in Opencl.

My code involve allocating large buffers, sometime it fails.  I found a way to split the computation, but i want to maximize the buffer size in order to run less computation pass.

Found nothing to clearly answer  that problem in OpenCL. Anyone ?

0 Likes
3 Replies
nou
Exemplar

I see, but i have some doubts the result of clGetDeviceInfo(CL_DEVICE_MAX_MEM_ALLOC_SIZE) takes into account the memory available in GPU RAM.

i feel it's more like a static value that never change. it says minimum is 1/4 of CL_DEVICE_GLOBAL_MEM_SIZE.

Am i right ?

0 Likes

yes it is static value. if you pass buffer as kernel argument or target of clEnqueueWrite/Copy() you can assume that it was allocated in the device memory which queue is used. there is no way to get actual free memory. you must calculate it manually,

there is defined CL_DEVICE_GLOBAL_FREE_MEMORY_AMD in cl_ext.h which doesn't work for me as it return CL_INVALID_VALUE error. there are other defines which are nowhere documented but they work.

0 Likes