intel / fpga-runtime-for-opencl

Intel® FPGA Runtime for OpenCL™ Software Technology
Other
34 stars 68 forks source link

Return the global memory with enough capacity as default mem_id #361

Closed sophimao closed 4 months ago

sophimao commented 6 months ago

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.