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:
Jaime Arteaga
2020-06-17 18:50:07 -07:00
parent be9c62cbed
commit abdb707a39
4 changed files with 30 additions and 16 deletions

View File

@@ -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;
}