Create L0 list and module with correct NEO device on explicit mode

When implicit scaling is not used, a root device in L0 defaults to
sub-device 0. In that case, all allocations need to be made against
that sub-device.

For list and module creation, we were passing the root NEO device
instead, and we were allocating their internal allocations using
the least-occupied bank, which meant we were allocating alternately
between the two sub-devices.

This patch makes sure the NEO device used on explicit mode for
the root device is sub-device 0.

Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
Jaime Arteaga 2021-09-18 10:52:37 +00:00 committed by Compute-Runtime-Automation
parent eb1802cf2f
commit 11980db8eb
2 changed files with 5 additions and 3 deletions

View File

@ -132,7 +132,8 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::initialize(Device *device, NEO
}
commandContainer.setReservedSshSize(getReserveSshSize());
auto returnValue = commandContainer.initialize(static_cast<DeviceImp *>(device)->neoDevice);
DeviceImp *deviceImp = static_cast<DeviceImp *>(device);
auto returnValue = commandContainer.initialize(deviceImp->getActiveDevice());
ze_result_t returnType = parseErrorCode(returnValue);
if (returnType == ZE_RESULT_SUCCESS) {
if (!isCopyOnly()) {

View File

@ -106,8 +106,9 @@ void KernelImmutableData::initialize(NEO::KernelInfo *kernelInfo, Device *device
this->kernelInfo = kernelInfo;
this->kernelDescriptor = &kernelInfo->kernelDescriptor;
auto neoDevice = device->getNEODevice();
auto memoryManager = device->getNEODevice()->getMemoryManager();
DeviceImp *deviceImp = static_cast<DeviceImp *>(device);
auto neoDevice = deviceImp->getActiveDevice();
auto memoryManager = neoDevice->getMemoryManager();
auto kernelIsaSize = kernelInfo->heapInfo.KernelHeapSize;
const auto allocType = internalKernel ? NEO::GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL : NEO::GraphicsAllocation::AllocationType::KERNEL_ISA;