diff --git a/level_zero/core/source/debugger/debugger_l0.cpp b/level_zero/core/source/debugger/debugger_l0.cpp index dcb846223b..86a227acd5 100644 --- a/level_zero/core/source/debugger/debugger_l0.cpp +++ b/level_zero/core/source/debugger/debugger_l0.cpp @@ -82,7 +82,8 @@ void DebuggerL0::initialize() { memoryOperationsIface->makeResident(device, ArrayRef(&moduleDebugArea, 1)); } - NEO::MemoryTransferHelper::transferMemoryToAllocation(hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *moduleDebugArea), + const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily); + NEO::MemoryTransferHelper::transferMemoryToAllocation(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *moduleDebugArea), *device, moduleDebugArea, 0, &debugArea, sizeof(DebugAreaHeader)); if (hwHelper.disableL3CacheForDebug(hwInfo)) { diff --git a/level_zero/core/source/device/device_imp.cpp b/level_zero/core/source/device/device_imp.cpp index 6208645d03..62383adb9d 100644 --- a/level_zero/core/source/device/device_imp.cpp +++ b/level_zero/core/source/device/device_imp.cpp @@ -446,7 +446,7 @@ ze_result_t DeviceImp::getMemoryProperties(uint32_t *pCount, ze_device_memory_pr auto &hwInfo = this->getHwInfo(); auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily); strcpy_s(pMemProperties->name, ZE_MAX_DEVICE_NAME, hwInfoConfig.getDeviceMemoryName().c_str()); - pMemProperties->maxClockRate = hwInfoConfig.getDeviceMemoryMaxClkRate(&hwInfo); + pMemProperties->maxClockRate = hwInfoConfig.getDeviceMemoryMaxClkRate(hwInfo); pMemProperties->maxBusWidth = deviceInfo.addressBits; if (this->isImplicitScalingCapable() || this->getNEODevice()->getNumGenericSubDevices() == 0) { @@ -956,8 +956,8 @@ Device *Device::create(DriverHandle *driverHandle, NEO::Device *neoDevice, bool } if (debugSurface && stateSaveAreaHeader.size() > 0) { - auto &hwInfo = neoDevice->getHardwareInfo(); - NEO::MemoryTransferHelper::transferMemoryToAllocation(hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *debugSurface), + const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily); + NEO::MemoryTransferHelper::transferMemoryToAllocation(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *debugSurface), *neoDevice, debugSurface, 0, stateSaveAreaHeader.data(), stateSaveAreaHeader.size()); } diff --git a/level_zero/core/source/kernel/kernel_imp.cpp b/level_zero/core/source/kernel/kernel_imp.cpp index 2d86d16030..7cdfa266aa 100644 --- a/level_zero/core/source/kernel/kernel_imp.cpp +++ b/level_zero/core/source/kernel/kernel_imp.cpp @@ -794,13 +794,13 @@ ze_result_t KernelImp::initialize(const ze_kernel_desc_t *desc) { auto neoDevice = module->getDevice()->getNEODevice(); auto &hwInfo = neoDevice->getHardwareInfo(); - auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily); + const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily); auto &kernelDescriptor = kernelImmData->getDescriptor(); UNRECOVERABLE_IF(!this->kernelImmData->getKernelInfo()->heapInfo.pKernelHeap); if (isaAllocation->getAllocationType() == NEO::AllocationType::KERNEL_ISA_INTERNAL) { - NEO::MemoryTransferHelper::transferMemoryToAllocation(hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *isaAllocation), + NEO::MemoryTransferHelper::transferMemoryToAllocation(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *isaAllocation), *neoDevice, isaAllocation, 0, diff --git a/level_zero/core/source/module/module_imp.cpp b/level_zero/core/source/module/module_imp.cpp index 4c4d571191..2b7b75d7c8 100644 --- a/level_zero/core/source/module/module_imp.cpp +++ b/level_zero/core/source/module/module_imp.cpp @@ -571,14 +571,14 @@ bool ModuleImp::initialize(const ze_module_desc_t *desc, NEO::Device *neoDevice) passDebugData(); } - auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily); + const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily); if (this->isFullyLinked && this->type == ModuleType::User) { for (auto &ki : kernelImmDatas) { if (!ki->isIsaCopiedToAllocation()) { - NEO::MemoryTransferHelper::transferMemoryToAllocation(hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *ki->getIsaGraphicsAllocation()), + NEO::MemoryTransferHelper::transferMemoryToAllocation(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *ki->getIsaGraphicsAllocation()), *neoDevice, ki->getIsaGraphicsAllocation(), 0, ki->getKernelInfo()->heapInfo.pKernelHeap, static_cast(ki->getKernelInfo()->heapInfo.KernelHeapSize)); @@ -716,7 +716,7 @@ ze_result_t ModuleImp::getDebugInfo(size_t *pDebugDataSize, uint8_t *pDebugData) void ModuleImp::copyPatchedSegments(const NEO::Linker::PatchableSegments &isaSegmentsForPatching) { if (this->translationUnit->programInfo.linkerInput && this->translationUnit->programInfo.linkerInput->getTraits().requiresPatchingOfInstructionSegments) { const auto &hwInfo = device->getNEODevice()->getHardwareInfo(); - const auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily); + const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily); for (auto &kernelImmData : this->kernelImmDatas) { if (nullptr == kernelImmData->getIsaGraphicsAllocation()) { @@ -729,7 +729,7 @@ void ModuleImp::copyPatchedSegments(const NEO::Linker::PatchableSegments &isaSeg kernelImmData->getIsaGraphicsAllocation()->setAubWritable(true, std::numeric_limits::max()); auto segmentId = &kernelImmData - &this->kernelImmDatas[0]; - NEO::MemoryTransferHelper::transferMemoryToAllocation(hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *kernelImmData->getIsaGraphicsAllocation()), + NEO::MemoryTransferHelper::transferMemoryToAllocation(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *kernelImmData->getIsaGraphicsAllocation()), *device->getNEODevice(), kernelImmData->getIsaGraphicsAllocation(), 0, isaSegmentsForPatching[segmentId].hostPointer, isaSegmentsForPatching[segmentId].segmentSize); diff --git a/level_zero/core/test/unit_tests/sources/device/test_device.cpp b/level_zero/core/test/unit_tests/sources/device/test_device.cpp index 093b337e0a..276d5054e8 100644 --- a/level_zero/core/test/unit_tests/sources/device/test_device.cpp +++ b/level_zero/core/test/unit_tests/sources/device/test_device.cpp @@ -1422,7 +1422,7 @@ TEST_F(DeviceGetMemoryTests, whenCallingGetMemoryPropertiesWithNonNullPtrThenPro auto hwInfo = *NEO::defaultHwInfo; auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily); - EXPECT_EQ(memProperties.maxClockRate, hwInfoConfig.getDeviceMemoryMaxClkRate(&hwInfo)); + EXPECT_EQ(memProperties.maxClockRate, hwInfoConfig.getDeviceMemoryMaxClkRate(hwInfo)); EXPECT_EQ(memProperties.maxBusWidth, this->neoDevice->getDeviceInfo().addressBits); EXPECT_EQ(memProperties.totalSize, this->neoDevice->getDeviceInfo().globalMemSize); EXPECT_EQ(0u, memProperties.flags); diff --git a/level_zero/core/test/unit_tests/sources/module/test_module.cpp b/level_zero/core/test/unit_tests/sources/module/test_module.cpp index cb16f05cce..8f426d0e07 100644 --- a/level_zero/core/test/unit_tests/sources/module/test_module.cpp +++ b/level_zero/core/test/unit_tests/sources/module/test_module.cpp @@ -151,8 +151,8 @@ HWTEST_F(ModuleTest, givenBlitterAvailableWhenCopyingPatchedSegementsThenIsaIsTr EXPECT_TRUE(ki->isIsaCopiedToAllocation()); } - const auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily); - if (hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *module->getKernelImmutableDataVector()[0]->getIsaGraphicsAllocation())) { + const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); + if (hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *module->getKernelImmutableDataVector()[0]->getIsaGraphicsAllocation())) { EXPECT_EQ(5u, blitterCalled); } else { EXPECT_EQ(0u, blitterCalled); diff --git a/level_zero/core/test/unit_tests/xe_hpc_core/test_cmdlist_xe_hpc_core.cpp b/level_zero/core/test/unit_tests/xe_hpc_core/test_cmdlist_xe_hpc_core.cpp index 7b971c8440..d04976ce42 100644 --- a/level_zero/core/test/unit_tests/xe_hpc_core/test_cmdlist_xe_hpc_core.cpp +++ b/level_zero/core/test/unit_tests/xe_hpc_core/test_cmdlist_xe_hpc_core.cpp @@ -55,7 +55,7 @@ HWTEST2_F(CommandListAppendLaunchKernelXeHpcCore, givenKernelUsingSyncBufferWhen using CommandListStatePrefetchXeHpcCore = Test; -HWTEST2_F(CommandListStatePrefetchXeHpcCore, givenDebugFlagSetWhenPrefetchApiCalledThenProgramStatePrefetch, IsXeHpcCore) { +HWTEST2_F(CommandListStatePrefetchXeHpcCore, givenDebugFlagSetWhenPrefetchApiCalledAndIsNotBaseDieA0ThenProgramStatePrefetch, IsXeHpcCore) { using STATE_PREFETCH = typename FamilyType::STATE_PREFETCH; DebugManagerStateRestore restore; @@ -74,7 +74,7 @@ HWTEST2_F(CommandListStatePrefetchXeHpcCore, givenDebugFlagSetWhenPrefetchApiCal EXPECT_NE(nullptr, ptr); auto hwInfo = device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo(); - hwInfo->platform.usRevId |= FamilyType::pvcBaseDieRevMask; + hwInfo->platform.usRevId = 0x8; // not BD A0 auto cmdListBaseOffset = pCommandList->commandContainer.getCommandStream()->getUsed(); @@ -271,7 +271,7 @@ HWTEST2_F(CommandListStatePrefetchXeHpcCore, givenAppendMemoryPrefetchForKmdMigr context->freeMem(ptr); } -HWTEST2_F(CommandListStatePrefetchXeHpcCore, givenCommandBufferIsExhaustedWhenPrefetchApiCalledThenProgramStatePrefetch, IsXeHpcCore) { +HWTEST2_F(CommandListStatePrefetchXeHpcCore, givenCommandBufferIsExhaustedWhenPrefetchApiCalledAndIsNotBaseDieA0ThenProgramStatePrefetch, IsXeHpcCore) { using STATE_PREFETCH = typename FamilyType::STATE_PREFETCH; using MI_BATCH_BUFFER_END = typename FamilyType::MI_BATCH_BUFFER_END; @@ -292,7 +292,7 @@ HWTEST2_F(CommandListStatePrefetchXeHpcCore, givenCommandBufferIsExhaustedWhenPr EXPECT_NE(nullptr, ptr); auto hwInfo = device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo(); - hwInfo->platform.usRevId |= FamilyType::pvcBaseDieRevMask; + hwInfo->platform.usRevId = 0x8; // not BD A0 auto firstBatchBufferAllocation = pCommandList->commandContainer.getCommandStream()->getGraphicsAllocation(); diff --git a/level_zero/core/test/unit_tests/xe_hpc_core/test_device_xe_hpc_core.cpp b/level_zero/core/test/unit_tests/xe_hpc_core/test_device_xe_hpc_core.cpp index 5130e20c4b..f796b1cfa3 100644 --- a/level_zero/core/test/unit_tests/xe_hpc_core/test_device_xe_hpc_core.cpp +++ b/level_zero/core/test/unit_tests/xe_hpc_core/test_device_xe_hpc_core.cpp @@ -26,7 +26,7 @@ HWTEST2_F(DeviceTestXeHpc, whenCallingGetMemoryPropertiesWithNonNullPtrAndBdRevi uint32_t count = 0; auto device = driverHandle->devices[0]; auto hwInfo = device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo(); - hwInfo->platform.usRevId = FamilyType::pvcBaseDieA0Masked ^ FamilyType::pvcBaseDieRevMask; + hwInfo->platform.usRevId = 0x8; // not BD A0 ze_result_t res = device->getMemoryProperties(&count, nullptr); EXPECT_EQ(res, ZE_RESULT_SUCCESS); diff --git a/opencl/source/command_queue/command_queue.cpp b/opencl/source/command_queue/command_queue.cpp index 288acc1e11..7798103d3f 100644 --- a/opencl/source/command_queue/command_queue.cpp +++ b/opencl/source/command_queue/command_queue.cpp @@ -153,6 +153,7 @@ void CommandQueue::initializeGpgpu() const { void CommandQueue::initializeGpgpuInternals() const { auto &hwInfo = device->getDevice().getHardwareInfo(); auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily); + const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); if (getCmdQueueProperties(propertiesVector.data(), CL_QUEUE_PROPERTIES) & static_cast(CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE)) { this->gpgpuEngine->commandStreamReceiver->overrideDispatchPolicy(DispatchMode::BatchedDispatch); @@ -169,7 +170,7 @@ void CommandQueue::initializeGpgpuInternals() const { auto &stateSaveAreaHeader = SipKernel::getSipKernel(device->getDevice()).getStateSaveAreaHeader(); if (stateSaveAreaHeader.size() > 0) { - NEO::MemoryTransferHelper::transferMemoryToAllocation(hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *debugSurface), + NEO::MemoryTransferHelper::transferMemoryToAllocation(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *debugSurface), device->getDevice(), debugSurface, 0, stateSaveAreaHeader.data(), stateSaveAreaHeader.size()); } diff --git a/opencl/source/command_queue/gpgpu_walker_xehp_and_later.inl b/opencl/source/command_queue/gpgpu_walker_xehp_and_later.inl index c4d4de03a2..e225a152c8 100644 --- a/opencl/source/command_queue/gpgpu_walker_xehp_and_later.inl +++ b/opencl/source/command_queue/gpgpu_walker_xehp_and_later.inl @@ -135,7 +135,7 @@ size_t EnqueueOperation::getSizeRequiredCSKernel(bool reserveProfilin size_t size = sizeof(typename GfxFamily::COMPUTE_WALKER) + (sizeof(typename GfxFamily::PIPE_CONTROL) * numPipeControls) + HardwareCommandsHelper::getSizeRequiredCS() + - EncodeMemoryPrefetch::getSizeForMemoryPrefetch(pKernel->getKernelInfo().heapInfo.KernelHeapSize); + EncodeMemoryPrefetch::getSizeForMemoryPrefetch(pKernel->getKernelInfo().heapInfo.KernelHeapSize, commandQueue.getDevice().getHardwareInfo()); auto devices = commandQueue.getGpgpuCommandStreamReceiver().getOsContext().getDeviceBitfield(); auto partitionWalker = ImplicitScalingHelper::isImplicitScalingEnabled(devices, !pKernel->isSingleSubdevicePreferred()); diff --git a/opencl/source/kernel/kernel.cpp b/opencl/source/kernel/kernel.cpp index 180f2d3752..b14b19b554 100644 --- a/opencl/source/kernel/kernel.cpp +++ b/opencl/source/kernel/kernel.cpp @@ -723,8 +723,8 @@ void Kernel::substituteKernelHeap(void *newKernelHeap, size_t newKernelHeapSize) size_t isaPadding = hwHelper.getPaddingForISAAllocation(); if (currentAllocationSize >= newKernelHeapSize + isaPadding) { auto &hwInfo = clDevice.getDevice().getHardwareInfo(); - auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); - status = MemoryTransferHelper::transferMemoryToAllocation(hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *pKernelInfo->getGraphicsAllocation()), + const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); + status = MemoryTransferHelper::transferMemoryToAllocation(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *pKernelInfo->getGraphicsAllocation()), clDevice.getDevice(), pKernelInfo->getGraphicsAllocation(), 0, newKernelHeap, static_cast(newKernelHeapSize)); } else { diff --git a/opencl/source/program/printf_handler.cpp b/opencl/source/program/printf_handler.cpp index 8cd2a3bd84..70508dc5e6 100644 --- a/opencl/source/program/printf_handler.cpp +++ b/opencl/source/program/printf_handler.cpp @@ -55,9 +55,9 @@ void PrintfHandler::prepareDispatch(const MultiDispatchInfo &multiDispatchInfo) printfSurface = device.getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, printfSurfaceSize, AllocationType::PRINTF_SURFACE, device.getDeviceBitfield()}); auto &hwInfo = device.getHardwareInfo(); - auto &helper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); + const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); - MemoryTransferHelper::transferMemoryToAllocation(helper.isBlitCopyRequiredForLocalMemory(hwInfo, *printfSurface), + MemoryTransferHelper::transferMemoryToAllocation(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *printfSurface), device.getDevice(), printfSurface, 0, printfSurfaceInitialDataSizePtr.get(), sizeof(*printfSurfaceInitialDataSizePtr.get())); @@ -94,9 +94,7 @@ bool PrintfHandler::printEnqueueOutput() { auto printfOutputSize = static_cast(printfSurface->getUnderlyingBufferSize()); std::unique_ptr printfOutputDecompressed; - auto &helper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); - - if (hwInfoConfig.allowStatelessCompression(hwInfo) || helper.isBlitCopyRequiredForLocalMemory(hwInfo, *printfSurface)) { + if (hwInfoConfig.allowStatelessCompression(hwInfo) || hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *printfSurface)) { printfOutputDecompressed = std::make_unique(printfOutputSize); printfOutputBuffer = printfOutputDecompressed.get(); auto &bcsEngine = device.getEngine(EngineHelpers::getBcsEngineType(hwInfo, device.getDeviceBitfield(), device.getSelectorCopyEngine(), true), EngineUsage::Regular); diff --git a/opencl/source/program/process_device_binary.cpp b/opencl/source/program/process_device_binary.cpp index 40abb9b76d..ebd28358f0 100644 --- a/opencl/source/program/process_device_binary.cpp +++ b/opencl/source/program/process_device_binary.cpp @@ -129,8 +129,8 @@ cl_int Program::linkBinary(Device *pDevice, const void *constantsInitData, const auto &kernHeapInfo = kernelInfo->heapInfo; auto segmentId = &kernelInfo - &kernelInfoArray[0]; auto &hwInfo = pDevice->getHardwareInfo(); - auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); - MemoryTransferHelper::transferMemoryToAllocation(hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *kernelInfo->getGraphicsAllocation()), + const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); + MemoryTransferHelper::transferMemoryToAllocation(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *kernelInfo->getGraphicsAllocation()), *pDevice, kernelInfo->getGraphicsAllocation(), 0, isaSegmentsForPatching[segmentId].hostPointer, static_cast(kernHeapInfo.KernelHeapSize)); } diff --git a/opencl/test/unit_test/command_queue/dispatch_walker_tests_xehp_and_later.cpp b/opencl/test/unit_test/command_queue/dispatch_walker_tests_xehp_and_later.cpp index 37b938df9e..87101f2b1d 100644 --- a/opencl/test/unit_test/command_queue/dispatch_walker_tests_xehp_and_later.cpp +++ b/opencl/test/unit_test/command_queue/dispatch_walker_tests_xehp_and_later.cpp @@ -1103,7 +1103,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeContr auto baseSize = sizeof(typename FamilyType::COMPUTE_WALKER) + (sizeof(typename FamilyType::PIPE_CONTROL) * numPipeControls) + HardwareCommandsHelper::getSizeRequiredCS() + - EncodeMemoryPrefetch::getSizeForMemoryPrefetch(kernel->kernelInfo.heapInfo.KernelHeapSize); + EncodeMemoryPrefetch::getSizeForMemoryPrefetch(kernel->kernelInfo.heapInfo.KernelHeapSize, device->getHardwareInfo()); DispatchInfo dispatchInfo{}; dispatchInfo.setNumberOfWorkgroups({32, 1, 1}); @@ -1160,7 +1160,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeContr auto baseSize = sizeof(typename FamilyType::COMPUTE_WALKER) + (sizeof(typename FamilyType::PIPE_CONTROL) * numPipeControls) + HardwareCommandsHelper::getSizeRequiredCS() + - EncodeMemoryPrefetch::getSizeForMemoryPrefetch(kernel->kernelInfo.heapInfo.KernelHeapSize); + EncodeMemoryPrefetch::getSizeForMemoryPrefetch(kernel->kernelInfo.heapInfo.KernelHeapSize, device->getHardwareInfo()); DispatchInfo dispatchInfo{}; dispatchInfo.setNumberOfWorkgroups({32, 1, 1}); @@ -1214,7 +1214,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, whenWalkerPart auto baseSize = sizeof(typename FamilyType::COMPUTE_WALKER) + (sizeof(typename FamilyType::PIPE_CONTROL) * numPipeControls) + HardwareCommandsHelper::getSizeRequiredCS() + - EncodeMemoryPrefetch::getSizeForMemoryPrefetch(kernel->kernelInfo.heapInfo.KernelHeapSize); + EncodeMemoryPrefetch::getSizeForMemoryPrefetch(kernel->kernelInfo.heapInfo.KernelHeapSize, device->getHardwareInfo()); auto returnedSize = EnqueueOperation::getSizeRequiredCS(CL_COMMAND_NDRANGE_KERNEL, false, false, *cmdQ.get(), kernel->mockKernel, dispatchInfo); EXPECT_EQ(returnedSize, baseSize); @@ -1231,7 +1231,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, whenPipeContro auto baseSize = sizeof(typename FamilyType::COMPUTE_WALKER) + (sizeof(typename FamilyType::PIPE_CONTROL) * numPipeControls) + HardwareCommandsHelper::getSizeRequiredCS() + - EncodeMemoryPrefetch::getSizeForMemoryPrefetch(kernel->kernelInfo.heapInfo.KernelHeapSize); + EncodeMemoryPrefetch::getSizeForMemoryPrefetch(kernel->kernelInfo.heapInfo.KernelHeapSize, device->getHardwareInfo()); auto returnedSize = EnqueueOperation::getSizeRequiredCS(CL_COMMAND_NDRANGE_KERNEL, false, false, *cmdQ.get(), kernel->mockKernel, {}); EXPECT_EQ(returnedSize, baseSize); @@ -1248,7 +1248,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeContr auto baseSize = sizeof(typename FamilyType::COMPUTE_WALKER) + (sizeof(typename FamilyType::PIPE_CONTROL) * numPipeControls) + HardwareCommandsHelper::getSizeRequiredCS() + - EncodeMemoryPrefetch::getSizeForMemoryPrefetch(kernel->kernelInfo.heapInfo.KernelHeapSize); + EncodeMemoryPrefetch::getSizeForMemoryPrefetch(kernel->kernelInfo.heapInfo.KernelHeapSize, device->getHardwareInfo()); WalkerPartition::WalkerPartitionArgs testArgs = {}; testArgs.initializeWparidRegister = true; @@ -1277,7 +1277,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeContr auto baseSize = sizeof(typename FamilyType::COMPUTE_WALKER) + (sizeof(typename FamilyType::PIPE_CONTROL) * numPipeControls) + HardwareCommandsHelper::getSizeRequiredCS() + - EncodeMemoryPrefetch::getSizeForMemoryPrefetch(kernel->kernelInfo.heapInfo.KernelHeapSize); + EncodeMemoryPrefetch::getSizeForMemoryPrefetch(kernel->kernelInfo.heapInfo.KernelHeapSize, device->getHardwareInfo()); WalkerPartition::WalkerPartitionArgs testArgs = {}; testArgs.initializeWparidRegister = true; diff --git a/opencl/test/unit_test/helpers/hw_helper_tests.cpp b/opencl/test/unit_test/helpers/hw_helper_tests.cpp index d7a8b25399..f7f7cb9fb0 100644 --- a/opencl/test/unit_test/helpers/hw_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hw_helper_tests.cpp @@ -1030,79 +1030,6 @@ HWTEST_F(HwHelperTest, givenDefaultHwHelperHwWhenMinimalSIMDSizeIsQueriedThen8Is EXPECT_EQ(8u, helper.getMinimalSIMDSize()); } -HWTEST_F(HwHelperTest, givenLockableAllocationWhenGettingIsBlitCopyRequiredForLocalMemoryThenCorrectValuesAreReturned) { - DebugManagerStateRestore restore{}; - auto &helper = HwHelper::get(renderCoreFamily); - const auto &hwInfoConfig = *HwInfoConfig::get(productFamily); - HardwareInfo hwInfo = *defaultHwInfo; - hwInfo.capabilityTable.blitterOperationsSupported = true; - - MockGraphicsAllocation graphicsAllocation; - graphicsAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); - EXPECT_TRUE(GraphicsAllocation::isLockable(graphicsAllocation.getAllocationType())); - graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory); - - auto expectedDefaultValue = (hwInfoConfig.getLocalMemoryAccessMode(hwInfo) == LocalMemoryAccessMode::CpuAccessDisallowed); - EXPECT_EQ(expectedDefaultValue, helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); - - DebugManager.flags.ForceLocalMemoryAccessMode.set(0); - EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); - DebugManager.flags.ForceLocalMemoryAccessMode.set(1); - EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); - - DebugManager.flags.ForceLocalMemoryAccessMode.set(3); - EXPECT_TRUE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); - hwInfo.capabilityTable.blitterOperationsSupported = false; - EXPECT_TRUE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); - - graphicsAllocation.overrideMemoryPool(MemoryPool::System64KBPages); - EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); - hwInfo.capabilityTable.blitterOperationsSupported = true; - EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); -} - -HWTEST_F(HwHelperTest, givenNotLockableAllocationWhenGettingIsBlitCopyRequiredForLocalMemoryThenCorrectValuesAreReturned) { - DebugManagerStateRestore restore{}; - auto &helper = HwHelper::get(renderCoreFamily); - HardwareInfo hwInfo = *defaultHwInfo; - hwInfo.capabilityTable.blitterOperationsSupported = true; - - MockGraphicsAllocation graphicsAllocation; - graphicsAllocation.setAllocationType(AllocationType::SVM_GPU); - EXPECT_FALSE(GraphicsAllocation::isLockable(graphicsAllocation.getAllocationType())); - graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory); - - MockGmm mockGmm(pDevice->getGmmHelper(), nullptr, 100, 100, GMM_RESOURCE_USAGE_OCL_BUFFER, false, {}, true); - mockGmm.resourceParams.Flags.Info.NotLockable = true; - graphicsAllocation.setDefaultGmm(&mockGmm); - - EXPECT_TRUE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); - - DebugManager.flags.ForceLocalMemoryAccessMode.set(0); - EXPECT_TRUE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); - DebugManager.flags.ForceLocalMemoryAccessMode.set(1); - EXPECT_TRUE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); - - DebugManager.flags.ForceLocalMemoryAccessMode.set(3); - EXPECT_TRUE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); - hwInfo.capabilityTable.blitterOperationsSupported = false; - EXPECT_TRUE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); - - graphicsAllocation.overrideMemoryPool(MemoryPool::System64KBPages); - EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); - hwInfo.capabilityTable.blitterOperationsSupported = true; - EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); -} - -HWTEST2_F(HwHelperTest, givenDefaultHwHelperHwWhenGettingIsBlitCopyRequiredForLocalMemoryThenFalseIsReturned, IsAtMostGen11) { - auto &helper = HwHelper::get(renderCoreFamily); - MockGraphicsAllocation graphicsAllocation; - graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory); - graphicsAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); - - EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(*defaultHwInfo, graphicsAllocation)); -} - HWCMDTEST_F(IGFX_GEN8_CORE, HwHelperTest, WhenIsFusedEuDispatchEnabledIsCalledThenFalseIsReturned) { if (hardwareInfo.platform.eRenderCoreFamily == IGFX_GEN12LP_CORE) { GTEST_SKIP(); diff --git a/opencl/test/unit_test/os_interface/hw_info_config_tests.cpp b/opencl/test/unit_test/os_interface/hw_info_config_tests.cpp index 86eb4b54a7..4b658311a0 100644 --- a/opencl/test/unit_test/os_interface/hw_info_config_tests.cpp +++ b/opencl/test/unit_test/os_interface/hw_info_config_tests.cpp @@ -12,6 +12,8 @@ #include "shared/source/os_interface/hw_info_config.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/unit_test_helper.h" +#include "shared/test/common/mocks/mock_gmm.h" +#include "shared/test/common/mocks/mock_graphics_allocation.h" #include "shared/test/unit_test/helpers/gtest_helpers.h" #include "shared/test/unit_test/utilities/base_object_utils.h" @@ -405,3 +407,75 @@ HWTEST2_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfIsTimestampWaitSupported const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); EXPECT_FALSE(hwInfoConfig.isTimestampWaitSupportedForEvents()); } + +HWTEST_F(HwInfoConfigTest, givenLockableAllocationWhenGettingIsBlitCopyRequiredForLocalMemoryThenCorrectValuesAreReturned) { + DebugManagerStateRestore restore{}; + + const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); + pInHwInfo.capabilityTable.blitterOperationsSupported = true; + + MockGraphicsAllocation graphicsAllocation; + graphicsAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); + EXPECT_TRUE(GraphicsAllocation::isLockable(graphicsAllocation.getAllocationType())); + graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory); + + auto expectedDefaultValue = (hwInfoConfig.getLocalMemoryAccessMode(pInHwInfo) == LocalMemoryAccessMode::CpuAccessDisallowed); + EXPECT_EQ(expectedDefaultValue, hwInfoConfig.isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); + + DebugManager.flags.ForceLocalMemoryAccessMode.set(0); + EXPECT_FALSE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); + DebugManager.flags.ForceLocalMemoryAccessMode.set(1); + EXPECT_FALSE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); + + DebugManager.flags.ForceLocalMemoryAccessMode.set(3); + EXPECT_TRUE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); + pInHwInfo.capabilityTable.blitterOperationsSupported = false; + EXPECT_TRUE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); + + graphicsAllocation.overrideMemoryPool(MemoryPool::System64KBPages); + EXPECT_FALSE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); + pInHwInfo.capabilityTable.blitterOperationsSupported = true; + EXPECT_FALSE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); +} + +HWTEST_F(HwInfoConfigTest, givenNotLockableAllocationWhenGettingIsBlitCopyRequiredForLocalMemoryThenCorrectValuesAreReturned) { + DebugManagerStateRestore restore{}; + HardwareInfo hwInfo = pInHwInfo; + auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); + hwInfo.capabilityTable.blitterOperationsSupported = true; + + MockGraphicsAllocation graphicsAllocation; + graphicsAllocation.setAllocationType(AllocationType::SVM_GPU); + EXPECT_FALSE(GraphicsAllocation::isLockable(graphicsAllocation.getAllocationType())); + graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory); + + MockGmm mockGmm(pPlatform->getClDevice(0)->getGmmHelper(), nullptr, 100, 100, GMM_RESOURCE_USAGE_OCL_BUFFER, false, {}, true); + mockGmm.resourceParams.Flags.Info.NotLockable = true; + graphicsAllocation.setDefaultGmm(&mockGmm); + + EXPECT_TRUE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); + + DebugManager.flags.ForceLocalMemoryAccessMode.set(0); + EXPECT_TRUE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); + DebugManager.flags.ForceLocalMemoryAccessMode.set(1); + EXPECT_TRUE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); + + DebugManager.flags.ForceLocalMemoryAccessMode.set(3); + EXPECT_TRUE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); + hwInfo.capabilityTable.blitterOperationsSupported = false; + EXPECT_TRUE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); + + graphicsAllocation.overrideMemoryPool(MemoryPool::System64KBPages); + EXPECT_FALSE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); + hwInfo.capabilityTable.blitterOperationsSupported = true; + EXPECT_FALSE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); +} + +HWTEST2_F(HwInfoConfigTest, givenHwInfoConfigWhenGettingIsBlitCopyRequiredForLocalMemoryThenFalseIsReturned, IsAtMostGen11) { + auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); + MockGraphicsAllocation graphicsAllocation; + graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory); + graphicsAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); + + EXPECT_FALSE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); +} diff --git a/opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp b/opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp index 8d2c6fb135..83ede78b17 100644 --- a/opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -18,11 +18,6 @@ namespace NEO { -template <> -int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) { - return 0; -} - HwInfoConfigTestWindows::HwInfoConfigTestWindows() { this->executionEnvironment = std::make_unique(); this->rootDeviceEnvironment = std::make_unique(*executionEnvironment); diff --git a/opencl/test/unit_test/xe_hpc_core/enqueue_tests_xe_hpc_core.cpp b/opencl/test/unit_test/xe_hpc_core/enqueue_tests_xe_hpc_core.cpp index 047bf128f3..943b9aff75 100644 --- a/opencl/test/unit_test/xe_hpc_core/enqueue_tests_xe_hpc_core.cpp +++ b/opencl/test/unit_test/xe_hpc_core/enqueue_tests_xe_hpc_core.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -93,7 +93,7 @@ XE_HPC_CORETEST_F(MemoryPrefetchTestsXeHpcCore, givenPrefetchEnabledWhenEstimati size_t expected = sizeof(typename FamilyType::COMPUTE_WALKER) + (sizeof(typename FamilyType::PIPE_CONTROL) * numPipeControls) + HardwareCommandsHelper::getSizeRequiredCS() + - EncodeMemoryPrefetch::getSizeForMemoryPrefetch(mockKernel->kernelInfo.heapInfo.KernelHeapSize); + EncodeMemoryPrefetch::getSizeForMemoryPrefetch(mockKernel->kernelInfo.heapInfo.KernelHeapSize, clDevice->getHardwareInfo()); EXPECT_EQ(expected, EnqueueOperation::getSizeRequiredCS(CL_COMMAND_NDRANGE_KERNEL, false, false, *commandQueue, mockKernel->mockKernel, {})); } diff --git a/opencl/test/unit_test/xe_hpc_core/hw_helper_tests_xe_hpc_core.cpp b/opencl/test/unit_test/xe_hpc_core/hw_helper_tests_xe_hpc_core.cpp index 1ce544f7c0..f8493dd254 100644 --- a/opencl/test/unit_test/xe_hpc_core/hw_helper_tests_xe_hpc_core.cpp +++ b/opencl/test/unit_test/xe_hpc_core/hw_helper_tests_xe_hpc_core.cpp @@ -43,7 +43,7 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenCommandBufferAllocationTypeWhenGe EXPECT_FALSE(allocData.flags.useSystemMemory); } -XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenSingleTileCsrWhenAllocatingCsrSpecificAllocationsThenStoreThemInProperMemoryPool) { +XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenSingleTileCsrWhenAllocatingCsrSpecificAllocationsAndIsNotBaseDieA0ThenStoreThemInProperMemoryPool) { const uint32_t numDevices = 4u; const uint32_t tileIndex = 2u; const DeviceBitfield singleTileMask{static_cast(1u << tileIndex)}; @@ -57,7 +57,7 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenSingleTileCsrWhenAllocatingCsrSpe auto clDevice = platform()->getClDevice(0); auto hwInfo = clDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->getMutableHardwareInfo(); - hwInfo->platform.usRevId = 0b111000; // not BD A0 + hwInfo->platform.usRevId = 0x8; // not BD A0 auto commandStreamReceiver = clDevice->getSubDevice(tileIndex)->getDefaultEngine().commandStreamReceiver; auto &heap = commandStreamReceiver->getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, MemoryConstants::pageSize64k); @@ -76,7 +76,7 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenSingleTileCsrWhenAllocatingCsrSpe EXPECT_EQ(commandBufferAllocation->getMemoryPool(), MemoryPool::LocalMemory); } -XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenMultiTileCsrWhenAllocatingCsrSpecificAllocationsThenStoreThemInLocalMemoryPool) { +XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenMultiTileCsrWhenAllocatingCsrSpecificAllocationsAndIsNotBaseDieA0ThenStoreThemInLocalMemoryPool) { const uint32_t numDevices = 4u; const DeviceBitfield tile0Mask{0x1}; DebugManagerStateRestore restore; @@ -90,7 +90,7 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenMultiTileCsrWhenAllocatingCsrSpec auto clDevice = platform()->getClDevice(0); auto hwInfo = clDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->getMutableHardwareInfo(); - hwInfo->platform.usRevId = 0b111000; // not BD A0 + hwInfo->platform.usRevId = 0x8; // not BD A0 auto commandStreamReceiver = clDevice->getDefaultEngine().commandStreamReceiver; auto &heap = commandStreamReceiver->getIndirectHeap(IndirectHeap::Type::INDIRECT_OBJECT, MemoryConstants::pageSize64k); @@ -112,7 +112,7 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenMultiTileCsrWhenAllocatingCsrSpec XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenSingleTileBdA0CsrWhenAllocatingCsrSpecificAllocationsThenStoreThemInProperMemoryPool) { const uint32_t numDevices = 4u; const uint32_t tileIndex = 2u; - const DeviceBitfield tile0Mask = 1; + [[maybe_unused]] const DeviceBitfield tile0Mask = 1; DebugManagerStateRestore restore; VariableBackup backup{&ultHwConfig}; @@ -133,7 +133,10 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenSingleTileBdA0CsrWhenAllocatingCs } else { EXPECT_EQ(AllocationType::LINEAR_STREAM, heapAllocation->getAllocationType()); } - EXPECT_EQ(tile0Mask, heapAllocation->storageInfo.memoryBanks); + + if (HwInfoConfig::get(hwInfo->platform.eProductFamily)->isTilePlacementResourceWaRequired(*hwInfo)) { + EXPECT_EQ(tile0Mask, heapAllocation->storageInfo.memoryBanks); + } commandStreamReceiver->ensureCommandBufferAllocation(heap, heap.getAvailableSpace() + 1, 0u); auto commandBufferAllocation = heap.getGraphicsAllocation(); @@ -820,49 +823,16 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenHwHelperWhenGettingThreadsPerEUCo EXPECT_EQ(8U, configs[1]); } -XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenDefaultHwHelperHwWhenGettingIsBlitCopyRequiredForLocalMemoryThenFalseIsReturned) { - auto &helper = HwHelper::get(renderCoreFamily); +using HwInfoConfigTestXeHpcCore = ::testing::Test; + +XE_HPC_CORETEST_F(HwInfoConfigTestXeHpcCore, givenDefaultHwInfoConfigHwWhenGettingIsBlitCopyRequiredForLocalMemoryThenFalseIsReturned) { + auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); MockGraphicsAllocation allocation; allocation.overrideMemoryPool(MemoryPool::LocalMemory); allocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); - EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(*defaultHwInfo, allocation)); + EXPECT_FALSE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(*defaultHwInfo, allocation)); } -XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenNonTile0AccessWhenGettingIsBlitCopyRequiredForLocalMemoryThenTrueIsReturned) { - auto &helper = HwHelper::get(renderCoreFamily); - HardwareInfo hwInfo = *defaultHwInfo; - hwInfo.capabilityTable.blitterOperationsSupported = true; - MockGraphicsAllocation graphicsAllocation; - graphicsAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); - EXPECT_TRUE(GraphicsAllocation::isLockable(graphicsAllocation.getAllocationType())); - graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory); - - hwInfo.platform.usRevId = FamilyType::pvcBaseDieA0Masked; - graphicsAllocation.storageInfo.cloningOfPageTables = false; - graphicsAllocation.storageInfo.memoryBanks = 0b11; - EXPECT_TRUE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); - graphicsAllocation.storageInfo.memoryBanks = 0b10; - EXPECT_TRUE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); - - { - VariableBackup revisionId{&hwInfo.platform.usRevId}; - revisionId = FamilyType::pvcBaseDieA0Masked ^ FamilyType::pvcBaseDieRevMask; - EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); - } - { - VariableBackup cloningOfPageTables{&graphicsAllocation.storageInfo.cloningOfPageTables}; - cloningOfPageTables = true; - EXPECT_TRUE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); - } - { - VariableBackup memoryBanks{&graphicsAllocation.storageInfo.memoryBanks}; - memoryBanks = 0b1; - EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); - } -} - -using HwInfoConfigTestXeHpcCore = ::testing::Test; - XE_HPC_CORETEST_F(HwInfoConfigTestXeHpcCore, givenDebugVariableSetWhenConfigureIsCalledThenSetupBlitterOperationsSupportedFlag) { DebugManagerStateRestore restore; auto hwInfoConfig = HwInfoConfig::get(productFamily); @@ -929,6 +899,7 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenBdA0WhenBcsSubDeviceSupportIsChec HardwareInfo hwInfo = *defaultHwInfo; auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); + auto hwInfoConfig = HwInfoConfig::get(productFamily); constexpr uint8_t bdRev[4] = {0, 0b111001, 0b101001, 0b000101}; @@ -948,7 +919,7 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenBdA0WhenBcsSubDeviceSupportIsChec (aub_stream::ENGINE_BCS == engineTypeT || aub_stream::ENGINE_BCS1 == engineTypeT || aub_stream::ENGINE_BCS3 == engineTypeT)); - bool isBdA0 = ((rev & FamilyType::pvcBaseDieRevMask) == FamilyType::pvcBaseDieA0Masked); + bool isBdA0 = hwInfoConfig->isBcsReportWaRequired(hwInfo); bool applyWa = affectedEngine; applyWa &= isBdA0 || (debugFlag == 1); @@ -966,6 +937,7 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenBdA0WhenAllocatingOnNonTileZeroTh HardwareInfo hwInfo = *defaultHwInfo; auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); + auto hwInfoConfig = HwInfoConfig::get(productFamily); constexpr uint8_t bdRev[4] = {0, 0b111001, 0b101001, 0b000101}; constexpr DeviceBitfield originalTileMasks[4] = {0b1, 0b11, 0b10, 0b1011}; @@ -981,7 +953,7 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenBdA0WhenAllocatingOnNonTileZeroTh for (auto rev : bdRev) { hwInfo.platform.usRevId = rev; - bool isBdA0 = ((hwInfo.platform.usRevId & FamilyType::pvcBaseDieRevMask) == FamilyType::pvcBaseDieA0Masked); + bool isBdA0 = hwInfoConfig->isTilePlacementResourceWaRequired(hwInfo); for (auto originalMask : originalTileMasks) { AllocationData allocData; diff --git a/opencl/test/unit_test/xe_hpc_core/pvc/engine_node_helper_tests_pvc.cpp b/opencl/test/unit_test/xe_hpc_core/pvc/engine_node_helper_tests_pvc.cpp index bea2b2f979..cbd97dc1cf 100644 --- a/opencl/test/unit_test/xe_hpc_core/pvc/engine_node_helper_tests_pvc.cpp +++ b/opencl/test/unit_test/xe_hpc_core/pvc/engine_node_helper_tests_pvc.cpp @@ -476,4 +476,40 @@ PVCTEST_F(EngineNodeHelperPvcTests, whenGetGpgpuEnginesThenReturnTwoCccsEnginesA EXPECT_EQ(enginePropertiesMap[i].isCcs, EngineHelpers::isCcs(enginePropertiesMap[i].engineType)); EXPECT_EQ(enginePropertiesMap[i].isBcs, EngineHelpers::isBcs(enginePropertiesMap[i].engineType)); } +} + +PVCTEST_F(EngineNodeHelperPvcTests, givenNonTile0AccessWhenGettingIsBlitCopyRequiredForLocalMemoryThenProperValueIsReturned) { + + HardwareInfo hwInfo = *defaultHwInfo; + auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); + hwInfo.capabilityTable.blitterOperationsSupported = true; + MockGraphicsAllocation graphicsAllocation; + graphicsAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); + EXPECT_TRUE(GraphicsAllocation::isLockable(graphicsAllocation.getAllocationType())); + graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory); + hwInfo.platform.usRevId = 0u; + + bool expectedRetVal = true; + + graphicsAllocation.storageInfo.cloningOfPageTables = false; + graphicsAllocation.storageInfo.memoryBanks = 0b11; + EXPECT_EQ(expectedRetVal, hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); + graphicsAllocation.storageInfo.memoryBanks = 0b10; + EXPECT_EQ(expectedRetVal, hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); + + { + VariableBackup revisionId{&hwInfo.platform.usRevId}; + revisionId = 0b111000; + EXPECT_FALSE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); + } + { + VariableBackup cloningOfPageTables{&graphicsAllocation.storageInfo.cloningOfPageTables}; + cloningOfPageTables = true; + EXPECT_EQ(expectedRetVal, hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); + } + { + VariableBackup memoryBanks{&graphicsAllocation.storageInfo.memoryBanks}; + memoryBanks = 0b1; + EXPECT_FALSE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); + } } \ No newline at end of file diff --git a/opencl/test/unit_test/xe_hpc_core/pvc/test_hw_info_config_pvc.cpp b/opencl/test/unit_test/xe_hpc_core/pvc/test_hw_info_config_pvc.cpp index 636287b7da..8dda98a331 100644 --- a/opencl/test/unit_test/xe_hpc_core/pvc/test_hw_info_config_pvc.cpp +++ b/opencl/test/unit_test/xe_hpc_core/pvc/test_hw_info_config_pvc.cpp @@ -171,4 +171,4 @@ PVCTEST_F(PvcHwInfo, givenPvcHwInfoConfigWhenIsIpSamplingSupportedThenCorrectRes hwInfo.platform.usDeviceID = deviceId; EXPECT_TRUE(hwInfoConfig.isIpSamplingSupported(hwInfo)); } -} +} \ No newline at end of file diff --git a/shared/source/built_ins/built_ins.cpp b/shared/source/built_ins/built_ins.cpp index d3f0cea75f..deb09bc430 100644 --- a/shared/source/built_ins/built_ins.cpp +++ b/shared/source/built_ins/built_ins.cpp @@ -51,10 +51,10 @@ const SipKernel &BuiltIns::getSipKernel(SipKernelType type, Device &device) { auto sipAllocation = device.getMemoryManager()->allocateGraphicsMemoryWithProperties(properties); auto &hwInfo = device.getHardwareInfo(); - auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); + auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); if (sipAllocation) { - MemoryTransferHelper::transferMemoryToAllocation(hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *sipAllocation), + MemoryTransferHelper::transferMemoryToAllocation(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *sipAllocation), device, sipAllocation, 0, sipBinary.data(), sipBinary.size()); } diff --git a/shared/source/built_ins/sip.cpp b/shared/source/built_ins/sip.cpp index 79287e7583..510725c42a 100644 --- a/shared/source/built_ins/sip.cpp +++ b/shared/source/built_ins/sip.cpp @@ -139,9 +139,9 @@ bool SipKernel::initRawBinaryFromFileKernel(SipKernelType type, Device &device, } auto &hwInfo = device.getHardwareInfo(); - auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); + auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); - MemoryTransferHelper::transferMemoryToAllocation(hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *sipAllocation), + MemoryTransferHelper::transferMemoryToAllocation(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *sipAllocation), device, sipAllocation, 0, alignedBuffer, bytesRead); @@ -191,6 +191,7 @@ bool SipKernel::initHexadecimalArraySipKernel(SipKernelType type, Device &device size_t kernelBinarySize = 0u; auto &hwInfo = device.getHardwareInfo(); auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); + hwHelper.setSipKernelData(sipKernelBinary, kernelBinarySize); const auto allocType = AllocationType::KERNEL_ISA_INTERNAL; AllocationProperties properties = {rootDeviceIndex, kernelBinarySize, allocType, device.getDeviceBitfield()}; @@ -200,8 +201,8 @@ bool SipKernel::initHexadecimalArraySipKernel(SipKernelType type, Device &device if (sipAllocation == nullptr) { return false; } - - MemoryTransferHelper::transferMemoryToAllocation(hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *sipAllocation), + auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); + MemoryTransferHelper::transferMemoryToAllocation(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *sipAllocation), device, sipAllocation, 0, sipKernelBinary, kernelBinarySize); diff --git a/shared/source/command_container/command_encoder.h b/shared/source/command_container/command_encoder.h index c96646bb3a..2d7976df7a 100644 --- a/shared/source/command_container/command_encoder.h +++ b/shared/source/command_container/command_encoder.h @@ -393,7 +393,7 @@ struct EncodeMiFlushDW { template struct EncodeMemoryPrefetch { static void programMemoryPrefetch(LinearStream &commandStream, const GraphicsAllocation &graphicsAllocation, uint32_t size, size_t offset, const HardwareInfo &hwInfo); - static size_t getSizeForMemoryPrefetch(size_t size); + static size_t getSizeForMemoryPrefetch(size_t size, const HardwareInfo &hwInfo); }; template diff --git a/shared/source/command_container/command_encoder.inl b/shared/source/command_container/command_encoder.inl index ac427b8d0e..8979f995d9 100644 --- a/shared/source/command_container/command_encoder.inl +++ b/shared/source/command_container/command_encoder.inl @@ -818,7 +818,7 @@ template inline void EncodeMemoryPrefetch::programMemoryPrefetch(LinearStream &commandStream, const GraphicsAllocation &graphicsAllocation, uint32_t size, size_t offset, const HardwareInfo &hwInfo) {} template -inline size_t EncodeMemoryPrefetch::getSizeForMemoryPrefetch(size_t size) { return 0u; } +inline size_t EncodeMemoryPrefetch::getSizeForMemoryPrefetch(size_t size, const HardwareInfo &hwInfo) { return 0u; } template void EncodeMiArbCheck::program(LinearStream &commandStream) { diff --git a/shared/source/compiler_interface/linker.inl b/shared/source/compiler_interface/linker.inl index e4a6303170..d46e12e859 100644 --- a/shared/source/compiler_interface/linker.inl +++ b/shared/source/compiler_interface/linker.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -20,9 +20,9 @@ template void Linker::patchIncrement(Device *pDevice, GraphicsAllocation *dstAllocation, size_t relocationOffset, const void *initData, uint64_t incrementValue) { auto &hwInfo = pDevice->getHardwareInfo(); - auto &helper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); + auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); - bool useBlitter = helper.isBlitCopyRequiredForLocalMemory(hwInfo, *dstAllocation); + bool useBlitter = hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *dstAllocation); auto initValue = ptrOffset(initData, relocationOffset); diff --git a/shared/source/device/device.cpp b/shared/source/device/device.cpp index 0ef79fd4b2..a9e02572c4 100644 --- a/shared/source/device/device.cpp +++ b/shared/source/device/device.cpp @@ -733,7 +733,7 @@ void Device::allocateRTDispatchGlobals(uint32_t maxBvhLevels) { size_t rtMemOffset = alignUp(stackSizePerRay * numRtStacks, MemoryConstants::cacheLineSize); auto &hwInfo = getHardwareInfo(); - auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); + auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); dispatchGlobals.rtMemBasePtr = rtMemOffset; dispatchGlobals.callStackHandlerKSP = reinterpret_cast(nullptr); @@ -741,7 +741,7 @@ void Device::allocateRTDispatchGlobals(uint32_t maxBvhLevels) { dispatchGlobals.numDSSRTStacks = RayTracingHelper::stackDssMultiplier; dispatchGlobals.maxBVHLevels = maxBvhLevels; - MemoryTransferHelper::transferMemoryToAllocation(hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *dispatchGlobalsAllocation), + MemoryTransferHelper::transferMemoryToAllocation(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *dispatchGlobalsAllocation), *this, dispatchGlobalsAllocation, 0, diff --git a/shared/source/helpers/hw_helper.h b/shared/source/helpers/hw_helper.h index c19ed4ba92..010db20975 100644 --- a/shared/source/helpers/hw_helper.h +++ b/shared/source/helpers/hw_helper.h @@ -58,7 +58,6 @@ class HwHelper { virtual bool preferSmallWorkgroupSizeForKernel(const size_t size, const HardwareInfo &hwInfo) const = 0; virtual bool isBufferSizeSuitableForCompression(const size_t size, const HardwareInfo &hwInfo) const = 0; virtual bool checkResourceCompatibility(GraphicsAllocation &graphicsAllocation) = 0; - virtual bool isBlitCopyRequiredForLocalMemory(const HardwareInfo &hwInfo, const GraphicsAllocation &allocation) const = 0; static bool compressedBuffersSupported(const HardwareInfo &hwInfo); static bool compressedImagesSupported(const HardwareInfo &hwInfo); static bool cacheFlushAfterWalkerSupported(const HardwareInfo &hwInfo); @@ -320,8 +319,6 @@ class HwHelperHw : public HwHelper { void setExtraAllocationData(AllocationData &allocationData, const AllocationProperties &properties, const HardwareInfo &hwInfo) const override; - bool isBlitCopyRequiredForLocalMemory(const HardwareInfo &hwInfo, const GraphicsAllocation &allocation) const override; - bool isBankOverrideRequired(const HardwareInfo &hwInfo) const override; int32_t getDefaultThreadArbitrationPolicy() const override; diff --git a/shared/source/helpers/hw_helper_base.inl b/shared/source/helpers/hw_helper_base.inl index 72df70194c..284afb5599 100644 --- a/shared/source/helpers/hw_helper_base.inl +++ b/shared/source/helpers/hw_helper_base.inl @@ -485,13 +485,6 @@ inline uint32_t HwHelperHw::getMinimalSIMDSize() { return 8u; } -template -inline bool HwHelperHw::isBlitCopyRequiredForLocalMemory(const HardwareInfo &hwInfo, const GraphicsAllocation &allocation) const { - return allocation.isAllocatedInLocalMemoryPool() && - (HwInfoConfig::get(hwInfo.platform.eProductFamily)->getLocalMemoryAccessMode(hwInfo) == LocalMemoryAccessMode::CpuAccessDisallowed || - !allocation.isAllocationLockable()); -} - template std::unique_ptr HwHelperHw::createTimestampPacketAllocator(const RootDeviceIndicesContainer &rootDeviceIndices, MemoryManager *memoryManager, size_t initialTagCount, CommandStreamReceiverType csrType, DeviceBitfield deviceBitfield) const { diff --git a/shared/source/os_interface/hw_info_config.h b/shared/source/os_interface/hw_info_config.h index c4deb460f7..acee1766f7 100644 --- a/shared/source/os_interface/hw_info_config.h +++ b/shared/source/os_interface/hw_info_config.h @@ -44,7 +44,7 @@ class HwInfoConfig { virtual void getKernelExtendedProperties(uint32_t *fp16, uint32_t *fp32, uint32_t *fp64) = 0; virtual std::vector getKernelSupportedThreadArbitrationPolicies() = 0; virtual void convertTimestampsFromOaToCsDomain(uint64_t ×tampData) = 0; - virtual uint32_t getDeviceMemoryMaxClkRate(const HardwareInfo *hwInfo) = 0; + virtual uint32_t getDeviceMemoryMaxClkRate(const HardwareInfo &hwInfo) = 0; virtual bool isAdditionalStateBaseAddressWARequired(const HardwareInfo &hwInfo) const = 0; virtual bool isMaxThreadsForWorkgroupWARequired(const HardwareInfo &hwInfo) const = 0; virtual uint32_t getMaxThreadsForWorkgroupInDSSOrSS(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice, uint32_t maxNumEUsPerDualSubSlice) const = 0; @@ -104,6 +104,10 @@ class HwInfoConfig { virtual bool isGrfNumReportedWithScm() const = 0; virtual bool isCooperativeEngineSupported(const HardwareInfo &hwInfo) const = 0; virtual bool isTimestampWaitSupportedForEvents() const = 0; + virtual bool isTilePlacementResourceWaRequired(const HardwareInfo &hwInfo) const = 0; + virtual bool allowMemoryPrefetch(const HardwareInfo &hwInfo) const = 0; + virtual bool isBcsReportWaRequired(const HardwareInfo &hwInfo) const = 0; + virtual bool isBlitCopyRequiredForLocalMemory(const HardwareInfo &hwInfo, const GraphicsAllocation &allocation) const = 0; MOCKABLE_VIRTUAL ~HwInfoConfig() = default; @@ -132,7 +136,7 @@ class HwInfoConfigHw : public HwInfoConfig { void getKernelExtendedProperties(uint32_t *fp16, uint32_t *fp32, uint32_t *fp64) override; std::vector getKernelSupportedThreadArbitrationPolicies() override; void convertTimestampsFromOaToCsDomain(uint64_t ×tampData) override; - uint32_t getDeviceMemoryMaxClkRate(const HardwareInfo *hwInfo) override; + uint32_t getDeviceMemoryMaxClkRate(const HardwareInfo &hwInfo) override; bool isAdditionalStateBaseAddressWARequired(const HardwareInfo &hwInfo) const override; bool isMaxThreadsForWorkgroupWARequired(const HardwareInfo &hwInfo) const override; uint32_t getMaxThreadsForWorkgroupInDSSOrSS(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice, uint32_t maxNumEUsPerDualSubSlice) const override; @@ -192,6 +196,10 @@ class HwInfoConfigHw : public HwInfoConfig { bool isGrfNumReportedWithScm() const override; bool isCooperativeEngineSupported(const HardwareInfo &hwInfo) const override; bool isTimestampWaitSupportedForEvents() const override; + bool isTilePlacementResourceWaRequired(const HardwareInfo &hwInfo) const override; + bool allowMemoryPrefetch(const HardwareInfo &hwInfo) const override; + bool isBcsReportWaRequired(const HardwareInfo &hwInfo) const override; + bool isBlitCopyRequiredForLocalMemory(const HardwareInfo &hwInfo, const GraphicsAllocation &allocation) const override; protected: HwInfoConfigHw() = default; diff --git a/shared/source/os_interface/hw_info_config.inl b/shared/source/os_interface/hw_info_config.inl index 41cc916d08..b97c37253d 100644 --- a/shared/source/os_interface/hw_info_config.inl +++ b/shared/source/os_interface/hw_info_config.inl @@ -10,6 +10,7 @@ #include "shared/source/helpers/driver_model_type.h" #include "shared/source/helpers/hw_helper.h" #include "shared/source/helpers/preamble.h" +#include "shared/source/memory_manager/graphics_allocation.h" #include "shared/source/os_interface/hw_info_config.h" namespace NEO { @@ -91,7 +92,7 @@ uint64_t HwInfoConfigHw::getSharedSystemMemCapabilities(const Hardwa } template -uint32_t HwInfoConfigHw::getDeviceMemoryMaxClkRate(const HardwareInfo *hwInfo) { +uint32_t HwInfoConfigHw::getDeviceMemoryMaxClkRate(const HardwareInfo &hwInfo) { return 0u; } @@ -367,4 +368,34 @@ bool HwInfoConfigHw::isTimestampWaitSupportedForEvents() const { return false; } +template +bool HwInfoConfigHw::isTilePlacementResourceWaRequired(const HardwareInfo &hwInfo) const { + if (DebugManager.flags.ForceTile0PlacementForTile1ResourcesWaActive.get() != -1) { + return DebugManager.flags.ForceTile0PlacementForTile1ResourcesWaActive.get(); + } + return false; +} + +template +bool HwInfoConfigHw::allowMemoryPrefetch(const HardwareInfo &hwInfo) const { + if (DebugManager.flags.EnableMemoryPrefetch.get() != -1) { + return !!DebugManager.flags.EnableMemoryPrefetch.get(); + } + return true; +} + +template +bool HwInfoConfigHw::isBcsReportWaRequired(const HardwareInfo &hwInfo) const { + if (DebugManager.flags.DoNotReportTile1BscWaActive.get() != -1) { + return DebugManager.flags.DoNotReportTile1BscWaActive.get(); + } + return false; +} + +template +bool HwInfoConfigHw::isBlitCopyRequiredForLocalMemory(const HardwareInfo &hwInfo, const GraphicsAllocation &allocation) const { + return allocation.isAllocatedInLocalMemoryPool() && + (HwInfoConfig::get(hwInfo.platform.eProductFamily)->getLocalMemoryAccessMode(hwInfo) == LocalMemoryAccessMode::CpuAccessDisallowed || + !allocation.isAllocationLockable()); +} } // namespace NEO diff --git a/shared/source/program/kernel_info.cpp b/shared/source/program/kernel_info.cpp index acb145878e..649aa25ebe 100644 --- a/shared/source/program/kernel_info.cpp +++ b/shared/source/program/kernel_info.cpp @@ -131,9 +131,9 @@ bool KernelInfo::createKernelAllocation(const Device &device, bool internalIsa) kernelAllocation = kernelAllocations->second.kernelAllocation; kernelAllocations->second.reuseCounter++; auto &hwInfo = device.getHardwareInfo(); - auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); + auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); - return MemoryTransferHelper::transferMemoryToAllocation(hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *kernelAllocation), + return MemoryTransferHelper::transferMemoryToAllocation(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *kernelAllocation), device, kernelAllocation, 0, heapInfo.pKernelHeap, static_cast(kernelIsaSize)); } else { @@ -149,9 +149,9 @@ bool KernelInfo::createKernelAllocation(const Device &device, bool internalIsa) } auto &hwInfo = device.getHardwareInfo(); - auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); + auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); - return MemoryTransferHelper::transferMemoryToAllocation(hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *kernelAllocation), + return MemoryTransferHelper::transferMemoryToAllocation(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *kernelAllocation), device, kernelAllocation, 0, heapInfo.pKernelHeap, static_cast(kernelIsaSize)); } diff --git a/shared/source/program/program_initialization.cpp b/shared/source/program/program_initialization.cpp index c3b177cc1b..57d56e7feb 100644 --- a/shared/source/program/program_initialization.cpp +++ b/shared/source/program/program_initialization.cpp @@ -61,9 +61,9 @@ GraphicsAllocation *allocateGlobalsSurface(NEO::SVMAllocsManager *const svmAlloc } auto &hwInfo = device.getHardwareInfo(); - auto &helper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); + auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); - auto success = MemoryTransferHelper::transferMemoryToAllocation(helper.isBlitCopyRequiredForLocalMemory(hwInfo, *gpuAllocation), + auto success = MemoryTransferHelper::transferMemoryToAllocation(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *gpuAllocation), device, gpuAllocation, 0, initData, size); UNRECOVERABLE_IF(!success); diff --git a/shared/source/xe_hp_core/linux/hw_info_config_xe_hp_sdv.cpp b/shared/source/xe_hp_core/linux/hw_info_config_xe_hp_sdv.cpp index e249c28309..05824b8297 100644 --- a/shared/source/xe_hp_core/linux/hw_info_config_xe_hp_sdv.cpp +++ b/shared/source/xe_hp_core/linux/hw_info_config_xe_hp_sdv.cpp @@ -72,7 +72,7 @@ void HwInfoConfigHw::getKernelExtendedProperties(uint32_t *fp16, uin } template <> -uint32_t HwInfoConfigHw::getDeviceMemoryMaxClkRate(const HardwareInfo *hwInfo) { +uint32_t HwInfoConfigHw::getDeviceMemoryMaxClkRate(const HardwareInfo &hwInfo) { return 2800u; } diff --git a/shared/source/xe_hp_core/windows/hw_info_config_xe_hp_sdv.cpp b/shared/source/xe_hp_core/windows/hw_info_config_xe_hp_sdv.cpp index 3efcf993b6..43cbede5db 100644 --- a/shared/source/xe_hp_core/windows/hw_info_config_xe_hp_sdv.cpp +++ b/shared/source/xe_hp_core/windows/hw_info_config_xe_hp_sdv.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -51,7 +51,7 @@ void HwInfoConfigHw::getKernelExtendedProperties(uint32_t *fp16, uin } template <> -uint32_t HwInfoConfigHw::getDeviceMemoryMaxClkRate(const HardwareInfo *hwInfo) { +uint32_t HwInfoConfigHw::getDeviceMemoryMaxClkRate(const HardwareInfo &hwInfo) { return 2800u; } diff --git a/shared/source/xe_hpc_core/command_encoder_xe_hpc_core.cpp b/shared/source/xe_hpc_core/command_encoder_xe_hpc_core.cpp index c46f1d59f9..4128cfb244 100644 --- a/shared/source/xe_hpc_core/command_encoder_xe_hpc_core.cpp +++ b/shared/source/xe_hpc_core/command_encoder_xe_hpc_core.cpp @@ -99,12 +99,7 @@ void EncodeMemoryPrefetch::programMemoryPrefetch(LinearStream &commandSt using STATE_PREFETCH = typename Family::STATE_PREFETCH; constexpr uint32_t mocsIndexForL3 = (2 << 1); - bool isBaseDieA0 = (hwInfo.platform.usRevId & Family::pvcBaseDieRevMask) == Family::pvcBaseDieA0Masked; - - bool prefetch = !isBaseDieA0; - if (DebugManager.flags.EnableMemoryPrefetch.get() != -1) { - prefetch = !!DebugManager.flags.EnableMemoryPrefetch.get(); - } + bool prefetch = HwInfoConfig::get(hwInfo.platform.eProductFamily)->allowMemoryPrefetch(hwInfo); if (!prefetch) { return; @@ -143,11 +138,10 @@ void EncodeMemoryPrefetch::programMemoryPrefetch(LinearStream &commandSt } template <> -size_t EncodeMemoryPrefetch::getSizeForMemoryPrefetch(size_t size) { +size_t EncodeMemoryPrefetch::getSizeForMemoryPrefetch(size_t size, const HardwareInfo &hwInfo) { if (DebugManager.flags.EnableMemoryPrefetch.get() == 0) { return 0; } - size = alignUp(size, MemoryConstants::pageSize64k); size_t count = size / MemoryConstants::pageSize64k; diff --git a/shared/source/xe_hpc_core/hw_cmds_base.h b/shared/source/xe_hpc_core/hw_cmds_base.h index d8b8db884e..b76e465e75 100644 --- a/shared/source/xe_hpc_core/hw_cmds_base.h +++ b/shared/source/xe_hpc_core/hw_cmds_base.h @@ -27,9 +27,6 @@ struct XE_HPC_CORE { static constexpr uint32_t stateComputeModeEuThreadSchedulingModeOverrideMask = (0b11u << 13); static constexpr uint32_t stateComputeModeLargeGrfModeMask = (1u << 15); - static constexpr uint8_t pvcBaseDieRevMask = 0b111000; // [3:5] - static constexpr uint8_t pvcBaseDieA0Masked = 0; // [3:5] == 0 - static constexpr bool isUsingL3Control = false; static constexpr bool isUsingMediaSamplerDopClockGate = false; static constexpr bool supportsSampler = false; diff --git a/shared/source/xe_hpc_core/hw_cmds_pvc.h b/shared/source/xe_hpc_core/hw_cmds_pvc.h index d68fd378cb..32e373b0eb 100644 --- a/shared/source/xe_hpc_core/hw_cmds_pvc.h +++ b/shared/source/xe_hpc_core/hw_cmds_pvc.h @@ -33,6 +33,9 @@ struct PVC : public XE_HPC_COREFamily { static bool isXlA0(const HardwareInfo &hwInfo); static bool isAtMostXtA0(const HardwareInfo &hwInfo); + static constexpr uint8_t pvcBaseDieRevMask = 0b111000; // [3:5] + static constexpr uint8_t pvcBaseDieA0Masked = 0; // [3:5] == 0 + static bool isXl(const HardwareInfo &hwInfo) { auto it = std::find(PVC_XL_IDS.begin(), PVC_XL_IDS.end(), hwInfo.platform.usDeviceID); return it != PVC_XL_IDS.end(); diff --git a/shared/source/xe_hpc_core/hw_helper_xe_hpc_core.cpp b/shared/source/xe_hpc_core/hw_helper_xe_hpc_core.cpp index 98dc5b73e3..01548be49d 100644 --- a/shared/source/xe_hpc_core/hw_helper_xe_hpc_core.cpp +++ b/shared/source/xe_hpc_core/hw_helper_xe_hpc_core.cpp @@ -263,9 +263,7 @@ void HwHelperHw::setExtraAllocationData(AllocationData &allocationData, if (allocationData.flags.requiresCpuAccess && !allocationData.flags.useSystemMemory && (allocationData.storageInfo.getMemoryBanks() > 1)) { - bool bdA0 = ((hwInfo.platform.usRevId & Family::pvcBaseDieRevMask) == Family::pvcBaseDieA0Masked); - bool applyWa = ((DebugManager.flags.ForceTile0PlacementForTile1ResourcesWaActive.get() == 1) || bdA0); - applyWa &= (DebugManager.flags.ForceTile0PlacementForTile1ResourcesWaActive.get() != 0); + bool applyWa = HwInfoConfig::get(hwInfo.platform.eProductFamily)->isTilePlacementResourceWaRequired(hwInfo); if (applyWa) { allocationData.storageInfo.memoryBanks = 1; // force Tile0 @@ -380,46 +378,12 @@ template <> bool HwHelperHw::isSubDeviceEngineSupported(const HardwareInfo &hwInfo, const DeviceBitfield &deviceBitfield, aub_stream::EngineType engineType) const { constexpr uint64_t tile1Bitfield = 0b10; - bool isBaseDieA0 = (hwInfo.platform.usRevId & Family::pvcBaseDieRevMask) == Family::pvcBaseDieA0Masked; bool affectedEngine = (deviceBitfield.to_ulong() == tile1Bitfield) && (aub_stream::ENGINE_BCS == engineType || aub_stream::ENGINE_BCS1 == engineType || aub_stream::ENGINE_BCS3 == engineType); - if (affectedEngine) { - if (DebugManager.flags.DoNotReportTile1BscWaActive.get() != -1) { - return !DebugManager.flags.DoNotReportTile1BscWaActive.get(); - } - - return !isBaseDieA0; - } - - return true; -} - -template <> -inline bool HwHelperHw::isBlitCopyRequiredForLocalMemory(const HardwareInfo &hwInfo, const GraphicsAllocation &allocation) const { - if (!allocation.isAllocatedInLocalMemoryPool()) { - return false; - } - - if (HwInfoConfig::get(hwInfo.platform.eProductFamily)->getLocalMemoryAccessMode(hwInfo) == LocalMemoryAccessMode::CpuAccessDisallowed) { - // Regular L3 WA - return true; - } - - if (!allocation.isAllocationLockable()) { - return true; - } - - bool isBaseDieA0 = (hwInfo.platform.usRevId & Family::pvcBaseDieRevMask) == Family::pvcBaseDieA0Masked; - bool isOtherTileThan0Accessed = allocation.storageInfo.memoryBanks.to_ulong() > 1u; - if (isBaseDieA0 && isOtherTileThan0Accessed) { - // Tile1 CPU access - return true; - } - - return false; + return affectedEngine ? !HwInfoConfig::get(hwInfo.platform.eProductFamily)->isBcsReportWaRequired(hwInfo) : true; } template <> diff --git a/shared/source/xe_hpc_core/pvc/os_agnostic_hw_info_config_pvc.inl b/shared/source/xe_hpc_core/pvc/os_agnostic_hw_info_config_pvc.inl index da67f889e5..d15360057c 100644 --- a/shared/source/xe_hpc_core/pvc/os_agnostic_hw_info_config_pvc.inl +++ b/shared/source/xe_hpc_core/pvc/os_agnostic_hw_info_config_pvc.inl @@ -82,16 +82,6 @@ PRODUCT_CONFIG HwInfoConfigHw::getProductConfigFromHwInfo(const Hard } } -template <> -uint32_t HwInfoConfigHw::getDeviceMemoryMaxClkRate(const HardwareInfo *hwInfo) { - bool isBaseDieA0 = (hwInfo->platform.usRevId & XE_HPC_COREFamily::pvcBaseDieRevMask) == XE_HPC_COREFamily::pvcBaseDieA0Masked; - if (isBaseDieA0) { - // For IGFX_PVC REV A0 HBM frequency would be 3.2 GT/s = 3.2 * 1000 MT/s = 3200 MT/s - return 3200u; - } - return 0u; -} - template <> bool HwInfoConfigHw::isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const { return getSteppingFromHwRevId(hwInfo) >= REVISION_B; @@ -120,4 +110,67 @@ bool HwInfoConfigHw::isAdjustProgrammableIdPreferredSlmSizeRequired( template <> bool HwInfoConfigHw::isCooperativeEngineSupported(const HardwareInfo &hwInfo) const { return (HwInfoConfig::get(hwInfo.platform.eProductFamily)->getSteppingFromHwRevId(hwInfo) >= REVISION_B); -} \ No newline at end of file +} + +bool isBaseDieA0(const HardwareInfo &hwInfo) { + return (hwInfo.platform.usRevId & PVC::pvcBaseDieRevMask) == PVC::pvcBaseDieA0Masked; +} + +template <> +uint32_t HwInfoConfigHw::getDeviceMemoryMaxClkRate(const HardwareInfo &hwInfo) { + bool isDieA0 = isBaseDieA0(hwInfo); + if (isDieA0) { + // For IGFX_PVC REV A0 HBM frequency would be 3.2 GT/s = 3.2 * 1000 MT/s = 3200 MT/s + return 3200u; + } + return 0u; +} + +template <> +bool HwInfoConfigHw::isTilePlacementResourceWaRequired(const HardwareInfo &hwInfo) const { + bool baseDieA0 = isBaseDieA0(hwInfo); + bool applyWa = ((DebugManager.flags.ForceTile0PlacementForTile1ResourcesWaActive.get() == 1) || baseDieA0); + applyWa &= (DebugManager.flags.ForceTile0PlacementForTile1ResourcesWaActive.get() != 0); + return applyWa; +} + +template <> +bool HwInfoConfigHw::allowMemoryPrefetch(const HardwareInfo &hwInfo) const { + bool prefetch = !isBaseDieA0(hwInfo); + if (DebugManager.flags.EnableMemoryPrefetch.get() != -1) { + prefetch = !!DebugManager.flags.EnableMemoryPrefetch.get(); + } + return prefetch; +} +template <> +bool HwInfoConfigHw::isBcsReportWaRequired(const HardwareInfo &hwInfo) const { + if (DebugManager.flags.DoNotReportTile1BscWaActive.get() != -1) { + return DebugManager.flags.DoNotReportTile1BscWaActive.get(); + } + return isBaseDieA0(hwInfo); +} + +template <> +bool HwInfoConfigHw::isBlitCopyRequiredForLocalMemory(const HardwareInfo &hwInfo, const GraphicsAllocation &allocation) const { + if (!allocation.isAllocatedInLocalMemoryPool()) { + return false; + } + + if (getLocalMemoryAccessMode(hwInfo) == LocalMemoryAccessMode::CpuAccessDisallowed) { + // Regular L3 WA + return true; + } + + if (!allocation.isAllocationLockable()) { + return true; + } + + bool isDieA0 = isBaseDieA0(hwInfo); + bool isOtherTileThan0Accessed = allocation.storageInfo.memoryBanks.to_ulong() > 1u; + if (isDieA0 && isOtherTileThan0Accessed) { + // Tile1 CPU access + return true; + } + + return false; +} diff --git a/shared/test/common/mocks/mock_hw_info_config.cpp b/shared/test/common/mocks/mock_hw_info_config.cpp index a8e9a0386e..8349c22097 100644 --- a/shared/test/common/mocks/mock_hw_info_config.cpp +++ b/shared/test/common/mocks/mock_hw_info_config.cpp @@ -72,7 +72,7 @@ bool HwInfoConfigHw::overrideGfxPartitionLayoutForWsl() const { } template <> -uint32_t HwInfoConfigHw::getDeviceMemoryMaxClkRate(const HardwareInfo *hwInfo) { +uint32_t HwInfoConfigHw::getDeviceMemoryMaxClkRate(const HardwareInfo &hwInfo) { return 0; } @@ -348,6 +348,7 @@ bool HwInfoConfigHw::useChannelRedForUnusedShaderChannels() const } template <> + void HwInfoConfigHw::updateScmCommand(void *const commandPtr, const StateComputeModeProperties &properties) { } @@ -359,6 +360,9 @@ template <> bool HwInfoConfigHw::isGrfNumReportedWithScm() const { return false; } +template <> +void HwInfoConfigHw::enableCompression(HardwareInfo *hwInfo) { +} template <> bool HwInfoConfigHw::isCooperativeEngineSupported(const HardwareInfo &hwInfo) const { @@ -370,4 +374,12 @@ bool HwInfoConfigHw::isTimestampWaitSupportedForEvents() const { return false; } -} //namespace NEO +template <> +uint64_t HwInfoConfigHw::getHostMemCapabilitiesValue() { + return 0; +} +} // namespace NEO + +#include "shared/source/os_interface/hw_info_config.inl" + +template class NEO::HwInfoConfigHw; diff --git a/shared/test/unit_test/command_container/command_encoder_tests.cpp b/shared/test/unit_test/command_container/command_encoder_tests.cpp index 01c89c3daf..774e7e1b4e 100644 --- a/shared/test/unit_test/command_container/command_encoder_tests.cpp +++ b/shared/test/unit_test/command_container/command_encoder_tests.cpp @@ -59,7 +59,7 @@ HWTEST_F(CommandEncoderTests, whenEncodeMemoryPrefetchCalledThenDoNothing) { EncodeMemoryPrefetch::programMemoryPrefetch(linearStream, allocation, 2, 0, *defaultHwInfo); EXPECT_EQ(0u, linearStream.getUsed()); - EXPECT_EQ(0u, EncodeMemoryPrefetch::getSizeForMemoryPrefetch(2)); + EXPECT_EQ(0u, EncodeMemoryPrefetch::getSizeForMemoryPrefetch(2, *defaultHwInfo)); } HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncoderTests, WhenAnyParameterIsProvidedThenRuntimeGenerationLocalIdsIsRequired) { diff --git a/shared/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.cpp b/shared/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.cpp index 16d7190f23..ffd9076aa0 100644 --- a/shared/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.cpp +++ b/shared/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.cpp @@ -734,7 +734,7 @@ HWTEST2_F(MemoryManagerDirectSubmissionImplicitScalingTest, givenDirectSubmissio } } -HWTEST2_F(MemoryManagerDirectSubmissionImplicitScalingTest, givenDirectSubmissionForceLocalMemoryStorageEnabledForAllEnginesWhenAllocatingMemoryForCommandOrRingOrSemaphoreBufferThenFirstBankIsSelected, IsXeHpcCore) { +HWTEST2_F(MemoryManagerDirectSubmissionImplicitScalingTest, givenDirectSubmissionForceLocalMemoryStorageEnabledForAllEnginesWhenAllocatingMemoryForCommandOrRingOrSemaphoreBufferThenFirstBankIsSelected, IsPVC) { DebugManager.flags.DirectSubmissionForceLocalMemoryStorageMode.set(2); for (auto &multiTile : ::testing::Bool()) { for (auto &allocationType : {AllocationType::COMMAND_BUFFER, AllocationType::RING_BUFFER, AllocationType::SEMAPHORE_BUFFER}) { @@ -752,7 +752,7 @@ HWTEST2_F(MemoryManagerDirectSubmissionImplicitScalingTest, givenDirectSubmissio } } -HWTEST2_F(MemoryManagerDirectSubmissionImplicitScalingTest, givenDirectSubmissionForceLocalMemoryStorageDefaultModeWhenAllocatingMemoryForCommandOrRingOrSemaphoreBufferThenFirstBankIsSelected, IsXeHpcCore) { +HWTEST2_F(MemoryManagerDirectSubmissionImplicitScalingTest, givenDirectSubmissionForceLocalMemoryStorageDefaultModeWhenAllocatingMemoryForCommandOrRingOrSemaphoreBufferThenFirstBankIsSelected, IsPVC) { DebugManager.flags.DirectSubmissionForceLocalMemoryStorageMode.set(-1); for (auto &multiTile : ::testing::Bool()) { for (auto &allocationType : {AllocationType::COMMAND_BUFFER, AllocationType::RING_BUFFER, AllocationType::SEMAPHORE_BUFFER}) { diff --git a/shared/test/unit_test/xe_hpc_core/test_encode_xe_hpc_core.cpp b/shared/test/unit_test/xe_hpc_core/test_encode_xe_hpc_core.cpp index 35ab7f3e17..9f3b66989d 100644 --- a/shared/test/unit_test/xe_hpc_core/test_encode_xe_hpc_core.cpp +++ b/shared/test/unit_test/xe_hpc_core/test_encode_xe_hpc_core.cpp @@ -100,7 +100,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenDebugVariableSetwhenProgramin uint32_t alignedSize = alignUp(expectedSize, MemoryConstants::pageSize64k); uint32_t expectedCmdsCount = std::max((alignedSize / static_cast(MemoryConstants::pageSize64k)), 1u); - EXPECT_EQ(sizeof(STATE_PREFETCH) * expectedCmdsCount, EncodeMemoryPrefetch::getSizeForMemoryPrefetch(expectedSize)); + EXPECT_EQ(sizeof(STATE_PREFETCH) * expectedCmdsCount, EncodeMemoryPrefetch::getSizeForMemoryPrefetch(expectedSize, hwInfo)); EncodeMemoryPrefetch::programMemoryPrefetch(linearStream, allocation, expectedSize, 0, hwInfo); EXPECT_EQ(sizeof(STATE_PREFETCH) * expectedCmdsCount, linearStream.getUsed()); @@ -134,7 +134,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenIsaAllocationWhenProgrammingP uint8_t buffer[sizeof(STATE_PREFETCH)] = {}; auto statePrefetchCmd = reinterpret_cast(buffer); - EXPECT_EQ(sizeof(STATE_PREFETCH), EncodeMemoryPrefetch::getSizeForMemoryPrefetch(1)); + EXPECT_EQ(sizeof(STATE_PREFETCH), EncodeMemoryPrefetch::getSizeForMemoryPrefetch(1, hwInfo)); AllocationType isaTypes[] = {AllocationType::KERNEL_ISA, AllocationType::KERNEL_ISA_INTERNAL}; @@ -171,7 +171,7 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenDebugFlagSetWhenProgramPrefet LinearStream linearStream(buffer, sizeof(buffer)); DebugManager.flags.EnableMemoryPrefetch.set(0); - EXPECT_EQ(0u, EncodeMemoryPrefetch::getSizeForMemoryPrefetch(100)); + EXPECT_EQ(0u, EncodeMemoryPrefetch::getSizeForMemoryPrefetch(100, hwInfo)); EncodeMemoryPrefetch::programMemoryPrefetch(linearStream, allocation, 100, 0, hwInfo); EXPECT_EQ(0u, linearStream.getUsed()); @@ -183,26 +183,6 @@ XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenDebugFlagSetWhenProgramPrefet } } -XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenSteppingWhenProgrammingPrefetchThenProgramOnlyAboveAzero) { - using STATE_PREFETCH = typename FamilyType::STATE_PREFETCH; - - HardwareInfo hwInfo = *defaultHwInfo; - hwInfo.platform.usRevId = 0b0100'0111; // [3:5] - BaseDie == A0; - - const GraphicsAllocation allocation(0, AllocationType::KERNEL_ISA, - nullptr, 1234, 0, 4096, MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); - uint8_t buffer[sizeof(STATE_PREFETCH)] = {}; - - LinearStream linearStream(buffer, sizeof(buffer)); - - EncodeMemoryPrefetch::programMemoryPrefetch(linearStream, allocation, 123, 0, hwInfo); - EXPECT_EQ(0u, linearStream.getUsed()); - - hwInfo.platform.usRevId = 0b0010'1000; // [3:5] - BaseDie != A0 - EncodeMemoryPrefetch::programMemoryPrefetch(linearStream, allocation, 123, 0, hwInfo); - EXPECT_EQ(sizeof(STATE_PREFETCH), linearStream.getUsed()); -} - XE_HPC_CORETEST_F(CommandEncodeXeHpcCoreTest, givenDebugFlagSetWhenProgrammingPrefetchThenSetParserStall) { using STATE_PREFETCH = typename FamilyType::STATE_PREFETCH;