mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Check for hardware limit for runtime device allocations
Use hardware limit, instead of the one used for device capabilities, so applications can fully use the available memory in the device. Change-Id: I910c610d7a3af254724a810c3c60b9da8d5d64a7 Signed-off: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
@@ -120,7 +120,7 @@ ze_result_t DriverHandleImp::allocHostMem(ze_host_mem_alloc_flag_t flags, size_t
|
||||
|
||||
ze_result_t DriverHandleImp::allocDeviceMem(ze_device_handle_t hDevice, ze_device_mem_alloc_flag_t flags,
|
||||
size_t size, size_t alignment, void **ptr) {
|
||||
if (size > this->devices[0]->getDeviceInfo().maxMemAllocSize) {
|
||||
if (size > this->devices[0]->getNEODevice()->getHardwareCapabilities().maxMemAllocSize) {
|
||||
*ptr = nullptr;
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_SIZE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user