From a69f393356a98047ea8436aff48c196f2ce0ff91 Mon Sep 17 00:00:00 2001 From: "Jobczyk, Lukasz" Date: Tue, 18 Feb 2020 13:29:30 +0100 Subject: [PATCH] Use hwInfo from root device environment [2/N] Related-To: NEO-3857 Change-Id: Iad6832f36ae8b0ea218acb6b38fe6ba46599b9d9 Signed-off-by: Jobczyk, Lukasz --- core/memory_manager/memory_manager.cpp | 10 ++--- core/memory_manager/memory_manager.h | 6 +-- .../os_interface/linux/drm_memory_manager.cpp | 2 +- .../command_stream_receiver.cpp | 2 +- .../create_command_stream_impl.cpp | 3 +- .../experimental_command_buffer.inl | 5 ++- .../tbx_command_stream_receiver.cpp | 3 +- .../tbx_command_stream_receiver_hw.inl | 2 +- .../os_agnostic_memory_manager.cpp | 2 +- runtime/platform/platform.cpp | 4 +- runtime/sharings/d3d/d3d_texture.cpp | 5 ++- .../gl/windows/gl_texture_windows.cpp | 9 +++-- runtime/sharings/unified/unified_image.cpp | 2 +- unit_tests/api/cl_svm_alloc_tests.inl | 2 +- .../mem_obj/create_image_aub_tests.cpp | 2 +- .../command_queue/dispatch_walker_tests.cpp | 4 +- .../multiple_map_image_tests.cpp | 2 +- .../aub_command_stream_receiver_2_tests.cpp | 2 +- .../command_stream_receiver_tests.cpp | 10 ++--- .../tbx_command_stream_tests.cpp | 8 ++-- .../driver_diagnostics_enqueue_tests.cpp | 2 +- unit_tests/d3d_sharing/d3d_aux_tests.cpp | 40 +++++++++---------- unit_tests/gmm_helper/gmm_helper_tests.cpp | 2 +- unit_tests/helpers/timestamp_packet_tests.cpp | 4 +- unit_tests/libult/create_command_stream.cpp | 3 +- .../memory_manager/memory_manager_tests.cpp | 20 +++++----- .../unified_memory_manager_tests.cpp | 6 +-- unit_tests/program/program_tests.cpp | 2 +- .../sharings/gl/windows/gl_texture_tests.cpp | 6 +-- 29 files changed, 88 insertions(+), 82 deletions(-) diff --git a/core/memory_manager/memory_manager.cpp b/core/memory_manager/memory_manager.cpp index 10f37ddf7e..04f627c33d 100644 --- a/core/memory_manager/memory_manager.cpp +++ b/core/memory_manager/memory_manager.cpp @@ -36,12 +36,13 @@ uint32_t MemoryManager::maxOsContextCount = 0u; MemoryManager::MemoryManager(ExecutionEnvironment &executionEnvironment) : executionEnvironment(executionEnvironment), hostPtrManager(std::make_unique()), multiContextResourceDestructor(std::make_unique()) { - auto hwInfo = executionEnvironment.getHardwareInfo(); + localMemoryUsageBankSelector.reset(new LocalMemoryUsageBankSelector(getBanksCount())); bool anyLocalMemorySupported = false; for (uint32_t rootDeviceIndex = 0; rootDeviceIndex < executionEnvironment.rootDeviceEnvironments.size(); ++rootDeviceIndex) { + auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); this->localMemorySupported.push_back(HwHelper::get(hwInfo->platform.eRenderCoreFamily).getEnableLocalMemory(*hwInfo)); this->enable64kbpages.push_back(OSInterface::osEnabled64kbPages && hwInfo->capabilityTable.ftr64KBpages); if (DebugManager.flags.Enable64kbpages.get() > -1) { @@ -358,7 +359,7 @@ GraphicsAllocation *MemoryManager::allocateGraphicsMemory(const AllocationData & if (allocationData.flags.shareable) { return allocateShareableMemory(allocationData); } - if (useNonSvmHostPtrAlloc(allocationData.type)) { + if (useNonSvmHostPtrAlloc(allocationData.type, allocationData.rootDeviceIndex)) { auto allocation = allocateGraphicsMemoryForNonSvmHostPtr(allocationData); if (allocation) { allocation->setFlushL3Required(allocationData.flags.flushL3); @@ -503,12 +504,11 @@ void *MemoryManager::getReservedMemory(size_t size, size_t alignment) { return reservedMemory; } -bool MemoryManager::isHostPointerTrackingEnabled() { - +bool MemoryManager::isHostPointerTrackingEnabled(uint32_t rootDeviceIndex) { if (DebugManager.flags.EnableHostPtrTracking.get() != -1) { return !!DebugManager.flags.EnableHostPtrTracking.get(); } - return (peekExecutionEnvironment().getHardwareInfo()->capabilityTable.hostPtrTrackingEnabled | is32bit); + return (peekExecutionEnvironment().rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo()->capabilityTable.hostPtrTrackingEnabled | is32bit); } bool MemoryManager::isCopyRequired(ImageInfo &imgInfo, const void *hostPtr) { diff --git a/core/memory_manager/memory_manager.h b/core/memory_manager/memory_manager.h index 692d47a594..fbc6761251 100644 --- a/core/memory_manager/memory_manager.h +++ b/core/memory_manager/memory_manager.h @@ -138,7 +138,7 @@ class MemoryManager { ::alignedFree(ptr); } - MOCKABLE_VIRTUAL bool isHostPointerTrackingEnabled(); + MOCKABLE_VIRTUAL bool isHostPointerTrackingEnabled(uint32_t rootDeviceIndex); void setForceNonSvmForExternalHostPtr(bool mode) { forceNonSvmForExternalHostPtr = mode; @@ -203,7 +203,7 @@ class MemoryManager { } static bool isCopyRequired(ImageInfo &imgInfo, const void *hostPtr); - bool useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType allocationType) { + bool useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType allocationType, uint32_t rootDeviceIndex) { bool isExternalHostPtrAlloc = (allocationType == GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR); bool isMapAlloc = (allocationType == GraphicsAllocation::AllocationType::MAP_ALLOCATION); @@ -211,7 +211,7 @@ class MemoryManager { return true; } - bool isNonSvmPtrCapable = ((!peekExecutionEnvironment().isFullRangeSvm() || !isHostPointerTrackingEnabled()) & !is32bit); + bool isNonSvmPtrCapable = ((!peekExecutionEnvironment().isFullRangeSvm() || !isHostPointerTrackingEnabled(rootDeviceIndex)) & !is32bit); return isNonSvmPtrCapable && (isExternalHostPtrAlloc || isMapAlloc); } diff --git a/core/os_interface/linux/drm_memory_manager.cpp b/core/os_interface/linux/drm_memory_manager.cpp index 9c253629fc..1024e42f2f 100644 --- a/core/os_interface/linux/drm_memory_manager.cpp +++ b/core/os_interface/linux/drm_memory_manager.cpp @@ -35,8 +35,8 @@ DrmMemoryManager::DrmMemoryManager(gemCloseWorkerMode mode, ExecutionEnvironment &executionEnvironment) : MemoryManager(executionEnvironment), forcePinEnabled(forcePinAllowed), validateHostPtrMemory(validateHostPtrMemory) { - auto gpuAddressSpace = executionEnvironment.getHardwareInfo()->capabilityTable.gpuAddressSpace; for (uint32_t rootDeviceIndex = 0; rootDeviceIndex < gfxPartitions.size(); ++rootDeviceIndex) { + auto gpuAddressSpace = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo()->capabilityTable.gpuAddressSpace; getGfxPartition(rootDeviceIndex)->init(gpuAddressSpace, getSizeToReserve(), rootDeviceIndex, gfxPartitions.size()); } MemoryManager::virtualPaddingAvailable = true; diff --git a/runtime/command_stream/command_stream_receiver.cpp b/runtime/command_stream/command_stream_receiver.cpp index 6d19e0ecfb..74b99e872f 100644 --- a/runtime/command_stream/command_stream_receiver.cpp +++ b/runtime/command_stream/command_stream_receiver.cpp @@ -395,7 +395,7 @@ bool CommandStreamReceiver::initializeTagAllocation() { } bool CommandStreamReceiver::createGlobalFenceAllocation() { - auto hwInfo = executionEnvironment.getHardwareInfo(); + auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); if (!HwHelper::get(hwInfo->platform.eRenderCoreFamily).isFenceAllocationRequired(*hwInfo)) { return true; } diff --git a/runtime/command_stream/create_command_stream_impl.cpp b/runtime/command_stream/create_command_stream_impl.cpp index 91681ca367..90afb70e87 100644 --- a/runtime/command_stream/create_command_stream_impl.cpp +++ b/runtime/command_stream/create_command_stream_impl.cpp @@ -6,6 +6,7 @@ */ #include "core/execution_environment/execution_environment.h" +#include "core/execution_environment/root_device_environment.h" #include "core/os_interface/device_factory.h" #include "runtime/command_stream/aub_command_stream_receiver.h" #include "runtime/command_stream/command_stream_receiver_with_aub_dump.h" @@ -16,7 +17,7 @@ namespace NEO { extern CommandStreamReceiverCreateFunc commandStreamReceiverFactory[IGFX_MAX_CORE]; CommandStreamReceiver *createCommandStreamImpl(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) { - auto funcCreate = commandStreamReceiverFactory[executionEnvironment.getHardwareInfo()->platform.eRenderCoreFamily]; + auto funcCreate = commandStreamReceiverFactory[executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo()->platform.eRenderCoreFamily]; if (funcCreate == nullptr) { return nullptr; } diff --git a/runtime/command_stream/experimental_command_buffer.inl b/runtime/command_stream/experimental_command_buffer.inl index 187fb4cb54..f5135cefe0 100644 --- a/runtime/command_stream/experimental_command_buffer.inl +++ b/runtime/command_stream/experimental_command_buffer.inl @@ -6,6 +6,7 @@ */ #include "core/command_stream/linear_stream.h" +#include "core/execution_environment/root_device_environment.h" #include "core/helpers/hw_helper.h" #include "core/memory_manager/graphics_allocation.h" #include "runtime/command_stream/command_stream_receiver_hw.h" @@ -64,7 +65,7 @@ size_t ExperimentalCommandBuffer::getTimeStampPipeControlSize() noexcept { // Two P_C for timestamps return 2 * MemorySynchronizationCommands::getSizeForPipeControlWithPostSyncOperation( - *commandStreamReceiver->peekExecutionEnvironment().getHardwareInfo()); + *commandStreamReceiver->peekExecutionEnvironment().rootDeviceEnvironments[commandStreamReceiver->getRootDeviceIndex()]->getHardwareInfo()); } template @@ -75,7 +76,7 @@ void ExperimentalCommandBuffer::addTimeStampPipeControl() { MemorySynchronizationCommands::obtainPipeControlAndProgramPostSyncOperation( *currentStream, PIPE_CONTROL::POST_SYNC_OPERATION_WRITE_TIMESTAMP, timeStampAddress, 0llu, - false, *commandStreamReceiver->peekExecutionEnvironment().getHardwareInfo()); + false, *commandStreamReceiver->peekExecutionEnvironment().rootDeviceEnvironments[commandStreamReceiver->getRootDeviceIndex()]->getHardwareInfo()); //moving to next chunk timestampsOffset += sizeof(uint64_t); diff --git a/runtime/command_stream/tbx_command_stream_receiver.cpp b/runtime/command_stream/tbx_command_stream_receiver.cpp index 9485dc6636..a1dd558a85 100644 --- a/runtime/command_stream/tbx_command_stream_receiver.cpp +++ b/runtime/command_stream/tbx_command_stream_receiver.cpp @@ -8,6 +8,7 @@ #include "runtime/command_stream/tbx_command_stream_receiver.h" #include "core/execution_environment/execution_environment.h" +#include "core/execution_environment/root_device_environment.h" #include "core/helpers/hw_info.h" #include @@ -17,7 +18,7 @@ namespace NEO { TbxCommandStreamReceiverCreateFunc tbxCommandStreamReceiverFactory[IGFX_MAX_CORE] = {}; CommandStreamReceiver *TbxCommandStreamReceiver::create(const std::string &baseName, bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) { - auto hwInfo = executionEnvironment.getHardwareInfo(); + auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); if (hwInfo->platform.eRenderCoreFamily >= IGFX_MAX_CORE) { DEBUG_BREAK_IF(!false); diff --git a/runtime/command_stream/tbx_command_stream_receiver_hw.inl b/runtime/command_stream/tbx_command_stream_receiver_hw.inl index da743ec17a..e667767d3d 100644 --- a/runtime/command_stream/tbx_command_stream_receiver_hw.inl +++ b/runtime/command_stream/tbx_command_stream_receiver_hw.inl @@ -149,7 +149,7 @@ template CommandStreamReceiver *TbxCommandStreamReceiverHw::create(const std::string &baseName, bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) { TbxCommandStreamReceiverHw *csr; if (withAubDump) { - auto hwInfo = executionEnvironment.getHardwareInfo(); + auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily); auto localMemoryEnabled = hwHelper.getEnableLocalMemory(*hwInfo); auto fullName = AUBCommandStreamReceiver::createFullFilePath(*hwInfo, baseName); diff --git a/runtime/memory_manager/os_agnostic_memory_manager.cpp b/runtime/memory_manager/os_agnostic_memory_manager.cpp index 994fc53081..671e5cfd04 100644 --- a/runtime/memory_manager/os_agnostic_memory_manager.cpp +++ b/runtime/memory_manager/os_agnostic_memory_manager.cpp @@ -27,12 +27,12 @@ namespace NEO { OsAgnosticMemoryManager::OsAgnosticMemoryManager(bool aubUsage, ExecutionEnvironment &executionEnvironment) : MemoryManager(executionEnvironment) { - auto gpuAddressSpace = executionEnvironment.getHardwareInfo()->capabilityTable.gpuAddressSpace; // 4 x sizeof(Heap32) + 2 x sizeof(Standard/Standard64k) size_t reservedCpuAddressRangeSize = is64bit ? (4 * 4 + 2 * (aubUsage ? 32 : 4)) * GB : 0; for (uint32_t rootDeviceIndex = 0; rootDeviceIndex < gfxPartitions.size(); ++rootDeviceIndex) { + auto gpuAddressSpace = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo()->capabilityTable.gpuAddressSpace; getGfxPartition(rootDeviceIndex)->init(gpuAddressSpace, reservedCpuAddressRangeSize, rootDeviceIndex, gfxPartitions.size()); } } diff --git a/runtime/platform/platform.cpp b/runtime/platform/platform.cpp index fce524add5..2891b41bf2 100644 --- a/runtime/platform/platform.cpp +++ b/runtime/platform/platform.cpp @@ -163,11 +163,11 @@ bool Platform::initialize(std::vector> devices) { } } - auto hwInfo = executionEnvironment.getHardwareInfo(); + auto hwInfo = clDevices[0]->getHardwareInfo(); const bool debuggerActive = executionEnvironment.debugger && executionEnvironment.debugger->isDebuggerActive(); if (clDevices[0]->getPreemptionMode() == PreemptionMode::MidThread || debuggerActive) { - auto sipType = SipKernel::getSipKernelType(hwInfo->platform.eRenderCoreFamily, clDevices[0]->isDebuggerActive()); + auto sipType = SipKernel::getSipKernelType(hwInfo.platform.eRenderCoreFamily, clDevices[0]->isDebuggerActive()); initSipKernel(sipType, clDevices[0]->getDevice()); } diff --git a/runtime/sharings/d3d/d3d_texture.cpp b/runtime/sharings/d3d/d3d_texture.cpp index 3cdf445c81..e246a7f420 100644 --- a/runtime/sharings/d3d/d3d_texture.cpp +++ b/runtime/sharings/d3d/d3d_texture.cpp @@ -7,6 +7,7 @@ #include "runtime/sharings/d3d/d3d_texture.h" +#include "core/execution_environment/root_device_environment.h" #include "core/gmm_helper/gmm.h" #include "core/gmm_helper/gmm_types_converter.h" #include "core/gmm_helper/resource_info.h" @@ -88,7 +89,7 @@ Image *D3DTexture::create2d(Context *context, D3DTexture2d *d3dTexture, cl_ imgInfo.surfaceFormat = &clSurfaceFormat->surfaceFormat; } - auto hwInfo = memoryManager->peekExecutionEnvironment().getHardwareInfo(); + auto hwInfo = memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily); if (alloc->getDefaultGmm()->unifiedAuxTranslationCapable()) { alloc->getDefaultGmm()->isRenderCompressed = hwHelper.isPageTableManagerSupported(*hwInfo) ? memoryManager->mapAuxGpuVA(alloc) @@ -148,7 +149,7 @@ Image *D3DTexture::create3d(Context *context, D3DTexture3d *d3dTexture, cl_ imgInfo.surfaceFormat = &clSurfaceFormat->surfaceFormat; - auto hwInfo = memoryManager->peekExecutionEnvironment().getHardwareInfo(); + auto hwInfo = memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily); if (alloc->getDefaultGmm()->unifiedAuxTranslationCapable()) { alloc->getDefaultGmm()->isRenderCompressed = hwHelper.isPageTableManagerSupported(*hwInfo) ? memoryManager->mapAuxGpuVA(alloc) diff --git a/runtime/sharings/gl/windows/gl_texture_windows.cpp b/runtime/sharings/gl/windows/gl_texture_windows.cpp index b581634d9c..0c5cdd73a2 100644 --- a/runtime/sharings/gl/windows/gl_texture_windows.cpp +++ b/runtime/sharings/gl/windows/gl_texture_windows.cpp @@ -5,6 +5,7 @@ * */ +#include "core/execution_environment/root_device_environment.h" #include "core/gmm_helper/gmm.h" #include "core/gmm_helper/gmm_helper.h" #include "core/gmm_helper/gmm_types_converter.h" @@ -139,11 +140,11 @@ Image *GlTexture::createSharedGlTexture(Context *context, cl_mem_flags flags, cl auto glTexture = new GlTexture(sharingFunctions, getClGlObjectType(target), texture, texInfo, target, std::max(miplevel, 0)); - auto hwInfo = memoryManager->peekExecutionEnvironment().getHardwareInfo(); - auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily); + auto hwInfo = context->getDevice(0)->getHardwareInfo(); + auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); if (alloc->getDefaultGmm()->unifiedAuxTranslationCapable()) { - alloc->getDefaultGmm()->isRenderCompressed = hwHelper.isPageTableManagerSupported(*hwInfo) ? memoryManager->mapAuxGpuVA(alloc) - : true; + alloc->getDefaultGmm()->isRenderCompressed = hwHelper.isPageTableManagerSupported(hwInfo) ? memoryManager->mapAuxGpuVA(alloc) + : true; } return Image::createSharedImage(context, glTexture, mcsSurfaceInfo, alloc, mcsAlloc, flags, &surfaceFormatInfo, imgInfo, cubeFaceIndex, diff --git a/runtime/sharings/unified/unified_image.cpp b/runtime/sharings/unified/unified_image.cpp index 8f03562603..4d34e65482 100644 --- a/runtime/sharings/unified/unified_image.cpp +++ b/runtime/sharings/unified/unified_image.cpp @@ -40,7 +40,7 @@ Image *UnifiedImage::createSharedUnifiedImage(Context *context, cl_mem_flags fla auto &memoryManager = *context->getMemoryManager(); if (graphicsAllocation->getDefaultGmm()->unifiedAuxTranslationCapable()) { - const auto &hwInfo = *memoryManager.peekExecutionEnvironment().getHardwareInfo(); + const auto &hwInfo = context->getDevice(0)->getHardwareInfo(); const auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); graphicsAllocation->getDefaultGmm()->isRenderCompressed = hwHelper.isPageTableManagerSupported(hwInfo) ? memoryManager.mapAuxGpuVA(graphicsAllocation) : true; } diff --git a/unit_tests/api/cl_svm_alloc_tests.inl b/unit_tests/api/cl_svm_alloc_tests.inl index bd46b44d66..c6c47cbdad 100644 --- a/unit_tests/api/cl_svm_alloc_tests.inl +++ b/unit_tests/api/cl_svm_alloc_tests.inl @@ -22,7 +22,7 @@ class clSVMAllocTemplateTests : public ApiFixture<>, public: void SetUp() override { ApiFixture::SetUp(); - if (!pPlatform->peekExecutionEnvironment()->getHardwareInfo()->capabilityTable.ftrSvm) { + if (!pPlatform->getClDevice(testedRootDeviceIndex)->getHardwareInfo().capabilityTable.ftrSvm) { GTEST_SKIP(); } } diff --git a/unit_tests/aub_tests/mem_obj/create_image_aub_tests.cpp b/unit_tests/aub_tests/mem_obj/create_image_aub_tests.cpp index a98157173b..8314f03340 100644 --- a/unit_tests/aub_tests/mem_obj/create_image_aub_tests.cpp +++ b/unit_tests/aub_tests/mem_obj/create_image_aub_tests.cpp @@ -88,7 +88,7 @@ INSTANTIATE_TEST_CASE_P( testing::ValuesIn(ImgArrayTypes)); HWTEST_P(AUBCreateImageArray, CheckArrayImages) { - auto &hwHelper = HwHelper::get(pDevice->getExecutionEnvironment()->getHardwareInfo()->platform.eRenderCoreFamily); + auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); imageDesc.image_type = GetParam(); if (imageDesc.image_type == CL_MEM_OBJECT_IMAGE1D_ARRAY) { imageDesc.image_height = 1; diff --git a/unit_tests/command_queue/dispatch_walker_tests.cpp b/unit_tests/command_queue/dispatch_walker_tests.cpp index 81ec9d7bc9..7b23dfd3f2 100644 --- a/unit_tests/command_queue/dispatch_walker_tests.cpp +++ b/unit_tests/command_queue/dispatch_walker_tests.cpp @@ -1290,7 +1290,7 @@ HWTEST_F(DispatchWalkerTest, givenKernelWhenAuxToNonAuxWhenTranslationRequiredTh EXPECT_TRUE(beginPipeControl->getCommandStreamerStallEnable()); auto endPipeControl = genCmdCast(*(pipeControls[1])); - bool dcFlushRequired = (executionEnvironment->getHardwareInfo()->platform.eRenderCoreFamily == IGFX_GEN8_CORE); + bool dcFlushRequired = (pClDevice->getHardwareInfo().platform.eRenderCoreFamily == IGFX_GEN8_CORE); EXPECT_EQ(dcFlushRequired, endPipeControl->getDcFlushEnable()); EXPECT_TRUE(endPipeControl->getCommandStreamerStallEnable()); } @@ -1341,7 +1341,7 @@ HWTEST_F(DispatchWalkerTest, givenKernelWhenNonAuxToAuxWhenTranslationRequiredTh ASSERT_EQ(2u, pipeControls.size()); - bool dcFlushRequired = (executionEnvironment->getHardwareInfo()->platform.eRenderCoreFamily == IGFX_GEN8_CORE); + bool dcFlushRequired = (pClDevice->getHardwareInfo().platform.eRenderCoreFamily == IGFX_GEN8_CORE); auto beginPipeControl = genCmdCast(*(pipeControls[0])); EXPECT_TRUE(beginPipeControl->getDcFlushEnable()); diff --git a/unit_tests/command_queue/multiple_map_image_tests.cpp b/unit_tests/command_queue/multiple_map_image_tests.cpp index fb950a6154..115c569453 100644 --- a/unit_tests/command_queue/multiple_map_image_tests.cpp +++ b/unit_tests/command_queue/multiple_map_image_tests.cpp @@ -106,7 +106,7 @@ struct MultipleMapImageTest : public DeviceFixture, public ::testing::Test { template std::unique_ptr> createMockImage() { - auto eRenderCoreFamily = pDevice->getExecutionEnvironment()->getHardwareInfo()->platform.eRenderCoreFamily; + auto eRenderCoreFamily = pDevice->getHardwareInfo().platform.eRenderCoreFamily; VariableBackup backup(&imageFactory[eRenderCoreFamily].createImageFunction); imageFactory[eRenderCoreFamily].createImageFunction = MockImage::createMockImage; diff --git a/unit_tests/command_stream/aub_command_stream_receiver_2_tests.cpp b/unit_tests/command_stream/aub_command_stream_receiver_2_tests.cpp index 74d8223f5d..5d1c208e44 100644 --- a/unit_tests/command_stream/aub_command_stream_receiver_2_tests.cpp +++ b/unit_tests/command_stream/aub_command_stream_receiver_2_tests.cpp @@ -504,7 +504,7 @@ HWTEST_F(AubCommandStreamReceiverNoHostPtrTests, givenAubCommandStreamReceiverWh HWTEST_F(AubCommandStreamReceiverTests, givenNoDbgDeviceIdFlagWhenAubCsrIsCreatedThenUseDefaultDeviceId) { std::unique_ptr> aubCsr(new MockAubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex())); - EXPECT_EQ(pDevice->executionEnvironment->getHardwareInfo()->capabilityTable.aubDeviceId, aubCsr->aubDeviceId); + EXPECT_EQ(pDevice->getHardwareInfo().capabilityTable.aubDeviceId, aubCsr->aubDeviceId); } HWTEST_F(AubCommandStreamReceiverTests, givenDbgDeviceIdFlagIsSetWhenAubCsrIsCreatedThenUseDebugDeviceId) { diff --git a/unit_tests/command_stream/command_stream_receiver_tests.cpp b/unit_tests/command_stream/command_stream_receiver_tests.cpp index de9f7046dc..14190593c8 100644 --- a/unit_tests/command_stream/command_stream_receiver_tests.cpp +++ b/unit_tests/command_stream/command_stream_receiver_tests.cpp @@ -497,7 +497,7 @@ TEST_F(CreateAllocationForHostSurfaceTest, givenReadOnlyHostPointerWhenAllocatio size_t size = sizeof(memory); HostPtrSurface surface(const_cast(memory), size, true); - if (!gmockMemoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR)) { + if (!gmockMemoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, device->getRootDeviceIndex())) { EXPECT_CALL(*gmockMemoryManager, populateOsHandles(::testing::_, device->getRootDeviceIndex())) .Times(1) .WillOnce(::testing::Return(MemoryManager::AllocationStatus::InvalidHostPointer)); @@ -524,7 +524,7 @@ TEST_F(CreateAllocationForHostSurfaceTest, givenReadOnlyHostPointerWhenAllocatio size_t size = sizeof(memory); HostPtrSurface surface(const_cast(memory), size, false); - if (!gmockMemoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR)) { + if (!gmockMemoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, device->getRootDeviceIndex())) { EXPECT_CALL(*gmockMemoryManager, populateOsHandles(::testing::_, device->getRootDeviceIndex())) .Times(1) .WillOnce(::testing::Return(MemoryManager::AllocationStatus::InvalidHostPointer)); @@ -796,7 +796,7 @@ TEST_F(CommandStreamReceiverPageTableManagerTest, givenNonDefaultEngineTypeWhenN MockExecutionEnvironment executionEnvironment; executionEnvironment.initializeMemoryManager(); MockCommandStreamReceiver commandStreamReceiver(executionEnvironment, 0u); - auto hwInfo = executionEnvironment.getHardwareInfo(); + auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo(); auto defaultEngineType = getChosenEngineType(*hwInfo); auto engineType = aub_stream::EngineType::ENGINE_BCS; EXPECT_NE(defaultEngineType, engineType); @@ -808,7 +808,7 @@ TEST_F(CommandStreamReceiverPageTableManagerTest, givenDefaultEngineTypeAndExist MockExecutionEnvironment executionEnvironment; executionEnvironment.initializeMemoryManager(); MockCommandStreamReceiver commandStreamReceiver(executionEnvironment, 0u); - auto hwInfo = executionEnvironment.getHardwareInfo(); + auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo(); auto defaultEngineType = getChosenEngineType(*hwInfo); GmmPageTableMngr *dummyPageTableManager = reinterpret_cast(0x1234); @@ -822,7 +822,7 @@ TEST_F(CommandStreamReceiverPageTableManagerTest, givenDefaultEngineTypeAndNonEx MockExecutionEnvironment executionEnvironment; executionEnvironment.initializeMemoryManager(); MockCommandStreamReceiver commandStreamReceiver(executionEnvironment, 0u); - auto hwInfo = executionEnvironment.getHardwareInfo(); + auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo(); auto defaultEngineType = getChosenEngineType(*hwInfo); bool supportsPageTableManager = HwHelper::get(hwInfo->platform.eRenderCoreFamily).isPageTableManagerSupported(*hwInfo); EXPECT_EQ(nullptr, executionEnvironment.rootDeviceEnvironments[0]->pageTableManager.get()); diff --git a/unit_tests/command_stream/tbx_command_stream_tests.cpp b/unit_tests/command_stream/tbx_command_stream_tests.cpp index 54473b0261..b23647a7c0 100644 --- a/unit_tests/command_stream/tbx_command_stream_tests.cpp +++ b/unit_tests/command_stream/tbx_command_stream_tests.cpp @@ -138,7 +138,7 @@ HWTEST_F(TbxCommandStreamTests, DISABLED_getCsTraits) { TEST(TbxCommandStreamReceiverTest, givenNullFactoryEntryWhenTbxCsrIsCreatedThenNullptrIsReturned) { ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment(); - GFXCORE_FAMILY family = executionEnvironment->getHardwareInfo()->platform.eRenderCoreFamily; + GFXCORE_FAMILY family = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->platform.eRenderCoreFamily; VariableBackup tbxCsrFactoryBackup(&tbxCommandStreamReceiverFactory[family]); tbxCommandStreamReceiverFactory[family] = nullptr; @@ -552,12 +552,12 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenHardwareContextIsCreatedThenTbxSt } HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenOsContextIsSetThenCreateHardwareContext) { - auto hwInfo = pDevice->executionEnvironment->getHardwareInfo(); - MockOsContext osContext(0, 1, HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances()[0], + auto hwInfo = pDevice->getHardwareInfo(); + MockOsContext osContext(0, 1, HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances()[0], PreemptionMode::Disabled, false); std::string fileName = ""; MockAubManager *mockManager = new MockAubManager(); - MockAubCenter *mockAubCenter = new MockAubCenter(hwInfo, false, fileName, CommandStreamReceiverType::CSR_TBX); + MockAubCenter *mockAubCenter = new MockAubCenter(&hwInfo, false, fileName, CommandStreamReceiverType::CSR_TBX); mockAubCenter->aubManager = std::unique_ptr(mockManager); pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); diff --git a/unit_tests/context/driver_diagnostics_enqueue_tests.cpp b/unit_tests/context/driver_diagnostics_enqueue_tests.cpp index c083cc7108..995a6a8ad1 100644 --- a/unit_tests/context/driver_diagnostics_enqueue_tests.cpp +++ b/unit_tests/context/driver_diagnostics_enqueue_tests.cpp @@ -661,7 +661,7 @@ TEST_P(PerformanceHintEnqueueMapTest, GivenZeroCopyFlagWhenEnqueueUnmapIsCalling } TEST_F(PerformanceHintEnqueueTest, GivenSVMPointerWhenEnqueueSVMMapIsCallingThenContextProvidesProperHint) { - if (!pPlatform->peekExecutionEnvironment()->getHardwareInfo()->capabilityTable.ftrSvm) { + if (!pPlatform->getDevice(0)->getHardwareInfo().capabilityTable.ftrSvm) { GTEST_SKIP(); } void *svmPtr = context->getSVMAllocsManager()->createSVMAlloc(0, 256, {}); diff --git a/unit_tests/d3d_sharing/d3d_aux_tests.cpp b/unit_tests/d3d_sharing/d3d_aux_tests.cpp index a597e1bcd9..3a4b40e6d2 100644 --- a/unit_tests/d3d_sharing/d3d_aux_tests.cpp +++ b/unit_tests/d3d_sharing/d3d_aux_tests.cpp @@ -36,9 +36,9 @@ TYPED_TEST_P(D3DAuxTests, given2dSharableTextureWithUnifiedAuxFlagsWhenCreatingT auto image = std::unique_ptr(D3DTexture::create2d(this->context, (D3DTexture2d *)&this->dummyD3DTexture, CL_MEM_READ_WRITE, 4, nullptr)); ASSERT_NE(nullptr, image.get()); - auto hwInfo = context->getMemoryManager()->peekExecutionEnvironment().getHardwareInfo(); - auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily); - uint32_t expectedMapAuxGpuVaCalls = hwHelper.isPageTableManagerSupported(*hwInfo) ? 1 : 0; + auto hwInfo = context->getDevice(0)->getHardwareInfo(); + auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); + uint32_t expectedMapAuxGpuVaCalls = hwHelper.isPageTableManagerSupported(hwInfo) ? 1 : 0; EXPECT_EQ(expectedMapAuxGpuVaCalls, mockMM->mapAuxGpuVACalled); EXPECT_TRUE(gmm->isRenderCompressed); @@ -56,12 +56,12 @@ TYPED_TEST_P(D3DAuxTests, given2dSharableTextureWithUnifiedAuxFlagsWhenFailOnAux auto image = std::unique_ptr(D3DTexture::create2d(this->context, (D3DTexture2d *)&this->dummyD3DTexture, CL_MEM_READ_WRITE, 4, nullptr)); ASSERT_NE(nullptr, image.get()); - auto hwInfo = context->getMemoryManager()->peekExecutionEnvironment().getHardwareInfo(); - auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily); - uint32_t expectedMapAuxGpuVaCalls = hwHelper.isPageTableManagerSupported(*hwInfo) ? 1 : 0; + auto hwInfo = context->getDevice(0)->getHardwareInfo(); + auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); + uint32_t expectedMapAuxGpuVaCalls = hwHelper.isPageTableManagerSupported(hwInfo) ? 1 : 0; EXPECT_EQ(expectedMapAuxGpuVaCalls, mockMM->mapAuxGpuVACalled); - EXPECT_EQ(!hwHelper.isPageTableManagerSupported(*hwInfo), gmm->isRenderCompressed); + EXPECT_EQ(!hwHelper.isPageTableManagerSupported(hwInfo), gmm->isRenderCompressed); } TYPED_TEST_P(D3DAuxTests, given2dSharableTextureWithoutUnifiedAuxFlagsWhenCreatingThenDontMapAuxTable) { @@ -88,9 +88,9 @@ TYPED_TEST_P(D3DAuxTests, given2dNonSharableTextureWithUnifiedAuxFlagsWhenCreati auto image = std::unique_ptr(D3DTexture::create2d(this->context, (D3DTexture2d *)&this->dummyD3DTexture, CL_MEM_READ_WRITE, 1, nullptr)); ASSERT_NE(nullptr, image.get()); - auto hwInfo = context->getMemoryManager()->peekExecutionEnvironment().getHardwareInfo(); - auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily); - uint32_t expectedMapAuxGpuVaCalls = hwHelper.isPageTableManagerSupported(*hwInfo) ? 1 : 0; + auto hwInfo = context->getDevice(0)->getHardwareInfo(); + auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); + uint32_t expectedMapAuxGpuVaCalls = hwHelper.isPageTableManagerSupported(hwInfo) ? 1 : 0; EXPECT_EQ(expectedMapAuxGpuVaCalls, mockMM->mapAuxGpuVACalled); EXPECT_TRUE(gmm->isRenderCompressed); @@ -105,9 +105,9 @@ TYPED_TEST_P(D3DAuxTests, given3dSharableTextureWithUnifiedAuxFlagsWhenCreatingT std::unique_ptr image(D3DTexture::create3d(this->context, (D3DTexture3d *)&this->dummyD3DTexture, CL_MEM_READ_WRITE, 1, nullptr)); ASSERT_NE(nullptr, image.get()); - auto hwInfo = context->getMemoryManager()->peekExecutionEnvironment().getHardwareInfo(); - auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily); - uint32_t expectedMapAuxGpuVaCalls = hwHelper.isPageTableManagerSupported(*hwInfo) ? 1 : 0; + auto hwInfo = context->getDevice(0)->getHardwareInfo(); + auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); + uint32_t expectedMapAuxGpuVaCalls = hwHelper.isPageTableManagerSupported(hwInfo) ? 1 : 0; EXPECT_EQ(expectedMapAuxGpuVaCalls, mockMM->mapAuxGpuVACalled); EXPECT_TRUE(gmm->isRenderCompressed); @@ -123,12 +123,12 @@ TYPED_TEST_P(D3DAuxTests, given3dSharableTextureWithUnifiedAuxFlagsWhenFailOnAux std::unique_ptr image(D3DTexture::create3d(this->context, (D3DTexture3d *)&this->dummyD3DTexture, CL_MEM_READ_WRITE, 1, nullptr)); ASSERT_NE(nullptr, image.get()); - auto hwInfo = context->getMemoryManager()->peekExecutionEnvironment().getHardwareInfo(); - auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily); - uint32_t expectedMapAuxGpuVaCalls = hwHelper.isPageTableManagerSupported(*hwInfo) ? 1 : 0; + auto hwInfo = context->getDevice(0)->getHardwareInfo(); + auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); + uint32_t expectedMapAuxGpuVaCalls = hwHelper.isPageTableManagerSupported(hwInfo) ? 1 : 0; EXPECT_EQ(expectedMapAuxGpuVaCalls, mockMM->mapAuxGpuVACalled); - EXPECT_EQ(!hwHelper.isPageTableManagerSupported(*hwInfo), gmm->isRenderCompressed); + EXPECT_EQ(!hwHelper.isPageTableManagerSupported(hwInfo), gmm->isRenderCompressed); } TYPED_TEST_P(D3DAuxTests, given3dSharableTextureWithoutUnifiedAuxFlagsWhenCreatingThenDontMapAuxTable) { @@ -153,9 +153,9 @@ TYPED_TEST_P(D3DAuxTests, given3dNonSharableTextureWithUnifiedAuxFlagsWhenCreati std::unique_ptr image(D3DTexture::create3d(this->context, (D3DTexture3d *)&this->dummyD3DTexture, CL_MEM_READ_WRITE, 1, nullptr)); ASSERT_NE(nullptr, image.get()); - auto hwInfo = context->getMemoryManager()->peekExecutionEnvironment().getHardwareInfo(); - auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily); - uint32_t expectedMapAuxGpuVaCalls = hwHelper.isPageTableManagerSupported(*hwInfo) ? 1 : 0; + auto hwInfo = context->getDevice(0)->getHardwareInfo(); + auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); + uint32_t expectedMapAuxGpuVaCalls = hwHelper.isPageTableManagerSupported(hwInfo) ? 1 : 0; EXPECT_EQ(expectedMapAuxGpuVaCalls, mockMM->mapAuxGpuVACalled); EXPECT_TRUE(gmm->isRenderCompressed); diff --git a/unit_tests/gmm_helper/gmm_helper_tests.cpp b/unit_tests/gmm_helper/gmm_helper_tests.cpp index f13eb22e26..95a0696c9d 100644 --- a/unit_tests/gmm_helper/gmm_helper_tests.cpp +++ b/unit_tests/gmm_helper/gmm_helper_tests.cpp @@ -709,7 +709,7 @@ TEST(GmmTest, givenInvalidFlagsSetWhenAskedForUnifiedAuxTranslationCapabilityThe TEST(GmmTest, givenHwInfoWhenDeviceIsCreatedTheSetThisHwInfoToGmmHelper) { std::unique_ptr device(MockDevice::createWithNewExecutionEnvironment(nullptr)); - EXPECT_EQ(device->getExecutionEnvironment()->getHardwareInfo(), device->getGmmHelper()->getHardwareInfo()); + EXPECT_EQ(&device->getHardwareInfo(), device->getGmmHelper()->getHardwareInfo()); } TEST(GmmTest, whenResourceIsCreatedThenHandleItsOwnership) { diff --git a/unit_tests/helpers/timestamp_packet_tests.cpp b/unit_tests/helpers/timestamp_packet_tests.cpp index 4f914e14cb..eb55dfc722 100644 --- a/unit_tests/helpers/timestamp_packet_tests.cpp +++ b/unit_tests/helpers/timestamp_packet_tests.cpp @@ -527,7 +527,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, TimestampPacketTests, givenTimestampPacketWhenDispat uint32_t walkersFound = 0; for (auto it = hwParser.cmdList.begin(); it != hwParser.cmdList.end(); it++) { if (genCmdCast(*it)) { - if (HardwareCommandsHelper::isPipeControlWArequired(*executionEnvironment->getHardwareInfo())) { + if (HardwareCommandsHelper::isPipeControlWArequired(device->getHardwareInfo())) { auto pipeControl = genCmdCast(*++it); EXPECT_NE(nullptr, pipeControl); } @@ -635,7 +635,7 @@ HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledWhenEnqueueingThe bool walkerFound = false; for (auto it = hwParser.cmdList.begin(); it != hwParser.cmdList.end(); it++) { if (genCmdCast(*it)) { - if (HardwareCommandsHelper::isPipeControlWArequired(*executionEnvironment->getHardwareInfo())) { + if (HardwareCommandsHelper::isPipeControlWArequired(device->getHardwareInfo())) { auto pipeControl = genCmdCast(*++it); EXPECT_NE(nullptr, pipeControl); } diff --git a/unit_tests/libult/create_command_stream.cpp b/unit_tests/libult/create_command_stream.cpp index 278a58d95a..ba5a787dd5 100644 --- a/unit_tests/libult/create_command_stream.cpp +++ b/unit_tests/libult/create_command_stream.cpp @@ -7,6 +7,7 @@ #include "unit_tests/libult/create_command_stream.h" +#include "core/execution_environment/root_device_environment.h" #include "core/unit_tests/helpers/default_hw_info.h" #include "core/unit_tests/helpers/ult_hw_config.h" #include "runtime/command_stream/aub_command_stream_receiver.h" @@ -22,7 +23,7 @@ namespace NEO { extern CommandStreamReceiverCreateFunc commandStreamReceiverFactory[2 * IGFX_MAX_CORE]; CommandStreamReceiver *createCommandStream(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) { - auto hwInfo = executionEnvironment.getHardwareInfo(); + auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); if (ultHwConfig.useHwCsr) { return createCommandStreamImpl(executionEnvironment, rootDeviceIndex); diff --git a/unit_tests/memory_manager/memory_manager_tests.cpp b/unit_tests/memory_manager/memory_manager_tests.cpp index 3cbc5f34d7..1f569985f6 100644 --- a/unit_tests/memory_manager/memory_manager_tests.cpp +++ b/unit_tests/memory_manager/memory_manager_tests.cpp @@ -2142,20 +2142,20 @@ TEST(MemoryManagerTest, whenMemoryManagerReturnsNullptrThenAllocateGlobalsSurfac HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenEnableHostPtrTrackingFlagIsSetTo0ThenHostPointerTrackingIsDisabled) { DebugManagerStateRestore dbgRestore; DebugManager.flags.EnableHostPtrTracking.set(0); - EXPECT_FALSE(memoryManager->isHostPointerTrackingEnabled()); + EXPECT_FALSE(memoryManager->isHostPointerTrackingEnabled(0u)); } HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenEnableHostPtrTrackingFlagIsNotSetTo1ThenHostPointerTrackingIsEnabled) { DebugManagerStateRestore dbgRestore; DebugManager.flags.EnableHostPtrTracking.set(1); - EXPECT_TRUE(memoryManager->isHostPointerTrackingEnabled()); + EXPECT_TRUE(memoryManager->isHostPointerTrackingEnabled(0u)); } HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenEnableHostPtrTrackingFlagIsSetNotSetThenHostPointerTrackingDependsOnCapabilityTable) { if (is32bit) { - EXPECT_TRUE(memoryManager->isHostPointerTrackingEnabled()); + EXPECT_TRUE(memoryManager->isHostPointerTrackingEnabled(0u)); } else { - EXPECT_EQ(executionEnvironment->getHardwareInfo()->capabilityTable.hostPtrTrackingEnabled, memoryManager->isHostPointerTrackingEnabled()); + EXPECT_EQ(device->getHardwareInfo().capabilityTable.hostPtrTrackingEnabled, memoryManager->isHostPointerTrackingEnabled(0u)); } } @@ -2190,19 +2190,19 @@ HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhen64BitAndHostPtrTrackingDisab bool expectedValue = !is32bit; - auto result = memoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR); + auto result = memoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, 0u); EXPECT_EQ(expectedValue, result); - result = memoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::MAP_ALLOCATION); + result = memoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::MAP_ALLOCATION, 0u); EXPECT_EQ(expectedValue, result); } HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenHostPtrTrackingModeThenNonSvmHostPtrUsageIsSet) { memoryManager->setForceNonSvmForExternalHostPtr(true); - auto result = memoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR); + auto result = memoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, 0u); EXPECT_EQ(true, result); - result = memoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY); + result = memoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, 0u); EXPECT_EQ(false, result); } @@ -2210,10 +2210,10 @@ HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenHostPtrTrackingEnabledThenNo DebugManagerStateRestore dbgRestore; DebugManager.flags.EnableHostPtrTracking.set(1); - auto result = memoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR); + auto result = memoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, 0u); EXPECT_EQ(!executionEnvironment->isFullRangeSvm() && !is32bit, result); - result = memoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::MAP_ALLOCATION); + result = memoryManager->useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType::MAP_ALLOCATION, 0u); EXPECT_EQ(!executionEnvironment->isFullRangeSvm() && !is32bit, result); } diff --git a/unit_tests/memory_manager/unified_memory_manager_tests.cpp b/unit_tests/memory_manager/unified_memory_manager_tests.cpp index cff6c0a7d3..2ca7082eca 100644 --- a/unit_tests/memory_manager/unified_memory_manager_tests.cpp +++ b/unit_tests/memory_manager/unified_memory_manager_tests.cpp @@ -27,7 +27,7 @@ struct SVMMemoryAllocatorFixture { SVMMemoryAllocatorFixture() : executionEnvironment(*platformDevices) {} virtual void SetUp() { - bool svmSupported = executionEnvironment.getHardwareInfo()->capabilityTable.ftrSvm; + bool svmSupported = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo()->capabilityTable.ftrSvm; if (!svmSupported) { GTEST_SKIP(); } @@ -482,7 +482,7 @@ struct MemoryManagerPropertiesCheck : public MockMemoryManager { struct UnifiedMemoryManagerPropertiesTest : public ::testing::Test { void SetUp() override { - bool svmSupported = executionEnvironment.getHardwareInfo()->capabilityTable.ftrSvm; + bool svmSupported = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo()->capabilityTable.ftrSvm; if (!svmSupported) { GTEST_SKIP(); } @@ -559,7 +559,7 @@ TEST_F(UnifiedMemoryManagerPropertiesTest, givenDeviceBitfieldWithSingleBitSetWh struct ShareableUnifiedMemoryManagerPropertiesTest : public ::testing::Test { void SetUp() override { executionEnvironment = platform()->peekExecutionEnvironment(); - bool svmSupported = executionEnvironment->getHardwareInfo()->capabilityTable.ftrSvm; + bool svmSupported = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->capabilityTable.ftrSvm; if (!svmSupported) { GTEST_SKIP(); } diff --git a/unit_tests/program/program_tests.cpp b/unit_tests/program/program_tests.cpp index 526f3285b9..02ac8f6e58 100644 --- a/unit_tests/program/program_tests.cpp +++ b/unit_tests/program/program_tests.cpp @@ -1435,7 +1435,7 @@ TEST_F(PatchTokenTests, ConstantMemoryObjectKernelArg) { } TEST_F(PatchTokenTests, VmeKernelArg) { - if (!pDevice->getExecutionEnvironment()->getHardwareInfo()->capabilityTable.supportsVme) { + if (!pDevice->getHardwareInfo().capabilityTable.supportsVme) { GTEST_SKIP(); } // PATCH_TOKEN_INLINE_VME_SAMPLER_INFO token indicates a VME kernel. diff --git a/unit_tests/sharings/gl/windows/gl_texture_tests.cpp b/unit_tests/sharings/gl/windows/gl_texture_tests.cpp index 3221c1d56c..28f51cddb1 100644 --- a/unit_tests/sharings/gl/windows/gl_texture_tests.cpp +++ b/unit_tests/sharings/gl/windows/gl_texture_tests.cpp @@ -530,9 +530,9 @@ TEST_F(GlSharingTextureTests, givenMockGlWhenGlTextureIsCreatedWithUnifiedAuxSur auto glTexture = std::unique_ptr(GlTexture::createSharedGlTexture(clContext.get(), CL_MEM_WRITE_ONLY, GL_SRGB8_ALPHA8, 0, textureId, &retVal)); - auto hwInfo = executionEnvironment->getHardwareInfo(); - auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily); - uint32_t expectedMapAuxGpuVaCalls = hwHelper.isPageTableManagerSupported(*hwInfo) ? 1 : 0; + auto hwInfo = clContext->getDevice(0)->getHardwareInfo(); + auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); + uint32_t expectedMapAuxGpuVaCalls = hwHelper.isPageTableManagerSupported(hwInfo) ? 1 : 0; EXPECT_EQ(expectedMapAuxGpuVaCalls, tempMM->mapAuxGpuVACalled); }