For heterogeneous memory system where each global memory has the same size, the memory with address range starting at 0x0 may have a smaller usable range than the other memories as we need to avoid allocating at 0x0. As a result, if user allocates a buffer with size of CL_DEVICE_MAX_MEM_ALLOC_SIZE, it will need to be allocated to one of the other memories. This change updates the way default gmem_id is found, by taking the allocation size into account.
For heterogeneous memory system where each global memory has the same size, the memory with address range starting at 0x0 may have a smaller usable range than the other memories as we need to avoid allocating at 0x0. As a result, if user allocates a buffer with size of CL_DEVICE_MAX_MEM_ALLOC_SIZE, it will need to be allocated to one of the other memories. This change updates the way default
gmem_id
is found, by taking the allocation size into account.