Maximum memory allocation size in OpenCL only a quarter of available main memory--why?

Viewed 4176

For the device info parameter CL_DEVICE_MAX_MEM_ALLOC_SIZE, the OpenCL standard (2.0, similar in earlier versions) has this to say:

Max size of memory object allocation in bytes. The minimum value is max (min(1024*1024*1024, 1/4th of CL_DEVICE_GLOBAL_MEM_SIZE), 128*1024*1024) for devices that are not of type CL_DEVICE_TYPE_CUSTOM.

It turns out that both the AMD and Intel CPU OpenCL implementations only offer up a quarter of the available memory (about 2 GiB on my machine with 8 GiB, and similarly on other machines) to allocate at one time. I don't see a good technical justification for this. I'm aware that AMD GPUs have similar restrictions, controlled by the GPU_MAX_ALLOC_PERCENT environment variable, but even there, I don't quite see where the difficulty is with just offering up all memory for allocation.

To sum up: What is the technical reason for restricting the amount of memory being allocated at one time? After all, I can malloc() all my memory on the CPU in one big gulp. Is there perhaps some performance concern I'm not understanding?

1 Answers
Related