diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index c7c3b381d1..7a0b59e7b4 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -1775,7 +1775,8 @@ ze_result_t CommandListCoreFamily::appendBlitFill(void *ptr, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents) { auto neoDevice = device->getNEODevice(); - if (NEO::GfxCoreHelper::get(device->getHwInfo().platform.eRenderCoreFamily).getMaxFillPaternSizeForCopyEngine() < patternSize) { + auto &gfxCoreHelper = neoDevice->getGfxCoreHelper(); + if (gfxCoreHelper.getMaxFillPaternSizeForCopyEngine() < patternSize) { return ZE_RESULT_ERROR_INVALID_SIZE; } else { ze_result_t ret = addEventsToCmdList(numWaitEvents, phWaitEvents, true); @@ -2334,7 +2335,8 @@ ze_result_t CommandListCoreFamily::appendQueryKernelTimestamps( UNRECOVERABLE_IF(!result); Kernel *builtinKernel = nullptr; - auto useOnlyGlobalTimestamps = NEO::GfxCoreHelper::get(device->getHwInfo().platform.eRenderCoreFamily).useOnlyGlobalTimestamps() ? 1u : 0u; + auto &gfxCoreHelper = device->getGfxCoreHelper(); + auto useOnlyGlobalTimestamps = gfxCoreHelper.useOnlyGlobalTimestamps() ? 1u : 0u; auto lock = device->getBuiltinFunctionsLib()->obtainUniqueOwnership(); if (pOffsets == nullptr) { diff --git a/level_zero/core/source/cmdlist/cmdlist_hw_base.inl b/level_zero/core/source/cmdlist/cmdlist_hw_base.inl index 883fab33a8..45f41ab00b 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw_base.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw_base.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -31,8 +31,8 @@ struct DeviceImp; template size_t CommandListCoreFamily::getReserveSshSize() { - auto &helper = NEO::GfxCoreHelper::get(device->getHwInfo().platform.eRenderCoreFamily); - return helper.getRenderSurfaceStateSize(); + auto &gfxCoreHelper = device->getGfxCoreHelper(); + return gfxCoreHelper.getRenderSurfaceStateSize(); } template diff --git a/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl b/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl index c4a18d373c..cc1f951014 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -632,7 +632,9 @@ bool CommandListCoreFamilyImmediate::preferCopyThroughLockedPtr(N if (NEO::DebugManager.flags.ExperimentalD2HCpuCopyThreshold.get() != -1) { d2HThreshold = NEO::DebugManager.flags.ExperimentalD2HCpuCopyThreshold.get(); } - if (NEO::GfxCoreHelper::get(this->device->getHwInfo().platform.eRenderCoreFamily).copyThroughLockedPtrEnabled(this->device->getHwInfo())) { + + auto &gfxCoreHelper = this->device->getGfxCoreHelper(); + if (gfxCoreHelper.copyThroughLockedPtrEnabled(this->device->getHwInfo())) { return (!srcFound && isSuitableUSMDeviceAlloc(dstAlloc, dstFound) && size <= h2DThreshold) || (!dstFound && isSuitableUSMDeviceAlloc(srcAlloc, srcFound) && size <= d2HThreshold); } diff --git a/level_zero/core/source/device/device_imp.cpp b/level_zero/core/source/device/device_imp.cpp index 5958dd5888..94445a950b 100644 --- a/level_zero/core/source/device/device_imp.cpp +++ b/level_zero/core/source/device/device_imp.cpp @@ -719,7 +719,7 @@ ze_result_t DeviceImp::getKernelProperties(ze_device_module_properties_t *pKerne } else if (extendedProperties->stype == ZE_STRUCTURE_TYPE_DEVICE_RAYTRACING_EXT_PROPERTIES) { ze_device_raytracing_ext_properties_t *rtProperties = reinterpret_cast(extendedProperties); - auto &l0GfxCoreHelper = L0GfxCoreHelper::get(hardwareInfo.platform.eRenderCoreFamily); + auto &l0GfxCoreHelper = this->neoDevice->getRootDeviceEnvironment().getHelper(); if (l0GfxCoreHelper.platformSupportsRayTracing()) { rtProperties->flags = ZE_DEVICE_RAYTRACING_EXT_FLAG_RAYQUERY; @@ -1607,7 +1607,7 @@ ze_result_t DeviceImp::getFabricVertex(ze_fabric_vertex_handle_t *phVertex) { uint32_t DeviceImp::getEventMaxPacketCount() const { const auto &hardwareInfo = this->getHwInfo(); - auto &l0GfxCoreHelper = L0GfxCoreHelper::get(hardwareInfo.platform.eRenderCoreFamily); + auto &l0GfxCoreHelper = this->neoDevice->getRootDeviceEnvironment().getHelper(); uint32_t basePackets = l0GfxCoreHelper.getEventBaseMaxPacketCount(hardwareInfo); if (this->isImplicitScalingCapable()) { @@ -1618,7 +1618,7 @@ uint32_t DeviceImp::getEventMaxPacketCount() const { uint32_t DeviceImp::getEventMaxKernelCount() const { const auto &hardwareInfo = this->getHwInfo(); - auto &l0GfxCoreHelper = L0GfxCoreHelper::get(hardwareInfo.platform.eRenderCoreFamily); + auto &l0GfxCoreHelper = this->neoDevice->getRootDeviceEnvironment().getHelper(); return l0GfxCoreHelper.getEventMaxKernelCount(hardwareInfo); } diff --git a/level_zero/core/source/event/event_impl.inl b/level_zero/core/source/event/event_impl.inl index 5899d6a653..efc125845c 100644 --- a/level_zero/core/source/event/event_impl.inl +++ b/level_zero/core/source/event/event_impl.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -384,7 +384,8 @@ ze_result_t EventImp::queryKernelTimestamp(ze_kernel_timestamp_result_ memcpy_s(&(timestampFieldForWriting), sizeof(uint64_t), static_cast(×tampFieldToCopy), sizeof(uint64_t)); }; - if (!NEO::GfxCoreHelper::get(device->getHwInfo().platform.eRenderCoreFamily).useOnlyGlobalTimestamps()) { + auto &gfxCoreHelper = this->device->getGfxCoreHelper(); + if (!gfxCoreHelper.useOnlyGlobalTimestamps()) { eventTsSetFunc(contextStartTS, result.context.kernelStart); eventTsSetFunc(globalStartTS, result.global.kernelStart); eventTsSetFunc(contextEndTS, result.context.kernelEnd); diff --git a/level_zero/core/test/unit_tests/fixtures/cmdlist_fixture.cpp b/level_zero/core/test/unit_tests/fixtures/cmdlist_fixture.cpp index c61108f7c4..5aa1d2ba52 100644 --- a/level_zero/core/test/unit_tests/fixtures/cmdlist_fixture.cpp +++ b/level_zero/core/test/unit_tests/fixtures/cmdlist_fixture.cpp @@ -100,7 +100,8 @@ void ModuleMutableCommandListFixture::setUpImpl(uint32_t revision) { false, returnValue)); - engineGroupType = NEO::GfxCoreHelper::get(device->getHwInfo().platform.eRenderCoreFamily).getEngineGroupType(neoDevice->getDefaultEngine().getEngineType(), neoDevice->getDefaultEngine().getEngineUsage(), device->getHwInfo()); + auto &gfxCoreHelper = device->getGfxCoreHelper(); + engineGroupType = gfxCoreHelper.getEngineGroupType(neoDevice->getDefaultEngine().getEngineType(), neoDevice->getDefaultEngine().getEngineUsage(), device->getHwInfo()); commandList.reset(whiteboxCast(CommandList::create(productFamily, device, engineGroupType, 0u, returnValue))); commandListImmediate.reset(whiteboxCast(CommandList::createImmediate(productFamily, device, &queueDesc, false, engineGroupType, returnValue))); diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp index 16d6e024bc..80f9addb35 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -1297,8 +1297,8 @@ using SupportedPlatforms = IsWithinProducts; HWTEST2_F(CommandListCreate, givenCommandListThenSshCorrectlyReserved, SupportedPlatforms) { MockCommandListHw commandList; commandList.initialize(device, NEO::EngineGroupType::Compute, 0u); - auto &helper = NEO::GfxCoreHelper::get(commandList.device->getHwInfo().platform.eRenderCoreFamily); - auto size = helper.getRenderSurfaceStateSize(); + auto &gfxCoreHelper = commandList.device->getGfxCoreHelper(); + auto size = gfxCoreHelper.getRenderSurfaceStateSize(); EXPECT_EQ(commandList.getReserveSshSize(), size); } diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_5.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_5.cpp index 47122cf350..5edae2b865 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_5.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_5.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -94,7 +94,8 @@ HWTEST2_F(AppendQueryKernelTimestamps, givenCommandListWhenAppendQueryKernelTime EXPECT_EQ(1u, commandList.cmdListHelper.groupSize[1]); EXPECT_EQ(1u, commandList.cmdListHelper.groupSize[2]); - EXPECT_EQ(NEO::GfxCoreHelper::get(device->getHwInfo().platform.eRenderCoreFamily).useOnlyGlobalTimestamps() ? 1u : 0u, commandList.cmdListHelper.useOnlyGlobalTimestamp); + auto &gfxCoreHelper = device->getGfxCoreHelper(); + EXPECT_EQ(gfxCoreHelper.useOnlyGlobalTimestamps() ? 1u : 0u, commandList.cmdListHelper.useOnlyGlobalTimestamp); EXPECT_EQ(1u, commandList.cmdListHelper.threadGroupDimensions.groupCountX); EXPECT_EQ(1u, commandList.cmdListHelper.threadGroupDimensions.groupCountY); @@ -160,7 +161,8 @@ HWTEST2_F(AppendQueryKernelTimestamps, givenCommandListWhenAppendQueryKernelTime EXPECT_EQ(1u, commandList.cmdListHelper.groupSize[1]); EXPECT_EQ(1u, commandList.cmdListHelper.groupSize[2]); - EXPECT_EQ(NEO::GfxCoreHelper::get(device->getHwInfo().platform.eRenderCoreFamily).useOnlyGlobalTimestamps() ? 1u : 0u, commandList.cmdListHelper.useOnlyGlobalTimestamp); + auto &gfxCoreHelper = device->getGfxCoreHelper(); + EXPECT_EQ(gfxCoreHelper.useOnlyGlobalTimestamps() ? 1u : 0u, commandList.cmdListHelper.useOnlyGlobalTimestamp); EXPECT_EQ(1u, commandList.cmdListHelper.threadGroupDimensions.groupCountX); EXPECT_EQ(1u, commandList.cmdListHelper.threadGroupDimensions.groupCountY); @@ -215,7 +217,8 @@ HWTEST2_F(AppendQueryKernelTimestamps, EXPECT_EQ(groupSizeY, commandList.cmdListHelper.groupSize[1]); EXPECT_EQ(groupSizeZ, commandList.cmdListHelper.groupSize[2]); - EXPECT_EQ(NEO::GfxCoreHelper::get(device->getHwInfo().platform.eRenderCoreFamily).useOnlyGlobalTimestamps() ? 1u : 0u, commandList.cmdListHelper.useOnlyGlobalTimestamp); + auto &gfxCoreHelper = device->getGfxCoreHelper(); + EXPECT_EQ(gfxCoreHelper.useOnlyGlobalTimestamps() ? 1u : 0u, commandList.cmdListHelper.useOnlyGlobalTimestamp); EXPECT_EQ(static_cast(eventCount) / groupSizeX, commandList.cmdListHelper.threadGroupDimensions.groupCountX); EXPECT_EQ(1u, commandList.cmdListHelper.threadGroupDimensions.groupCountY); @@ -269,7 +272,8 @@ HWTEST2_F(AppendQueryKernelTimestamps, EXPECT_EQ(groupSizeY, commandList.cmdListHelper.groupSize[1]); EXPECT_EQ(groupSizeZ, commandList.cmdListHelper.groupSize[2]); - EXPECT_EQ(NEO::GfxCoreHelper::get(device->getHwInfo().platform.eRenderCoreFamily).useOnlyGlobalTimestamps() ? 1u : 0u, commandList.cmdListHelper.useOnlyGlobalTimestamp); + auto &gfxCoreHelper = device->getGfxCoreHelper(); + EXPECT_EQ(gfxCoreHelper.useOnlyGlobalTimestamps() ? 1u : 0u, commandList.cmdListHelper.useOnlyGlobalTimestamp); EXPECT_EQ(static_cast(eventCount) / groupSizeX, commandList.cmdListHelper.threadGroupDimensions.groupCountX); EXPECT_EQ(1u, commandList.cmdListHelper.threadGroupDimensions.groupCountY); diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_2.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_2.cpp index a7382566a9..613bc11127 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_2.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -1359,7 +1359,7 @@ HWTEST2_F(CommandListAppendLaunchKernel, GivenDebugToggleSetWhenUpdateStreamProp DebugManagerStateRestore restorer; DebugManager.flags.ForceThreadArbitrationPolicyProgrammingWithScm.set(1); - auto &gfxCoreHelper = NEO::GfxCoreHelper::get(device->getHwInfo().platform.eRenderCoreFamily); + auto &gfxCoreHelper = device->getGfxCoreHelper(); auto defaultThreadArbitrationPolicy = gfxCoreHelper.getDefaultThreadArbitrationPolicy(); auto nonDefaultThreadArbitrationPolicy = defaultThreadArbitrationPolicy + 1; diff --git a/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_1.cpp b/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_1.cpp index 273beee66b..914d5cf72a 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_1.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -128,7 +128,8 @@ HWTEST_F(L0DebuggerPerContextAddressSpaceTest, givenDebuggingEnabledWhenCommandL EXPECT_EQ(0u, debugModeRegisterCount); EXPECT_EQ(0u, tdDebugControlRegisterCount); - if (!GfxCoreHelper::get(hwInfo.platform.eRenderCoreFamily).isSipWANeeded(hwInfo)) { + auto &gfxCoreHelper = device->getGfxCoreHelper(); + if (!gfxCoreHelper.isSipWANeeded(hwInfo)) { auto stateSipCmds = findAll(cmdList.begin(), cmdList.end()); ASSERT_EQ(1u, stateSipCmds.size()); diff --git a/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_2.cpp b/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_2.cpp index 8fd1a7a85c..d63120f3a4 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_2.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -537,7 +537,8 @@ HWTEST_P(L0DebuggerWithBlitterTest, givenDebuggingEnabledWhenCommandListIsExecut EXPECT_EQ(0u, tdDebugControlRegisterCount); EXPECT_EQ(0u, globalSipFound); - if (!GfxCoreHelper::get(hwInfo.platform.eRenderCoreFamily).isSipWANeeded(hwInfo)) { + auto &gfxCoreHelper = device->getGfxCoreHelper(); + if (!gfxCoreHelper.isSipWANeeded(hwInfo)) { auto stateSipCmds = findAll(cmdList.begin(), cmdList.end()); if (device->getDevicePreemptionMode() != PreemptionMode::MidThread) { 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 e8957b2285..36458d9c89 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -1005,8 +1005,7 @@ HWTEST2_F(DeviceTest, whenPassingRaytracingExpStructToGetPropertiesThenPropertie EXPECT_NE(37u, rayTracingProperties.maxBVHLevels); unsigned int expectedMaxBVHLevels = 0; - const auto &hardwareInfo = this->neoDevice->getHardwareInfo(); - auto &l0GfxCoreHelper = L0GfxCoreHelper::get(hardwareInfo.platform.eRenderCoreFamily); + auto &l0GfxCoreHelper = this->neoDevice->getRootDeviceEnvironment().getHelper(); if (l0GfxCoreHelper.platformSupportsRayTracing()) { expectedMaxBVHLevels = NEO::RayTracingHelper::maxBvhLevels; @@ -3946,7 +3945,8 @@ struct MultiSubDeviceFixture : public DeviceFixture { using MultiSubDeviceTest = Test>; TEST_F(MultiSubDeviceTest, GivenApiSupportAndLocalMemoryEnabledWhenDeviceContainsSubDevicesThenItIsImplicitScalingCapable) { - if (NEO::GfxCoreHelper::get(neoDevice->getHardwareInfo().platform.eRenderCoreFamily).platformSupportsImplicitScaling(neoDevice->getHardwareInfo())) { + auto &gfxCoreHelper = neoDevice->getGfxCoreHelper(); + if (gfxCoreHelper.platformSupportsImplicitScaling(neoDevice->getHardwareInfo())) { EXPECT_TRUE(device->isImplicitScalingCapable()); EXPECT_EQ(neoDevice, deviceImp->getActiveDevice()); } else { diff --git a/level_zero/core/test/unit_tests/sources/event/test_event.cpp b/level_zero/core/test/unit_tests/sources/event/test_event.cpp index c369b7c6ac..d14935c1cd 100644 --- a/level_zero/core/test/unit_tests/sources/event/test_event.cpp +++ b/level_zero/core/test/unit_tests/sources/event/test_event.cpp @@ -2642,7 +2642,7 @@ struct EventDynamicPacketUseFixture : public DeviceFixture { auto &hwInfo = device->getHwInfo(); auto &l0GfxCoreHelper = device->getNEODevice()->getRootDeviceEnvironment().getHelper(); - auto &gfxCoreHelper = NEO::GfxCoreHelper::get(hwInfo.platform.eRenderCoreFamily); + auto &gfxCoreHelper = device->getGfxCoreHelper(); ze_event_pool_desc_t eventPoolDesc = { ZE_STRUCTURE_TYPE_EVENT_POOL_DESC, diff --git a/level_zero/core/test/unit_tests/sources/image/test_image.cpp b/level_zero/core/test/unit_tests/sources/image/test_image.cpp index 5a1d1a43da..72351b0630 100644 --- a/level_zero/core/test/unit_tests/sources/image/test_image.cpp +++ b/level_zero/core/test/unit_tests/sources/image/test_image.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -470,7 +470,8 @@ HWTEST2_F(ImageCreate, givenImageDescWhenFailImageAllocationThenProperErrorIsRet desc.format.z = ZE_IMAGE_FORMAT_SWIZZLE_1; desc.format.w = ZE_IMAGE_FORMAT_SWIZZLE_X; - auto isHexadecimalArrayPreferred = NEO::GfxCoreHelper::get(NEO::defaultHwInfo->platform.eRenderCoreFamily).isSipKernelAsHexadecimalArrayPreferred(); + auto &gfxCoreHelper = neoDevice->getGfxCoreHelper(); + auto isHexadecimalArrayPreferred = gfxCoreHelper.isSipKernelAsHexadecimalArrayPreferred(); if (isHexadecimalArrayPreferred) { backupSipInitType = true; } diff --git a/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp b/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp index 92dd077975..05bc1ec688 100644 --- a/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp +++ b/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -82,7 +82,8 @@ TEST_F(KernelInitTest, givenKernelToInitWhenItHasTooBigPrivateSizeThenOutOfMemor TEST_F(KernelInitTest, givenKernelToInitWhenItHasTooBigScratchSizeThenInvalidBinaryIsRetutned) { auto globalSize = device->getNEODevice()->getRootDevice()->getGlobalMemorySize(static_cast(device->getNEODevice()->getDeviceBitfield().to_ulong())); uint32_t perHwThreadPrivateMemorySizeRequested = (static_cast((globalSize + device->getNEODevice()->getDeviceInfo().computeUnitsUsedForScratch) / device->getNEODevice()->getDeviceInfo().computeUnitsUsedForScratch)) / 2; - auto &gfxCoreHelper = NEO::GfxCoreHelper::get(device->getHwInfo().platform.eRenderCoreFamily); + + auto &gfxCoreHelper = device->getGfxCoreHelper(); uint32_t maxScratchSize = gfxCoreHelper.getMaxScratchSize(); std::unique_ptr mockKernelImmData = std::make_unique(perHwThreadPrivateMemorySizeRequested, maxScratchSize + 1, 0x100); @@ -1379,7 +1380,7 @@ TEST_F(KernelPropertiesTests, whenPassingPreferredGroupSizeStructToGetProperties ze_result_t res = kernel->getProperties(&kernelProperties); EXPECT_EQ(ZE_RESULT_SUCCESS, res); - auto &gfxCoreHelper = NEO::GfxCoreHelper::get(module->getDevice()->getHwInfo().platform.eRenderCoreFamily); + auto &gfxCoreHelper = module->getDevice()->getGfxCoreHelper(); if (gfxCoreHelper.isFusedEuDispatchEnabled(module->getDevice()->getHwInfo(), false)) { EXPECT_EQ(preferredGroupProperties.preferredMultiple, static_cast(kernel->getImmutableData()->getKernelInfo()->getMaxSimdSize()) * 2); } else { @@ -1855,7 +1856,7 @@ TEST_F(KernelImpPatchBindlessTest, GivenKernelImpWhenPatchBindlessOffsetCalledTh kernel.module = &mockModule; NEO::MockGraphicsAllocation alloc; uint32_t bindless = 0x40; - auto &gfxCoreHelper = NEO::GfxCoreHelper::get(device->getHwInfo().platform.eRenderCoreFamily); + auto &gfxCoreHelper = device->getGfxCoreHelper(); size_t size = gfxCoreHelper.getRenderSurfaceStateSize(); auto expectedSsInHeap = device->getNEODevice()->getBindlessHeapsHelper()->allocateSSInHeap(size, &alloc, NEO::BindlessHeapsHelper::GLOBAL_SSH); auto patchLocation = ptrOffset(kernel.getCrossThreadData(), bindless); @@ -1887,7 +1888,7 @@ HWTEST2_F(KernelImpPatchBindlessTest, GivenKernelImpWhenSetSurfaceStateBindlessT neoDevice->getRootDeviceIndex(), neoDevice->getDeviceBitfield()); - auto &gfxCoreHelper = NEO::GfxCoreHelper::get(device->getHwInfo().platform.eRenderCoreFamily); + auto &gfxCoreHelper = device->getGfxCoreHelper(); size_t size = gfxCoreHelper.getRenderSurfaceStateSize(); uint64_t gpuAddress = 0x2000; void *buffer = reinterpret_cast(gpuAddress); @@ -1922,7 +1923,7 @@ HWTEST2_F(KernelImpPatchBindlessTest, GivenKernelImpWhenSetSurfaceStateBindfulTh neoDevice->getRootDeviceIndex(), neoDevice->getDeviceBitfield()); - auto &gfxCoreHelper = NEO::GfxCoreHelper::get(device->getHwInfo().platform.eRenderCoreFamily); + auto &gfxCoreHelper = device->getGfxCoreHelper(); size_t size = gfxCoreHelper.getRenderSurfaceStateSize(); uint64_t gpuAddress = 0x2000; void *buffer = reinterpret_cast(gpuAddress); @@ -1958,7 +1959,7 @@ HWTEST2_F(KernelImpL3CachingTests, GivenKernelImpWhenSetSurfaceStateWithUnaligne neoDevice->getNumGenericSubDevices() > 1, neoDevice->getRootDeviceIndex(), neoDevice->getDeviceBitfield()); - auto &gfxCoreHelper = NEO::GfxCoreHelper::get(device->getHwInfo().platform.eRenderCoreFamily); + auto &gfxCoreHelper = device->getGfxCoreHelper(); size_t size = gfxCoreHelper.getRenderSurfaceStateSize(); uint64_t gpuAddress = 0x2000; void *buffer = reinterpret_cast(0x20123); @@ -2284,7 +2285,7 @@ HWTEST2_F(SetKernelArg, givenImageAndBindlessKernelWhenSetArgImageThenCopySurfac imageArg.bindful = undefined; ze_image_desc_t desc = {}; desc.stype = ZE_STRUCTURE_TYPE_IMAGE_DESC; - auto &gfxCoreHelper = NEO::GfxCoreHelper::get(neoDevice->getHardwareInfo().platform.eRenderCoreFamily); + auto &gfxCoreHelper = neoDevice->getGfxCoreHelper(); auto surfaceStateSize = gfxCoreHelper.getRenderSurfaceStateSize(); auto imageHW = std::make_unique>(); 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 7add2050b4..62c247cc54 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -974,7 +974,8 @@ HWTEST2_F(CreateCommandListXeHpcTest, givenXeHpcPlatformsWhenImmediateCommandLis auto &hwInfo = device->getHwInfo(); auto &defaultEngine = neoDevice->getDefaultEngine(); - auto engineGroupType = NEO::GfxCoreHelper::get(hwInfo.platform.eRenderCoreFamily).getEngineGroupType(defaultEngine.getEngineType(), defaultEngine.getEngineUsage(), hwInfo); + auto &gfxCoreHelper = neoDevice->getGfxCoreHelper(); + auto engineGroupType = gfxCoreHelper.getEngineGroupType(defaultEngine.getEngineType(), defaultEngine.getEngineUsage(), hwInfo); ze_command_queue_desc_t queueDesc{}; queueDesc.ordinal = 0u; diff --git a/level_zero/tools/source/debug/debug_session_imp.cpp b/level_zero/tools/source/debug/debug_session_imp.cpp index 38a98d3950..2597f6f756 100644 --- a/level_zero/tools/source/debug/debug_session_imp.cpp +++ b/level_zero/tools/source/debug/debug_session_imp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -1019,7 +1019,7 @@ ze_result_t DebugSessionImp::readSbaRegisters(EuThread::ThreadId threadId, uint3 uint64_t bindingTableBaseAddress = ((r0[4] >> 5) << 5) + sbaBuffer.SurfaceStateBaseAddress; uint64_t scratchSpaceBaseAddress = 0; - auto &gfxCoreHelper = NEO::GfxCoreHelper::get(connectedDevice->getNEODevice()->getHardwareInfo().platform.eRenderCoreFamily); + auto &gfxCoreHelper = connectedDevice->getGfxCoreHelper(); if (gfxCoreHelper.isScratchSpaceSurfaceStateAccessible()) { auto surfaceStateForScratch = ((r0[5] >> 10) << 6);