diff --git a/level_zero/core/source/cmdqueue/cmdqueue_xe_hp_core_and_later.inl b/level_zero/core/source/cmdqueue/cmdqueue_xe_hp_core_and_later.inl index 1350c6cbf5..e899c2109e 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue_xe_hp_core_and_later.inl +++ b/level_zero/core/source/cmdqueue/cmdqueue_xe_hp_core_and_later.inl @@ -31,7 +31,7 @@ void CommandQueueHw::programStateBaseAddress(uint64_t gsba, bool NEO::MemorySynchronizationCommands::addPipeControl(commandStream, args); auto pSbaCmd = static_cast(commandStream.getSpace(sizeof(STATE_BASE_ADDRESS))); STATE_BASE_ADDRESS sbaCmd; - bool multiOsContextCapable = NEO::ImplicitScalingHelper::isImplicitScalingEnabled(neoDevice->getDeviceBitfield(), true); + bool multiOsContextCapable = device->isMultiDeviceCapable(); NEO::StateBaseAddressHelper::programStateBaseAddress(&sbaCmd, nullptr, nullptr, diff --git a/level_zero/core/source/context/context_imp.cpp b/level_zero/core/source/context/context_imp.cpp index 90acdd149f..734e858ae2 100644 --- a/level_zero/core/source/context/context_imp.cpp +++ b/level_zero/core/source/context/context_imp.cpp @@ -104,7 +104,8 @@ ze_result_t ContextImp::allocDeviceMem(ze_device_handle_t hDevice, size_t size, size_t alignment, void **ptr) { - if (isDeviceDefinedForThisContext(Device::fromHandle(hDevice)) == false) { + auto device = Device::fromHandle(hDevice); + if (isDeviceDefinedForThisContext(device) == false) { return ZE_RESULT_ERROR_DEVICE_LOST; } @@ -117,7 +118,7 @@ ze_result_t ContextImp::allocDeviceMem(ze_device_handle_t hDevice, return parseResult; } - auto neoDevice = Device::fromHandle(hDevice)->getNEODevice(); + auto neoDevice = device->getNEODevice(); auto rootDeviceIndex = neoDevice->getRootDeviceIndex(); auto deviceBitfields = this->driverHandle->deviceBitfields; @@ -149,7 +150,7 @@ ze_result_t ContextImp::allocDeviceMem(ze_device_handle_t hDevice, uint64_t globalMemSize = neoDevice->getDeviceInfo().globalMemSize; uint32_t numSubDevices = neoDevice->getNumGenericSubDevices(); - if ((!(NEO::ImplicitScalingHelper::isImplicitScalingEnabled(neoDevice->getDeviceBitfield(), true))) && (numSubDevices > 1)) { + if ((!device->isMultiDeviceCapable()) && (numSubDevices > 1)) { globalMemSize = globalMemSize / numSubDevices; } if (lookupTable.relaxedSizeAllowed && (size > globalMemSize)) { @@ -184,10 +185,11 @@ ze_result_t ContextImp::allocSharedMem(ze_device_handle_t hDevice, size_t alignment, void **ptr) { - auto neoDevice = this->devices.begin()->second->getNEODevice(); + auto device = this->devices.begin()->second; if (hDevice != nullptr) { - neoDevice = Device::fromHandle(hDevice)->getNEODevice(); + device = Device::fromHandle(hDevice); } + auto neoDevice = device->getNEODevice(); bool relaxedSizeAllowed = NEO::DebugManager.flags.AllowUnrestrictedSize.get(); if (deviceDesc->pNext) { @@ -211,7 +213,7 @@ ze_result_t ContextImp::allocSharedMem(ze_device_handle_t hDevice, uint64_t globalMemSize = neoDevice->getDeviceInfo().globalMemSize; uint32_t numSubDevices = neoDevice->getNumGenericSubDevices(); - if ((!(NEO::ImplicitScalingHelper::isImplicitScalingEnabled(neoDevice->getDeviceBitfield(), true))) && (numSubDevices > 1)) { + if ((!device->isMultiDeviceCapable()) && (numSubDevices > 1)) { globalMemSize = globalMemSize / numSubDevices; } if (relaxedSizeAllowed && @@ -223,11 +225,12 @@ ze_result_t ContextImp::allocSharedMem(ze_device_handle_t hDevice, auto deviceBitfields = this->deviceBitfields; NEO::Device *unifiedMemoryPropertiesDevice = nullptr; if (hDevice) { - if (isDeviceDefinedForThisContext(Device::fromHandle(hDevice)) == false) { + device = Device::fromHandle(hDevice); + if (isDeviceDefinedForThisContext(device) == false) { return ZE_RESULT_ERROR_DEVICE_LOST; } - neoDevice = Device::fromHandle(hDevice)->getNEODevice(); + neoDevice = device->getNEODevice(); auto rootDeviceIndex = neoDevice->getRootDeviceIndex(); unifiedMemoryPropertiesDevice = neoDevice; deviceBitfields[rootDeviceIndex] = neoDevice->getDeviceBitfield(); diff --git a/level_zero/core/source/device/device_imp.cpp b/level_zero/core/source/device/device_imp.cpp index d3c763bcfb..a90899b83e 100644 --- a/level_zero/core/source/device/device_imp.cpp +++ b/level_zero/core/source/device/device_imp.cpp @@ -334,7 +334,7 @@ ze_result_t DeviceImp::getMemoryProperties(uint32_t *pCount, ze_device_memory_pr strcpy_s(pMemProperties->name, ZE_MAX_DEVICE_NAME, hwInfoConfig.getDeviceMemoryName().c_str()); pMemProperties->maxClockRate = hwInfoConfig.getDeviceMemoryMaxClkRate(&hwInfo); pMemProperties->maxBusWidth = deviceInfo.addressBits; - if (NEO::ImplicitScalingHelper::isImplicitScalingEnabled(this->getNEODevice()->getDeviceBitfield(), true) || + if (this->isMultiDeviceCapable() || this->getNEODevice()->getNumGenericSubDevices() == 0) { pMemProperties->totalSize = deviceInfo.globalMemSize; } else { @@ -491,7 +491,7 @@ ze_result_t DeviceImp::getProperties(ze_device_properties_t *pDeviceProperties) if (NEO::DebugManager.flags.DebugApiUsed.get() == 1) { pDeviceProperties->numSubslicesPerSlice = hardwareInfo.gtSystemInfo.MaxSubSlicesSupported / hardwareInfo.gtSystemInfo.MaxSlicesSupported; } else { - if (NEO::ImplicitScalingHelper::isImplicitScalingEnabled(this->getNEODevice()->getDeviceBitfield(), true) || (this->numSubDevices == 0)) { + if (this->isMultiDeviceCapable() || (this->numSubDevices == 0)) { pDeviceProperties->numSubslicesPerSlice = hardwareInfo.gtSystemInfo.SubSliceCount / hardwareInfo.gtSystemInfo.SliceCount; } else { pDeviceProperties->numSubslicesPerSlice = hardwareInfo.gtSystemInfo.SubSliceCount / hardwareInfo.gtSystemInfo.SliceCount / this->numSubDevices;