From cb2b572e94e62921e8709fb2f824c9f97eccb257 Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Tue, 9 Apr 2024 12:43:12 +0000 Subject: [PATCH] feature: add support for null aub mode In this mode AUB csr will be created, however, no aub file will be created Related-To: NEO-11097 Signed-off-by: Mateusz Jablonski --- level_zero/core/source/device/device_imp.cpp | 2 +- .../dll/create_builtin_functions_lib.cpp | 4 +- level_zero/core/source/event/event_impl.inl | 2 +- level_zero/core/source/fence/fence.cpp | 4 +- .../unit_tests/fixtures/cmdlist_fixture.inl | 2 +- .../unit_tests/sources/event/test_event.cpp | 16 ++-- opencl/source/command_queue/command_queue.cpp | 2 +- .../unified_memory_aub_tests.cpp | 6 +- .../aub_mem_dump_tests_xe_hpc_core.cpp | 4 +- .../aub_mem_dump_tests_xe_hpg_core.cpp | 4 +- .../command_stream_receiver_hw_1_tests.cpp | 2 +- .../create_command_stream_receiver_tests.cpp | 19 ++--- opencl/test/unit_test/device/device_tests.cpp | 2 +- opencl/test/unit_test/kernel/kernel_tests.cpp | 2 +- .../test/unit_test/linux/main_linux_dll.cpp | 4 +- .../os_interface/device_factory_tests.cpp | 8 +- shared/source/aub/aub_center.cpp | 18 ++--- shared/source/aub/aub_center.h | 4 +- .../aub_command_stream_receiver_hw.h | 4 +- .../command_stream_receiver.cpp | 2 +- .../command_stream_receiver_hw.h | 2 +- .../command_stream_receiver_with_aub_dump.h | 8 +- .../command_stream_receiver_with_aub_dump.inl | 4 +- .../create_command_stream_impl.cpp | 20 +++-- .../tbx_command_stream_receiver_hw.h | 4 +- .../tbx_command_stream_receiver_hw.inl | 2 +- .../debug_settings/debug_variables_base.inl | 2 +- shared/source/device/device.cpp | 2 +- shared/source/dll/device_dll.cpp | 4 +- .../execution_environment.cpp | 18 ++--- .../source/helpers/gfx_core_helper_base.inl | 2 +- shared/source/helpers/options.h | 22 ++++-- .../windows/gmm_callbacks_tgllp_and_later.inl | 4 +- shared/source/os_interface/device_factory.cpp | 12 +-- ..._memory_operations_handler_with_aub_dump.h | 2 +- .../os_interface/linux/os_interface_linux.cpp | 4 +- .../windows/init_wddm_os_interface.cpp | 4 +- ..._memory_operations_handler_with_aub_dump.h | 4 +- .../cpu_page_fault_manager.cpp | 4 +- shared/test/common/common_main.cpp | 13 ++- .../aub_fixtures/multicontext_aub_fixture.cpp | 4 +- .../fixtures/mock_aub_center_fixture.cpp | 4 +- .../common/fixtures/mock_aub_center_fixture.h | 4 +- .../libult/ult_command_stream_receiver.h | 2 +- .../mocks/mock_command_stream_receiver.h | 2 +- shared/test/common/mocks/mock_csr.h | 4 +- shared/test/common/tests_configuration.h | 12 ++- .../test/unit_test/aub/aub_center_tests.cpp | 46 +++++------ .../aub_command_stream_receiver_1_tests.cpp | 10 +-- .../aub_command_stream_receiver_3_tests.cpp | 4 +- .../command_stream_receiver_tests.cpp | 10 +-- ...nd_stream_receiver_with_aub_dump_tests.cpp | 22 +++--- .../command_stream/get_devices_tests.cpp | 79 ++++++++++--------- .../tbx_command_stream_tests.cpp | 10 +-- .../execution_environment_tests.cpp | 10 +-- .../unit_test/gmm_helper/gmm_helper_tests.cpp | 4 +- .../memory_manager/memory_manager_tests.cpp | 12 +-- .../cpu_page_fault_manager_tests.cpp | 10 +-- ...nd_stream_receiver_2_tests_xe_hpc_core.cpp | 4 +- 59 files changed, 262 insertions(+), 239 deletions(-) diff --git a/level_zero/core/source/device/device_imp.cpp b/level_zero/core/source/device/device_imp.cpp index f69230b70e..f24948b2aa 100644 --- a/level_zero/core/source/device/device_imp.cpp +++ b/level_zero/core/source/device/device_imp.cpp @@ -1421,7 +1421,7 @@ Device *Device::create(DriverHandle *driverHandle, NEO::Device *neoDevice, bool device->pciMaxSpeed.width = pciSpeedInfo.width; } - if (device->getNEODevice()->getAllEngines()[0].commandStreamReceiver->getType() == NEO::CommandStreamReceiverType::CSR_HW) { + if (device->getNEODevice()->getAllEngines()[0].commandStreamReceiver->getType() == NEO::CommandStreamReceiverType::hardware) { device->createSysmanHandle(isSubDevice); } device->resourcesReleased = false; diff --git a/level_zero/core/source/dll/create_builtin_functions_lib.cpp b/level_zero/core/source/dll/create_builtin_functions_lib.cpp index 2e3f8528ed..c8e98a9ec0 100644 --- a/level_zero/core/source/dll/create_builtin_functions_lib.cpp +++ b/level_zero/core/source/dll/create_builtin_functions_lib.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 Intel Corporation + * Copyright (C) 2020-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -24,7 +24,7 @@ std::unique_ptr BuiltinFunctionsLib::create(Device *device, bool BuiltinFunctionsLibImpl::initBuiltinsAsyncEnabled(Device *device) { return device->getNEODevice()->getRootDeviceEnvironment().osInterface.get() && device->getNEODevice()->getRootDeviceEnvironment().osInterface->getDriverModel()->getDriverModelType() == NEO::DriverModelType::drm && - device->getNEODevice()->getDefaultEngine().commandStreamReceiver->getType() == NEO::CommandStreamReceiverType::CSR_HW && + device->getNEODevice()->getDefaultEngine().commandStreamReceiver->getType() == NEO::CommandStreamReceiverType::hardware && device->getNEODevice()->getRootDeviceEnvironment().getProductHelper().isInitBuiltinAsyncSupported(device->getHwInfo()); } diff --git a/level_zero/core/source/event/event_impl.inl b/level_zero/core/source/event/event_impl.inl index 82bf30e5ef..ae71c5b66d 100644 --- a/level_zero/core/source/event/event_impl.inl +++ b/level_zero/core/source/event/event_impl.inl @@ -530,7 +530,7 @@ ze_result_t EventImp::hostSynchronize(uint64_t timeout) { ze_result_t ret = ZE_RESULT_NOT_READY; - if (this->csrs[0]->getType() == NEO::CommandStreamReceiverType::CSR_AUB) { + if (this->csrs[0]->getType() == NEO::CommandStreamReceiverType::aub) { return ZE_RESULT_SUCCESS; } diff --git a/level_zero/core/source/fence/fence.cpp b/level_zero/core/source/fence/fence.cpp index f0bb05fda4..f944910094 100644 --- a/level_zero/core/source/fence/fence.cpp +++ b/level_zero/core/source/fence/fence.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 Intel Corporation + * Copyright (C) 2020-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -53,7 +53,7 @@ ze_result_t Fence::hostSynchronize(uint64_t timeout) { ze_result_t ret = ZE_RESULT_NOT_READY; const auto csr = cmdQueue->getCsr(); - if (csr->getType() == NEO::CommandStreamReceiverType::CSR_AUB) { + if (csr->getType() == NEO::CommandStreamReceiverType::aub) { return ZE_RESULT_SUCCESS; } diff --git a/level_zero/core/test/unit_tests/fixtures/cmdlist_fixture.inl b/level_zero/core/test/unit_tests/fixtures/cmdlist_fixture.inl index fd9edc8055..8f30ef84b8 100644 --- a/level_zero/core/test/unit_tests/fixtures/cmdlist_fixture.inl +++ b/level_zero/core/test/unit_tests/fixtures/cmdlist_fixture.inl @@ -1333,7 +1333,7 @@ void TbxImmediateCommandListFixture::setUpT() { device->getNEODevice()->getExecutionEnvironment()->rootDeviceEnvironments[0]->memoryOperationsInterface = std::make_unique(); - neoDevice->getUltCommandStreamReceiver().commandStreamReceiverType = CommandStreamReceiverType::CSR_TBX; + neoDevice->getUltCommandStreamReceiver().commandStreamReceiverType = CommandStreamReceiverType::tbx; ModuleMutableCommandListFixture::setUpImpl(); ze_event_pool_desc_t eventPoolDesc = {ZE_STRUCTURE_TYPE_EVENT_POOL_DESC}; 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 8c76053e1a..fdc7e4d1fd 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 @@ -3225,7 +3225,7 @@ HWTEST_F(EventTests, GivenEventWhenHostSynchronizeCalledThenExpectDownloadEventA VariableBackup backupPauseValue(&CpuIntrinsicsTests::pauseValue, Event::STATE_CLEARED); VariableBackup backupPauseOffset(&CpuIntrinsicsTests::pauseOffset); VariableBackup> backupSetupPauseAddress(&CpuIntrinsicsTests::setupPauseAddress); - neoDevice->getUltCommandStreamReceiver().commandStreamReceiverType = CommandStreamReceiverType::CSR_TBX; + neoDevice->getUltCommandStreamReceiver().commandStreamReceiverType = CommandStreamReceiverType::tbx; neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->memoryOperationsInterface = std::make_unique(); auto event = whiteboxCast(getHelper().createEvent(eventPool.get(), &eventDesc, device)); @@ -3288,7 +3288,7 @@ HWTEST_F(EventTests, GivenEventWhenHostSynchronizeCalledThenExpectDownloadEventA HWTEST_F(EventTests, GivenEventUsedOnNonDefaultCsrWhenHostSynchronizeCalledThenAllocationIsDownloaded) { std::map downloadAllocationTrack; - neoDevice->getUltCommandStreamReceiver().commandStreamReceiverType = CommandStreamReceiverType::CSR_TBX; + neoDevice->getUltCommandStreamReceiver().commandStreamReceiverType = CommandStreamReceiverType::tbx; neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->memoryOperationsInterface = std::make_unique(); auto event = whiteboxCast(getHelper().createEvent(eventPool.get(), &eventDesc, device)); @@ -3342,7 +3342,7 @@ HWTEST_F(EventTests, GivenEventUsedOnNonDefaultCsrWhenHostSynchronizeCalledThenA HWTEST_F(EventTests, givenInOrderEventWhenHostSynchronizeIsCalledThenAllocationIsDonwloadedOnlyAfterEventWasUsedOnGpu) { std::map downloadAllocationTrack; - neoDevice->getUltCommandStreamReceiver().commandStreamReceiverType = CommandStreamReceiverType::CSR_TBX; + neoDevice->getUltCommandStreamReceiver().commandStreamReceiverType = CommandStreamReceiverType::tbx; neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->memoryOperationsInterface = std::make_unique(); MockTagAllocator> tagAllocator(0, neoDevice->getMemoryManager()); @@ -3394,7 +3394,7 @@ HWTEST_F(EventTests, givenInOrderEventWhenHostSynchronizeIsCalledThenAllocationI HWTEST_F(EventTests, givenStandaloneCbEventAndTbxModeWhenSynchronizingThenHandleCorrectly) { auto &ultCsr = neoDevice->getUltCommandStreamReceiver(); - ultCsr.commandStreamReceiverType = CommandStreamReceiverType::CSR_TBX; + ultCsr.commandStreamReceiverType = CommandStreamReceiverType::tbx; neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->memoryOperationsInterface = std::make_unique(); @@ -3421,7 +3421,7 @@ HWTEST_F(EventTests, givenInOrderEventWithHostAllocWhenHostSynchronizeIsCalledTh std::map downloadAllocationTrack; - neoDevice->getUltCommandStreamReceiver().commandStreamReceiverType = CommandStreamReceiverType::CSR_TBX; + neoDevice->getUltCommandStreamReceiver().commandStreamReceiverType = CommandStreamReceiverType::tbx; neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->memoryOperationsInterface = std::make_unique(); @@ -3479,7 +3479,7 @@ HWTEST_F(EventTests, givenInOrderEventWithHostAllocWhenHostSynchronizeIsCalledTh } HWTEST_F(EventTests, GivenEventIsReadyToDownloadAllAlocationsWhenDownloadAllocationNotRequiredThenDontDownloadAllocations) { - neoDevice->getUltCommandStreamReceiver().commandStreamReceiverType = CommandStreamReceiverType::CSR_HW; + neoDevice->getUltCommandStreamReceiver().commandStreamReceiverType = CommandStreamReceiverType::hardware; auto event = whiteboxCast(getHelper().createEvent(eventPool.get(), &eventDesc, device)); @@ -3502,7 +3502,7 @@ HWTEST_F(EventTests, GivenNotReadyEventBecomesReadyWhenDownloadAllocationRequire neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->memoryOperationsInterface = std::make_unique(); - CommandStreamReceiverType tbxCsrTypes[] = {CommandStreamReceiverType::CSR_TBX, CommandStreamReceiverType::CSR_TBX_WITH_AUB}; + CommandStreamReceiverType tbxCsrTypes[] = {CommandStreamReceiverType::tbx, CommandStreamReceiverType::tbxWithAub}; auto &ultCsr = static_cast &>(neoDevice->getUltCommandStreamReceiver()); for (auto csrType : tbxCsrTypes) { @@ -3543,7 +3543,7 @@ HWTEST_F(EventTests, GivenCsrTbxModeWhenEventCreatedAndSignaledThenEventAllocati mockMemIface->captureGfxAllocationsForMakeResident = true; auto &ultCsr = neoDevice->getUltCommandStreamReceiver(); - ultCsr.commandStreamReceiverType = CommandStreamReceiverType::CSR_TBX; + ultCsr.commandStreamReceiverType = CommandStreamReceiverType::tbx; ze_result_t result = ZE_RESULT_SUCCESS; eventPool = std::unique_ptr(L0::EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result)); diff --git a/opencl/source/command_queue/command_queue.cpp b/opencl/source/command_queue/command_queue.cpp index 9bd0ea337e..6854c2a16b 100644 --- a/opencl/source/command_queue/command_queue.cpp +++ b/opencl/source/command_queue/command_queue.cpp @@ -1240,7 +1240,7 @@ void CommandQueue::aubCaptureHook(bool &blocking, bool &clearAllDependencies, co } } - if (getGpgpuCommandStreamReceiver().getType() > CommandStreamReceiverType::CSR_HW) { + if (getGpgpuCommandStreamReceiver().getType() > CommandStreamReceiverType::hardware) { for (auto &dispatchInfo : multiDispatchInfo) { auto &kernelName = dispatchInfo.getKernel()->getKernelInfo().kernelDescriptor.kernelMetadata.kernelName; getGpgpuCommandStreamReceiver().addAubComment(kernelName.c_str()); diff --git a/opencl/test/unit_test/aub_tests/unified_memory/unified_memory_aub_tests.cpp b/opencl/test/unit_test/aub_tests/unified_memory/unified_memory_aub_tests.cpp index 9a9127cf51..0bbdee837f 100644 --- a/opencl/test/unit_test/aub_tests/unified_memory/unified_memory_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/unified_memory/unified_memory_aub_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2023 Intel Corporation + * Copyright (C) 2019-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -22,9 +22,9 @@ class UnifiedMemoryAubTest : public UnifiedMemoryAubFixture, void SetUp() override { if (testMode == TestMode::aubTestsWithTbx) { - debugManager.flags.SetCommandStreamReceiver.set(static_cast(CommandStreamReceiverType::CSR_TBX_WITH_AUB)); + debugManager.flags.SetCommandStreamReceiver.set(static_cast(CommandStreamReceiverType::tbxWithAub)); } else { - debugManager.flags.SetCommandStreamReceiver.set(static_cast(CommandStreamReceiverType::CSR_AUB)); + debugManager.flags.SetCommandStreamReceiver.set(static_cast(CommandStreamReceiverType::aub)); } UnifiedMemoryAubFixture::setUp(); values = std::vector(dataSize, 11); diff --git a/opencl/test/unit_test/aub_tests/xe_hpc_core/aub_mem_dump_tests_xe_hpc_core.cpp b/opencl/test/unit_test/aub_tests/xe_hpc_core/aub_mem_dump_tests_xe_hpc_core.cpp index e2ccd96bf1..57ebc43ab8 100644 --- a/opencl/test/unit_test/aub_tests/xe_hpc_core/aub_mem_dump_tests_xe_hpc_core.cpp +++ b/opencl/test/unit_test/aub_tests/xe_hpc_core/aub_mem_dump_tests_xe_hpc_core.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2023 Intel Corporation + * Copyright (C) 2022-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -24,7 +24,7 @@ XE_HPC_CORETEST_F(XeHpcCoreAubMemDumpTests, whenAubCsrIsCreatedThenCreateHardwar DebugManagerStateRestore restore; VariableBackup backup(&ultHwConfig); ultHwConfig.useHwCsr = true; - debugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_AUB); + debugManager.flags.SetCommandStreamReceiver.set(static_cast(CommandStreamReceiverType::aub)); std::unique_ptr device(MockDevice::createWithNewExecutionEnvironment(defaultHwInfo.get())); diff --git a/opencl/test/unit_test/aub_tests/xe_hpg_core/aub_mem_dump_tests_xe_hpg_core.cpp b/opencl/test/unit_test/aub_tests/xe_hpg_core/aub_mem_dump_tests_xe_hpg_core.cpp index f1224a9dce..f074fed211 100644 --- a/opencl/test/unit_test/aub_tests/xe_hpg_core/aub_mem_dump_tests_xe_hpg_core.cpp +++ b/opencl/test/unit_test/aub_tests/xe_hpg_core/aub_mem_dump_tests_xe_hpg_core.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2023 Intel Corporation + * Copyright (C) 2022-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -26,7 +26,7 @@ XE_HPG_CORETEST_F(XeHpgCoreAubMemDumpTests, whenAubCsrIsCreatedThenCreateHardwar DebugManagerStateRestore restore; VariableBackup backup(&ultHwConfig); ultHwConfig.useHwCsr = true; - debugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_AUB); + debugManager.flags.SetCommandStreamReceiver.set(static_cast(CommandStreamReceiverType::aub)); std::unique_ptr device(MockDevice::createWithNewExecutionEnvironment(defaultHwInfo.get())); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp index b4603cdac1..7b140019d1 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp @@ -468,7 +468,7 @@ typedef Test CommandStreamReceiverHwTest; HWTEST_F(CommandStreamReceiverHwTest, givenCsrHwWhenTypeIsCheckedThenCsrHwIsReturned) { auto csr = std::unique_ptr(CommandStreamReceiverHw::create(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); - EXPECT_EQ(CommandStreamReceiverType::CSR_HW, csr->getType()); + EXPECT_EQ(CommandStreamReceiverType::hardware, csr->getType()); } HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverHwTest, WhenCommandStreamReceiverHwIsCreatedThenDefaultSshSizeIs64KB) { diff --git a/opencl/test/unit_test/command_stream/create_command_stream_receiver_tests.cpp b/opencl/test/unit_test/command_stream/create_command_stream_receiver_tests.cpp index abe3553a46..314f76d17d 100644 --- a/opencl/test/unit_test/command_stream/create_command_stream_receiver_tests.cpp +++ b/opencl/test/unit_test/command_stream/create_command_stream_receiver_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -32,11 +32,11 @@ HWTEST_P(CreateCommandStreamReceiverTest, givenCreateCommandStreamWhenCsrIsSetTo VariableBackup backup(&ultHwConfig); ultHwConfig.useHwCsr = true; - debugManager.flags.SetCommandStreamReceiver.set(csrType); + debugManager.flags.SetCommandStreamReceiver.set(static_cast(csrType)); { auto csr = std::unique_ptr(createCommandStream(*executionEnvironment, 0, 1)); - if (csrType < CommandStreamReceiverType::CSR_TYPES_NUM) { + if (csrType < CommandStreamReceiverType::typesNum) { EXPECT_NE(nullptr, csr.get()); } else { EXPECT_EQ(nullptr, csr.get()); @@ -47,12 +47,13 @@ HWTEST_P(CreateCommandStreamReceiverTest, givenCreateCommandStreamWhenCsrIsSetTo } static CommandStreamReceiverType commandStreamReceiverTypes[] = { - CSR_HW, - CSR_AUB, - CSR_TBX, - CSR_HW_WITH_AUB, - CSR_TBX_WITH_AUB, - CSR_TYPES_NUM}; + CommandStreamReceiverType::hardware, + CommandStreamReceiverType::aub, + CommandStreamReceiverType::tbx, + CommandStreamReceiverType::hardwareWithAub, + CommandStreamReceiverType::tbxWithAub, + CommandStreamReceiverType::nullAub, + CommandStreamReceiverType::typesNum}; INSTANTIATE_TEST_CASE_P( CreateCommandStreamReceiverTest_Create, diff --git a/opencl/test/unit_test/device/device_tests.cpp b/opencl/test/unit_test/device/device_tests.cpp index 8f26bc50ae..49664fd906 100644 --- a/opencl/test/unit_test/device/device_tests.cpp +++ b/opencl/test/unit_test/device/device_tests.cpp @@ -670,7 +670,7 @@ TEST(DeviceGetEngineTest, givenDeferredContextInitializationDisabledWhenCreating TEST(DeviceGetEngineTest, givenNonHwCsrModeWhenGetEngineThenDefaultEngineIsReturned) { DebugManagerStateRestore dbgRestorer; - debugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_AUB); + debugManager.flags.SetCommandStreamReceiver.set(static_cast(CommandStreamReceiverType::aub)); VariableBackup backup(&ultHwConfig); ultHwConfig.useHwCsr = true; diff --git a/opencl/test/unit_test/kernel/kernel_tests.cpp b/opencl/test/unit_test/kernel/kernel_tests.cpp index 742d8ec5b4..9e32be89b8 100644 --- a/opencl/test/unit_test/kernel/kernel_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_tests.cpp @@ -602,7 +602,7 @@ class CommandStreamReceiverMock : public CommandStreamReceiver { bool flushBatchedSubmissions() override { return true; } CommandStreamReceiverType getType() const override { - return CommandStreamReceiverType::CSR_HW; + return CommandStreamReceiverType::hardware; } void programHardwareContext(LinearStream &cmdStream) override {} diff --git a/opencl/test/unit_test/linux/main_linux_dll.cpp b/opencl/test/unit_test/linux/main_linux_dll.cpp index 6016c5463a..20b4241a01 100644 --- a/opencl/test/unit_test/linux/main_linux_dll.cpp +++ b/opencl/test/unit_test/linux/main_linux_dll.cpp @@ -857,11 +857,11 @@ TEST(DeviceTest, whenCheckBlitSplitEnabledThenReturnsTrue) { } TEST(DeviceTest, givenCsrHwWhenCheckIsInitDeviceWithFirstSubmissionEnabledThenReturnsTrue) { - EXPECT_TRUE(Device::isInitDeviceWithFirstSubmissionEnabled(CommandStreamReceiverType::CSR_HW)); + EXPECT_TRUE(Device::isInitDeviceWithFirstSubmissionEnabled(CommandStreamReceiverType::hardware)); } TEST(DeviceTest, givenCsrNonHwWhenCheckIsInitDeviceWithFirstSubmissionEnabledThenReturnsTrue) { - EXPECT_FALSE(Device::isInitDeviceWithFirstSubmissionEnabled(CommandStreamReceiverType::CSR_TBX)); + EXPECT_FALSE(Device::isInitDeviceWithFirstSubmissionEnabled(CommandStreamReceiverType::tbx)); } TEST(PlatformsDestructor, whenGlobalPlatformsDestructorIsCalledThenGlobalPlatformsAreDestroyed) { diff --git a/opencl/test/unit_test/os_interface/device_factory_tests.cpp b/opencl/test/unit_test/os_interface/device_factory_tests.cpp index 075cb26724..2590d95254 100644 --- a/opencl/test/unit_test/os_interface/device_factory_tests.cpp +++ b/opencl/test/unit_test/os_interface/device_factory_tests.cpp @@ -366,18 +366,18 @@ TEST(DeviceFactory, givenCreateMultipleRootDevicesWhenCreateDevicesIsCalledThenV TEST(DeviceFactory, givenHwModeSelectedWhenIsHwModeSelectedIsCalledThenTrueIsReturned) { DebugManagerStateRestore stateRestore; - constexpr int32_t hwModes[] = {-1, CommandStreamReceiverType::CSR_HW, CommandStreamReceiverType::CSR_HW_WITH_AUB}; + constexpr int32_t hwModes[] = {-1, static_cast(CommandStreamReceiverType::hardware), static_cast(CommandStreamReceiverType::hardwareWithAub)}; for (const auto &hwMode : hwModes) { - debugManager.flags.SetCommandStreamReceiver.set(hwMode); + debugManager.flags.SetCommandStreamReceiver.set(static_cast(hwMode)); EXPECT_TRUE(DeviceFactory::isHwModeSelected()); } } TEST(DeviceFactory, givenNonHwModeSelectedWhenIsHwModeSelectedIsCalledThenFalseIsReturned) { DebugManagerStateRestore stateRestore; - constexpr int32_t nonHwModes[] = {CommandStreamReceiverType::CSR_AUB, CommandStreamReceiverType::CSR_TBX, CommandStreamReceiverType::CSR_TBX_WITH_AUB}; + constexpr CommandStreamReceiverType nonHwModes[] = {CommandStreamReceiverType::aub, CommandStreamReceiverType::tbx, CommandStreamReceiverType::tbxWithAub, CommandStreamReceiverType::nullAub}; for (const auto &nonHwMode : nonHwModes) { - debugManager.flags.SetCommandStreamReceiver.set(nonHwMode); + debugManager.flags.SetCommandStreamReceiver.set(static_cast(nonHwMode)); EXPECT_FALSE(DeviceFactory::isHwModeSelected()); } } diff --git a/shared/source/aub/aub_center.cpp b/shared/source/aub/aub_center.cpp index 235942523c..f56cba988f 100644 --- a/shared/source/aub/aub_center.cpp +++ b/shared/source/aub/aub_center.cpp @@ -27,10 +27,7 @@ AubCenter::AubCenter(const RootDeviceEnvironment &rootDeviceEnvironment, bool lo auto devicesCount = GfxCoreHelper::getSubDevicesCount(hwInfo); auto releaseHelper = rootDeviceEnvironment.getReleaseHelper(); auto memoryBankSize = AubHelper::getPerTileLocalMemorySize(hwInfo, releaseHelper); - CommandStreamReceiverType type = csrType; - if (debugManager.flags.SetCommandStreamReceiver.get() >= CommandStreamReceiverType::CSR_HW) { - type = static_cast(debugManager.flags.SetCommandStreamReceiver.get()); - } + CommandStreamReceiverType type = obtainCsrTypeFromIntegerValue(debugManager.flags.SetCommandStreamReceiver.get(), csrType); aubStreamMode = getAubStreamMode(aubFileName, type); @@ -85,20 +82,23 @@ AubCenter::AubCenter() { subCaptureCommon = std::make_unique(); } -uint32_t AubCenter::getAubStreamMode(const std::string &aubFileName, uint32_t csrType) { +uint32_t AubCenter::getAubStreamMode(const std::string &aubFileName, CommandStreamReceiverType csrType) { uint32_t mode = aub_stream::mode::aubFile; switch (csrType) { - case CommandStreamReceiverType::CSR_HW_WITH_AUB: - case CommandStreamReceiverType::CSR_AUB: + case CommandStreamReceiverType::hardwareWithAub: + case CommandStreamReceiverType::aub: mode = aub_stream::mode::aubFile; break; - case CommandStreamReceiverType::CSR_TBX: + case CommandStreamReceiverType::tbx: mode = aub_stream::mode::tbx; break; - case CommandStreamReceiverType::CSR_TBX_WITH_AUB: + case CommandStreamReceiverType::tbxWithAub: mode = aub_stream::mode::aubFileAndTbx; break; + case CommandStreamReceiverType::nullAub: + mode = aub_stream::mode::null; + break; default: break; } diff --git a/shared/source/aub/aub_center.h b/shared/source/aub/aub_center.h index ed1911b40e..03c5ec02fa 100644 --- a/shared/source/aub/aub_center.h +++ b/shared/source/aub/aub_center.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -48,7 +48,7 @@ class AubCenter { return aubManager.get(); } - static uint32_t getAubStreamMode(const std::string &aubFileName, uint32_t csrType); + static uint32_t getAubStreamMode(const std::string &aubFileName, CommandStreamReceiverType csrType); protected: std::unique_ptr physicalAddressAllocator; diff --git a/shared/source/command_stream/aub_command_stream_receiver_hw.h b/shared/source/command_stream/aub_command_stream_receiver_hw.h index 11fa9d0d54..eea605cfb9 100644 --- a/shared/source/command_stream/aub_command_stream_receiver_hw.h +++ b/shared/source/command_stream/aub_command_stream_receiver_hw.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -102,7 +102,7 @@ class AUBCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw::CommandStreamReceiverWithAUBDump(cons const DeviceBitfield deviceBitfield) : BaseCSR(executionEnvironment, rootDeviceIndex, deviceBitfield) { bool isAubManager = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->aubCenter && executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->aubCenter->getAubManager(); - bool isTbxMode = CommandStreamReceiverType::CSR_TBX == BaseCSR::getType(); + bool isTbxMode = CommandStreamReceiverType::tbx == BaseCSR::getType(); bool createAubCsr = (isAubManager && isTbxMode) ? false : true; if (createAubCsr) { aubCSR.reset(AUBCommandStreamReceiver::create(baseName, false, executionEnvironment, rootDeviceIndex, deviceBitfield)); diff --git a/shared/source/command_stream/create_command_stream_impl.cpp b/shared/source/command_stream/create_command_stream_impl.cpp index 0a497014ff..e35603d6bd 100644 --- a/shared/source/command_stream/create_command_stream_impl.cpp +++ b/shared/source/command_stream/create_command_stream_impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -27,25 +27,23 @@ CommandStreamReceiver *createCommandStreamImpl(ExecutionEnvironment &executionEn return nullptr; } CommandStreamReceiver *commandStreamReceiver = nullptr; - int32_t csr = debugManager.flags.SetCommandStreamReceiver.get(); - if (csr < 0) { - csr = CommandStreamReceiverType::CSR_HW; - } + CommandStreamReceiverType csrType = obtainCsrTypeFromIntegerValue(debugManager.flags.SetCommandStreamReceiver.get(), CommandStreamReceiverType::hardware); - switch (csr) { - case CSR_HW: + switch (csrType) { + case CommandStreamReceiverType::hardware: commandStreamReceiver = funcCreate(false, executionEnvironment, rootDeviceIndex, deviceBitfield); break; - case CSR_AUB: + case CommandStreamReceiverType::aub: + case CommandStreamReceiverType::nullAub: commandStreamReceiver = AUBCommandStreamReceiver::create(ApiSpecificConfig::getName(), true, executionEnvironment, rootDeviceIndex, deviceBitfield); break; - case CSR_TBX: + case CommandStreamReceiverType::tbx: commandStreamReceiver = TbxCommandStreamReceiver::create("", false, executionEnvironment, rootDeviceIndex, deviceBitfield); break; - case CSR_HW_WITH_AUB: + case CommandStreamReceiverType::hardwareWithAub: commandStreamReceiver = funcCreate(true, executionEnvironment, rootDeviceIndex, deviceBitfield); break; - case CSR_TBX_WITH_AUB: + case CommandStreamReceiverType::tbxWithAub: commandStreamReceiver = TbxCommandStreamReceiver::create(ApiSpecificConfig::getName(), true, executionEnvironment, rootDeviceIndex, deviceBitfield); break; default: diff --git a/shared/source/command_stream/tbx_command_stream_receiver_hw.h b/shared/source/command_stream/tbx_command_stream_receiver_hw.h index cfab1db005..62631ccc56 100644 --- a/shared/source/command_stream/tbx_command_stream_receiver_hw.h +++ b/shared/source/command_stream/tbx_command_stream_receiver_hw.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -95,7 +95,7 @@ class TbxCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw allocationsForDownload = {}; CommandStreamReceiverType getType() const override { - return CommandStreamReceiverType::CSR_TBX; + return CommandStreamReceiverType::tbx; } bool dumpTbxNonWritable = false; diff --git a/shared/source/command_stream/tbx_command_stream_receiver_hw.inl b/shared/source/command_stream/tbx_command_stream_receiver_hw.inl index 81c9d41a85..1e4676bae5 100644 --- a/shared/source/command_stream/tbx_command_stream_receiver_hw.inl +++ b/shared/source/command_stream/tbx_command_stream_receiver_hw.inl @@ -179,7 +179,7 @@ CommandStreamReceiver *TbxCommandStreamReceiverHw::create(const std:: if (debugManager.flags.AUBDumpCaptureFileName.get() != "unk") { fullName.assign(debugManager.flags.AUBDumpCaptureFileName.get()); } - rootDeviceEnvironment.initAubCenter(localMemoryEnabled, fullName, CommandStreamReceiverType::CSR_TBX_WITH_AUB); + rootDeviceEnvironment.initAubCenter(localMemoryEnabled, fullName, CommandStreamReceiverType::tbxWithAub); csr = new CommandStreamReceiverWithAUBDump>(baseName, executionEnvironment, rootDeviceIndex, deviceBitfield); diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index 53ddf7f1f3..6b58ad4139 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -26,7 +26,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, AUBDumpToggleCaptureOnOff, 0, "Toggle AUB captur DECLARE_DEBUG_VARIABLE(int32_t, AubDumpOverrideMmioRegister, 0, "Override mmio offset from list with new value from AubDumpOverrideMmioRegisterValue") DECLARE_DEBUG_VARIABLE(int32_t, AubDumpOverrideMmioRegisterValue, 0, "Value to override mmio offset from AubDumpOverrideMmioRegister") DECLARE_DEBUG_VARIABLE(int32_t, ClDeviceGlobalMemSizeAvailablePercent, -1, "Percent of total GPU memory available; CL_DEVICE_GLOBAL_MEM_SIZE") -DECLARE_DEBUG_VARIABLE(int32_t, SetCommandStreamReceiver, -1, "Set command stream receiver to: 0 - HW, 1 - AUB, 2 - TBX, 3 - HW & AUB, 4 - TBX & AUB") +DECLARE_DEBUG_VARIABLE(int32_t, SetCommandStreamReceiver, -1, "Set command stream receiver to: 0 - HW, 1 - AUB, 2 - TBX, 3 - HW & AUB, 4 - TBX & AUB, 5 - NULL AUB") DECLARE_DEBUG_VARIABLE(int32_t, TbxPort, 4321, "TCP-IP port of TBX server") DECLARE_DEBUG_VARIABLE(int32_t, HBMSizePerTileInGigabytes, 0, "Size of HBM memory in GigaBytes per tile.") DECLARE_DEBUG_VARIABLE(bool, TbxFrontdoorMode, false, "Set TBX frontdoor mode for read and write memory accesses (the default mode is via backdoor)") diff --git a/shared/source/device/device.cpp b/shared/source/device/device.cpp index 00fc2a1cf1..6b9359f49c 100644 --- a/shared/source/device/device.cpp +++ b/shared/source/device/device.cpp @@ -756,7 +756,7 @@ bool Device::isFullRangeSvm() const { } EngineControl &Device::getInternalEngine() { - if (this->allEngines[0].commandStreamReceiver->getType() != CommandStreamReceiverType::CSR_HW) { + if (this->allEngines[0].commandStreamReceiver->getType() != CommandStreamReceiverType::hardware) { return this->getDefaultEngine(); } diff --git a/shared/source/dll/device_dll.cpp b/shared/source/dll/device_dll.cpp index 45879d086b..186ffb6fa7 100644 --- a/shared/source/dll/device_dll.cpp +++ b/shared/source/dll/device_dll.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2023 Intel Corporation + * Copyright (C) 2022-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -14,7 +14,7 @@ bool Device::isBlitSplitEnabled() { } bool Device::isInitDeviceWithFirstSubmissionEnabled(CommandStreamReceiverType csrType) { - return csrType == CommandStreamReceiverType::CSR_HW; + return csrType == CommandStreamReceiverType::hardware; } } // namespace NEO diff --git a/shared/source/execution_environment/execution_environment.cpp b/shared/source/execution_environment/execution_environment.cpp index 75fe6b239a..870b00515a 100644 --- a/shared/source/execution_environment/execution_environment.cpp +++ b/shared/source/execution_environment/execution_environment.cpp @@ -62,19 +62,17 @@ bool ExecutionEnvironment::initializeMemoryManager() { return memoryManager->isInitialized(); } - int32_t setCommandStreamReceiverType = CommandStreamReceiverType::CSR_HW; - if (debugManager.flags.SetCommandStreamReceiver.get() >= 0) { - setCommandStreamReceiverType = debugManager.flags.SetCommandStreamReceiver.get(); - } + auto csrType = obtainCsrTypeFromIntegerValue(debugManager.flags.SetCommandStreamReceiver.get(), CommandStreamReceiverType::hardware); - switch (setCommandStreamReceiverType) { - case CommandStreamReceiverType::CSR_TBX: - case CommandStreamReceiverType::CSR_TBX_WITH_AUB: - case CommandStreamReceiverType::CSR_AUB: + switch (csrType) { + case CommandStreamReceiverType::tbx: + case CommandStreamReceiverType::tbxWithAub: + case CommandStreamReceiverType::aub: + case CommandStreamReceiverType::nullAub: memoryManager = std::make_unique(*this); break; - case CommandStreamReceiverType::CSR_HW: - case CommandStreamReceiverType::CSR_HW_WITH_AUB: + case CommandStreamReceiverType::hardware: + case CommandStreamReceiverType::hardwareWithAub: default: { auto driverModelType = DriverModelType::unknown; if (this->rootDeviceEnvironments[0]->osInterface && this->rootDeviceEnvironments[0]->osInterface->getDriverModel()) { diff --git a/shared/source/helpers/gfx_core_helper_base.inl b/shared/source/helpers/gfx_core_helper_base.inl index ce43cdcbe3..05bb8235df 100644 --- a/shared/source/helpers/gfx_core_helper_base.inl +++ b/shared/source/helpers/gfx_core_helper_base.inl @@ -447,7 +447,7 @@ inline uint32_t GfxCoreHelperHw::getMinimalSIMDSize() const { template std::unique_ptr GfxCoreHelperHw::createTimestampPacketAllocator(const RootDeviceIndicesContainer &rootDeviceIndices, MemoryManager *memoryManager, size_t initialTagCount, CommandStreamReceiverType csrType, DeviceBitfield deviceBitfield) const { - bool doNotReleaseNodes = (csrType > CommandStreamReceiverType::CSR_HW) || + bool doNotReleaseNodes = (csrType > CommandStreamReceiverType::hardware) || debugManager.flags.DisableTimestampPacketOptimizations.get(); auto tagAlignment = getTimestampPacketAllocatorAlignment(); diff --git a/shared/source/helpers/options.h b/shared/source/helpers/options.h index cdf9203647..f382bcf13d 100644 --- a/shared/source/helpers/options.h +++ b/shared/source/helpers/options.h @@ -9,21 +9,29 @@ #include namespace NEO { -enum CommandStreamReceiverType { +enum class CommandStreamReceiverType { // Use receiver for real HW - CSR_HW = 0, + hardware = 0, // Capture an AUB file automatically for all traffic going through Device -> CommandStreamReceiver - CSR_AUB, + aub, // Capture an AUB and tunnel all commands going through Device -> CommandStreamReceiver to a TBX server - CSR_TBX, + tbx, // Use receiver for real HW and capture AUB file - CSR_HW_WITH_AUB, + hardwareWithAub, // Use TBX server and capture AUB file - CSR_TBX_WITH_AUB, + tbxWithAub, + // all traffic goes through AUB path but aubstream creates no file + nullAub, // Number of CSR types - CSR_TYPES_NUM + typesNum }; +inline CommandStreamReceiverType obtainCsrTypeFromIntegerValue(int32_t selectedCsrType, CommandStreamReceiverType defaultType) { + if (selectedCsrType >= 0 && selectedCsrType <= static_cast(CommandStreamReceiverType::typesNum)) { + return static_cast(selectedCsrType); + } + return defaultType; +} // AUB file folder location extern const char *folderAUB; diff --git a/shared/source/helpers/windows/gmm_callbacks_tgllp_and_later.inl b/shared/source/helpers/windows/gmm_callbacks_tgllp_and_later.inl index db5bf5f838..8b6c8463ec 100644 --- a/shared/source/helpers/windows/gmm_callbacks_tgllp_and_later.inl +++ b/shared/source/helpers/windows/gmm_callbacks_tgllp_and_later.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2023 Intel Corporation + * Copyright (C) 2019-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -18,7 +18,7 @@ template long __stdcall DeviceCallbacks::notifyAubCapture(void *csrHandle, uint64_t gfxAddress, size_t gfxSize, bool allocate) { auto csr = reinterpret_cast *>(csrHandle); - if (debugManager.flags.SetCommandStreamReceiver.get() == CSR_HW_WITH_AUB) { + if (obtainCsrTypeFromIntegerValue(debugManager.flags.SetCommandStreamReceiver.get(), CommandStreamReceiverType::hardware) == CommandStreamReceiverType::hardwareWithAub) { auto csrWithAub = static_cast> *>(csr); auto aubCsr = static_cast *>(csrWithAub->aubCSR.get()); if (allocate) { diff --git a/shared/source/os_interface/device_factory.cpp b/shared/source/os_interface/device_factory.cpp index d15557fff4..c0237b473f 100644 --- a/shared/source/os_interface/device_factory.cpp +++ b/shared/source/os_interface/device_factory.cpp @@ -128,11 +128,13 @@ bool DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(ExecutionE } bool DeviceFactory::isHwModeSelected() { - int32_t csr = debugManager.flags.SetCommandStreamReceiver.get(); - switch (csr) { - case CSR_AUB: - case CSR_TBX: - case CSR_TBX_WITH_AUB: + + CommandStreamReceiverType csrType = obtainCsrTypeFromIntegerValue(debugManager.flags.SetCommandStreamReceiver.get(), CommandStreamReceiverType::hardware); + switch (csrType) { + case CommandStreamReceiverType::aub: + case CommandStreamReceiverType::tbx: + case CommandStreamReceiverType::tbxWithAub: + case CommandStreamReceiverType::nullAub: return false; default: return true; diff --git a/shared/source/os_interface/linux/drm_memory_operations_handler_with_aub_dump.h b/shared/source/os_interface/linux/drm_memory_operations_handler_with_aub_dump.h index 294e26e88c..37eef95270 100644 --- a/shared/source/os_interface/linux/drm_memory_operations_handler_with_aub_dump.h +++ b/shared/source/os_interface/linux/drm_memory_operations_handler_with_aub_dump.h @@ -27,7 +27,7 @@ class DrmMemoryOperationsHandlerWithAubDump : public BaseOperationsHandler { auto hardwareInfo = rootDeviceEnvironment.getMutableHardwareInfo(); auto localMemoryEnabled = gfxCoreHelper.getEnableLocalMemory(*hardwareInfo); rootDeviceEnvironment.initGmm(); - rootDeviceEnvironment.initAubCenter(localMemoryEnabled, "", static_cast(CommandStreamReceiverType::CSR_HW_WITH_AUB)); + rootDeviceEnvironment.initAubCenter(localMemoryEnabled, "", static_cast(CommandStreamReceiverType::hardwareWithAub)); } const auto aubCenter = rootDeviceEnvironment.aubCenter.get(); diff --git a/shared/source/os_interface/linux/os_interface_linux.cpp b/shared/source/os_interface/linux/os_interface_linux.cpp index bb7d9c338d..433aedc4d2 100644 --- a/shared/source/os_interface/linux/os_interface_linux.cpp +++ b/shared/source/os_interface/linux/os_interface_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 Intel Corporation + * Copyright (C) 2020-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -52,7 +52,7 @@ bool initDrmOsInterface(std::unique_ptr &&hwDeviceId, uint32_t rootD return false; } - const bool isCsrHwWithAub = debugManager.flags.SetCommandStreamReceiver.get() == CommandStreamReceiverType::CSR_HW_WITH_AUB; + const bool isCsrHwWithAub = obtainCsrTypeFromIntegerValue(debugManager.flags.SetCommandStreamReceiver.get(), CommandStreamReceiverType::hardware) == CommandStreamReceiverType::hardwareWithAub; rootDeviceEnv->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*drm, rootDeviceIndex, isCsrHwWithAub); return true; diff --git a/shared/source/os_interface/windows/init_wddm_os_interface.cpp b/shared/source/os_interface/windows/init_wddm_os_interface.cpp index c77895f206..7034ab92d2 100644 --- a/shared/source/os_interface/windows/init_wddm_os_interface.cpp +++ b/shared/source/os_interface/windows/init_wddm_os_interface.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2023 Intel Corporation + * Copyright (C) 2021-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -22,7 +22,7 @@ bool initWddmOsInterface(std::unique_ptr &&hwDeviceId, RootDeviceEnv return false; } - const bool isCsrHwWithAub = debugManager.flags.SetCommandStreamReceiver.get() == CommandStreamReceiverType::CSR_HW_WITH_AUB; + const bool isCsrHwWithAub = obtainCsrTypeFromIntegerValue(debugManager.flags.SetCommandStreamReceiver.get(), CommandStreamReceiverType::hardware) == CommandStreamReceiverType::hardwareWithAub; rootDeviceEnv->memoryOperationsInterface = WddmMemoryOperationsHandler::create(wddm, rootDeviceEnv, isCsrHwWithAub); return true; diff --git a/shared/source/os_interface/windows/wddm_memory_operations_handler_with_aub_dump.h b/shared/source/os_interface/windows/wddm_memory_operations_handler_with_aub_dump.h index a023e591f0..fbe4156612 100644 --- a/shared/source/os_interface/windows/wddm_memory_operations_handler_with_aub_dump.h +++ b/shared/source/os_interface/windows/wddm_memory_operations_handler_with_aub_dump.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Intel Corporation + * Copyright (C) 2023-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -27,7 +27,7 @@ class WddmMemoryOperationsHandlerWithAubDump : public BaseOperationsHandler { auto hardwareInfo = rootDeviceEnvironment.getMutableHardwareInfo(); auto localMemoryEnabled = gfxCoreHelper.getEnableLocalMemory(*hardwareInfo); rootDeviceEnvironment.initGmm(); - rootDeviceEnvironment.initAubCenter(localMemoryEnabled, "", static_cast(CommandStreamReceiverType::CSR_HW_WITH_AUB)); + rootDeviceEnvironment.initAubCenter(localMemoryEnabled, "", static_cast(CommandStreamReceiverType::hardwareWithAub)); } const auto aubCenter = rootDeviceEnvironment.aubCenter.get(); diff --git a/shared/source/page_fault_manager/cpu_page_fault_manager.cpp b/shared/source/page_fault_manager/cpu_page_fault_manager.cpp index da14b28479..5c72c941b2 100644 --- a/shared/source/page_fault_manager/cpu_page_fault_manager.cpp +++ b/shared/source/page_fault_manager/cpu_page_fault_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2023 Intel Corporation + * Copyright (C) 2019-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -143,7 +143,7 @@ inline void PageFaultManager::migrateStorageToCpuDomain(void *ptr, PageFaultData } void PageFaultManager::selectGpuDomainHandler() { - if (debugManager.flags.SetCommandStreamReceiver.get() > CommandStreamReceiverType::CSR_HW || debugManager.flags.NEO_CAL_ENABLED.get()) { + if (debugManager.flags.SetCommandStreamReceiver.get() > static_cast(CommandStreamReceiverType::hardware) || debugManager.flags.NEO_CAL_ENABLED.get()) { this->gpuDomainHandler = &PageFaultManager::unprotectAndTransferMemory; } } diff --git a/shared/test/common/common_main.cpp b/shared/test/common/common_main.cpp index fc57ccaabc..90c5c2e26d 100644 --- a/shared/test/common/common_main.cpp +++ b/shared/test/common/common_main.cpp @@ -199,7 +199,7 @@ int main(int argc, char **argv) { } else if (!strcmp("--disable_pagefaulting_tests", argv[i])) { // disable tests which raise page fault signal during execution NEO::PagaFaultManagerTestConfig::disabled = true; } else if (!strcmp("--tbx", argv[i])) { - if (testMode == TestMode::aubTests) { + if (isAubTestMode(testMode)) { testMode = TestMode::aubTestsWithTbx; } initialHardwareTag = 0; @@ -265,21 +265,26 @@ int main(int argc, char **argv) { } } else if (!strcmp("--generate_random_inputs", argv[i])) { generateRandomInput = true; - } else if (!strcmp("--read-config", argv[i]) && (testMode == TestMode::aubTests || testMode == TestMode::aubTestsWithTbx)) { + } else if (!strcmp("--read-config", argv[i]) && isAubTestMode(testMode)) { if (debugManager.registryReadAvailable()) { debugManager.setReaderImpl(SettingsReader::create(ApiSpecificConfig::getRegistryPath())); debugManager.injectSettingsFromReader(); } - } else if (!strcmp("--dump_buffer_format", argv[i]) && testMode == TestMode::aubTests) { + } else if (!strcmp("--dump_buffer_format", argv[i]) && isAubTestMode(testMode)) { ++i; std::string dumpBufferFormat(argv[i]); std::transform(dumpBufferFormat.begin(), dumpBufferFormat.end(), dumpBufferFormat.begin(), ::toupper); debugManager.flags.AUBDumpBufferFormat.set(dumpBufferFormat); - } else if (!strcmp("--dump_image_format", argv[i]) && testMode == TestMode::aubTests) { + } else if (!strcmp("--dump_image_format", argv[i]) && isAubTestMode(testMode)) { ++i; std::string dumpImageFormat(argv[i]); std::transform(dumpImageFormat.begin(), dumpImageFormat.end(), dumpImageFormat.begin(), ::toupper); debugManager.flags.AUBDumpImageFormat.set(dumpImageFormat); + } else if (!strcmp("--null_aubstream", argv[i])) { + if (isAubTestMode(testMode)) { + testMode = TestMode::aubTestsWithoutOutputFiles; + } + initialHardwareTag = 0; } } diff --git a/shared/test/common/fixtures/aub_fixtures/multicontext_aub_fixture.cpp b/shared/test/common/fixtures/aub_fixtures/multicontext_aub_fixture.cpp index 737285a4fe..c83d12b283 100644 --- a/shared/test/common/fixtures/aub_fixtures/multicontext_aub_fixture.cpp +++ b/shared/test/common/fixtures/aub_fixtures/multicontext_aub_fixture.cpp @@ -92,9 +92,9 @@ void MulticontextAubFixture::setUp(uint32_t numberOfTiles, EnabledCommandStreame debugManager.flags.AUBDumpCaptureFileName.set(filename); if (testMode == TestMode::aubTestsWithTbx) { - debugManager.flags.SetCommandStreamReceiver.set(static_cast(CommandStreamReceiverType::CSR_TBX_WITH_AUB)); + debugManager.flags.SetCommandStreamReceiver.set(static_cast(CommandStreamReceiverType::tbxWithAub)); } else { - debugManager.flags.SetCommandStreamReceiver.set(static_cast(CommandStreamReceiverType::CSR_AUB)); + debugManager.flags.SetCommandStreamReceiver.set(static_cast(CommandStreamReceiverType::aub)); } localHwInfo.capabilityTable.blitterOperationsSupported = true; diff --git a/shared/test/common/fixtures/mock_aub_center_fixture.cpp b/shared/test/common/fixtures/mock_aub_center_fixture.cpp index 8117299d4a..2ddea942b8 100644 --- a/shared/test/common/fixtures/mock_aub_center_fixture.cpp +++ b/shared/test/common/fixtures/mock_aub_center_fixture.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2023 Intel Corporation + * Copyright (C) 2022-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -18,7 +18,7 @@ namespace NEO { MockAubCenterFixture::MockAubCenterFixture(CommandStreamReceiverType commandStreamReceiverType) : commandStreamReceiverType(commandStreamReceiverType){}; void MockAubCenterFixture::setMockAubCenter(RootDeviceEnvironment &rootDeviceEnvironment) { - setMockAubCenter(rootDeviceEnvironment, CommandStreamReceiverType::CSR_AUB); + setMockAubCenter(rootDeviceEnvironment, CommandStreamReceiverType::aub); } void MockAubCenterFixture::setMockAubCenter(RootDeviceEnvironment &rootDeviceEnvironment, CommandStreamReceiverType commandStreamReceiverType) { if (testMode != TestMode::aubTests && testMode != TestMode::aubTestsWithTbx) { diff --git a/shared/test/common/fixtures/mock_aub_center_fixture.h b/shared/test/common/fixtures/mock_aub_center_fixture.h index 6d957b8744..adfc426fee 100644 --- a/shared/test/common/fixtures/mock_aub_center_fixture.h +++ b/shared/test/common/fixtures/mock_aub_center_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 Intel Corporation + * Copyright (C) 2019-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -25,6 +25,6 @@ struct MockAubCenterFixture { static void setMockAubCenter(RootDeviceEnvironment &rootDeviceEnvironment, CommandStreamReceiverType commandStreamReceiverType); protected: - CommandStreamReceiverType commandStreamReceiverType = CommandStreamReceiverType::CSR_AUB; + CommandStreamReceiverType commandStreamReceiverType = CommandStreamReceiverType::aub; }; } // namespace NEO diff --git a/shared/test/common/libult/ult_command_stream_receiver.h b/shared/test/common/libult/ult_command_stream_receiver.h index de9c3b5e6a..8677c46a8f 100644 --- a/shared/test/common/libult/ult_command_stream_receiver.h +++ b/shared/test/common/libult/ult_command_stream_receiver.h @@ -505,7 +505,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw, publ WaitStatus returnWaitForCompletionWithTimeout = WaitStatus::ready; std::optional waitForTaskCountWithKmdNotifyFallbackReturnValue{}; std::optional flushReturnValue{}; - CommandStreamReceiverType commandStreamReceiverType = CommandStreamReceiverType::CSR_HW; + CommandStreamReceiverType commandStreamReceiverType = CommandStreamReceiverType::hardware; std::atomic downloadAllocationsCalledCount = 0; bool cpuCopyForHostPtrSurfaceAllowed = false; diff --git a/shared/test/common/mocks/mock_command_stream_receiver.h b/shared/test/common/mocks/mock_command_stream_receiver.h index bc15399440..813737c001 100644 --- a/shared/test/common/mocks/mock_command_stream_receiver.h +++ b/shared/test/common/mocks/mock_command_stream_receiver.h @@ -254,7 +254,7 @@ class MockCommandStreamReceiver : public CommandStreamReceiver { std::optional isGpuHangDetectedReturnValue{}; std::optional testTaskCountReadyReturnValue{}; WaitStatus waitForCompletionWithTimeoutReturnValue{WaitStatus::ready}; - CommandStreamReceiverType commandStreamReceiverType = CommandStreamReceiverType::CSR_HW; + CommandStreamReceiverType commandStreamReceiverType = CommandStreamReceiverType::hardware; BatchBuffer latestFlushedBatchBuffer = {}; QueueThrottle getLastDirectSubmissionThrottleReturnValue = QueueThrottle::MEDIUM; bool getAcLineConnectedReturnValue = true; diff --git a/shared/test/common/mocks/mock_csr.h b/shared/test/common/mocks/mock_csr.h index 29adbbd943..a2d649ff21 100644 --- a/shared/test/common/mocks/mock_csr.h +++ b/shared/test/common/mocks/mock_csr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -88,7 +88,7 @@ class MockCsrAub : public MockCsrBase { const DeviceBitfield deviceBitfield) : MockCsrBase(execStamp, executionEnvironment, rootDeviceIndex, deviceBitfield) {} CommandStreamReceiverType getType() const override { - return CommandStreamReceiverType::CSR_AUB; + return CommandStreamReceiverType::aub; } }; diff --git a/shared/test/common/tests_configuration.h b/shared/test/common/tests_configuration.h index 2951856843..9ccf608517 100644 --- a/shared/test/common/tests_configuration.h +++ b/shared/test/common/tests_configuration.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,7 +15,15 @@ enum class TestMode { notSpecified, unitTests, aubTests, aubTestsWithTbx, - tbxTests }; + tbxTests, + aubTestsWithoutOutputFiles +}; + +inline bool isAubTestMode(TestMode testMode) { + return testMode == TestMode::aubTests || + testMode == TestMode::aubTestsWithTbx || + testMode == TestMode::aubTestsWithoutOutputFiles; +} extern TestMode testMode; diff --git a/shared/test/unit_test/aub/aub_center_tests.cpp b/shared/test/unit_test/aub/aub_center_tests.cpp index bc16c579d8..3cd9d0f46d 100644 --- a/shared/test/unit_test/aub/aub_center_tests.cpp +++ b/shared/test/unit_test/aub/aub_center_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -32,7 +32,7 @@ struct AubCenterTests : public ::testing::Test { TEST_F(AubCenterTests, GivenUseAubStreamDebugVariableNotSetWhenAubCenterIsCreatedThenAubCenterDoesNotCreateAubManager) { debugManager.flags.UseAubStream.set(false); - MockAubCenter aubCenter(rootDeviceEnvironment, false, "", CommandStreamReceiverType::CSR_AUB); + MockAubCenter aubCenter(rootDeviceEnvironment, false, "", CommandStreamReceiverType::aub); EXPECT_EQ(nullptr, aubCenter.aubManager.get()); } @@ -40,7 +40,7 @@ TEST_F(AubCenterTests, GivenDefaultSetCommandStreamReceiverFlagAndAubFileNameWhe debugManager.flags.UseAubStream.set(true); std::string aubFile("test.aub"); - auto mode = AubCenter::getAubStreamMode(aubFile, CommandStreamReceiverType::CSR_AUB); + auto mode = AubCenter::getAubStreamMode(aubFile, CommandStreamReceiverType::aub); EXPECT_EQ(aub_stream::mode::aubFile, mode); } @@ -49,7 +49,7 @@ TEST_F(AubCenterTests, GivenCsrHwAndEmptyAubFileNameWhenGettingAubStreamModeThen debugManager.flags.UseAubStream.set(true); std::string aubFile(""); - auto mode = AubCenter::getAubStreamMode(aubFile, CommandStreamReceiverType::CSR_HW); + auto mode = AubCenter::getAubStreamMode(aubFile, CommandStreamReceiverType::hardware); EXPECT_EQ(aub_stream::mode::aubFile, mode); } @@ -58,7 +58,7 @@ TEST_F(AubCenterTests, GivenCsrHwAndNotEmptyAubFileNameWhenGettingAubStreamModeT debugManager.flags.UseAubStream.set(true); std::string aubFile("test.aub"); - auto mode = AubCenter::getAubStreamMode(aubFile, CommandStreamReceiverType::CSR_HW); + auto mode = AubCenter::getAubStreamMode(aubFile, CommandStreamReceiverType::hardware); EXPECT_EQ(aub_stream::mode::aubFile, mode); } @@ -87,7 +87,7 @@ TEST_F(AubCenterTests, WhenAubManagerIsCreatedThenCorrectSteppingIsSet) { } hwInfo.platform.usRevId = hwRevId; - MockAubCenter aubCenter(rootDeviceEnvironment, false, "", CommandStreamReceiverType::CSR_AUB); + MockAubCenter aubCenter(rootDeviceEnvironment, false, "", CommandStreamReceiverType::aub); EXPECT_EQ(steppingPair.expectedAubStreamStepping, aubCenter.stepping); } } @@ -95,7 +95,7 @@ TEST_F(AubCenterTests, WhenAubManagerIsCreatedThenCorrectSteppingIsSet) { HWTEST_F(AubCenterTests, whenCreatingAubManagerThenCorrectProductFamilyIsPassed) { debugManager.flags.UseAubStream.set(true); - debugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_TBX); + debugManager.flags.SetCommandStreamReceiver.set(static_cast(CommandStreamReceiverType::tbx)); const auto &productHelper = rootDeviceEnvironment.getHelper(); @@ -103,7 +103,7 @@ HWTEST_F(AubCenterTests, whenCreatingAubManagerThenCorrectProductFamilyIsPassed) ASSERT_TRUE(aubStreamProductFamily.has_value()); - MockAubCenter aubCenter(rootDeviceEnvironment, true, "", CommandStreamReceiverType::CSR_AUB); + MockAubCenter aubCenter(rootDeviceEnvironment, true, "", CommandStreamReceiverType::aub); auto aubManager = static_cast(aubCenter.aubManager.get()); ASSERT_NE(nullptr, aubManager); @@ -116,13 +116,13 @@ TEST_F(AubCenterTests, GivenCsrTypeWhenGettingAubStreamModeThenCorrectModeIsRetu std::string aubFile("test.aub"); - auto mode = AubCenter::getAubStreamMode(aubFile, CommandStreamReceiverType::CSR_AUB); + auto mode = AubCenter::getAubStreamMode(aubFile, CommandStreamReceiverType::aub); EXPECT_EQ(aub_stream::mode::aubFile, mode); - mode = AubCenter::getAubStreamMode(aubFile, CommandStreamReceiverType::CSR_TBX); + mode = AubCenter::getAubStreamMode(aubFile, CommandStreamReceiverType::tbx); EXPECT_EQ(aub_stream::mode::tbx, mode); - mode = AubCenter::getAubStreamMode(aubFile, CommandStreamReceiverType::CSR_TBX_WITH_AUB); + mode = AubCenter::getAubStreamMode(aubFile, CommandStreamReceiverType::tbxWithAub); EXPECT_EQ(aub_stream::mode::aubFileAndTbx, mode); } @@ -130,40 +130,40 @@ TEST_F(AubCenterTests, GivenSetCommandStreamReceiverFlagEqualDefaultHwWhenAubMan debugManager.flags.UseAubStream.set(true); debugManager.flags.SetCommandStreamReceiver.set(-1); - std::vector aubTypes = {CommandStreamReceiverType::CSR_HW, - CommandStreamReceiverType::CSR_HW_WITH_AUB, - CommandStreamReceiverType::CSR_AUB}; + std::vector aubTypes = {CommandStreamReceiverType::hardware, + CommandStreamReceiverType::hardwareWithAub, + CommandStreamReceiverType::aub}; - for (auto type : aubTypes) { + for (auto &type : aubTypes) { MockAubCenter aubCenter(rootDeviceEnvironment, true, "test", type); EXPECT_EQ(aub_stream::mode::aubFile, aubCenter.aubStreamMode); } - MockAubCenter aubCenter2(rootDeviceEnvironment, true, "", CommandStreamReceiverType::CSR_TBX); + MockAubCenter aubCenter2(rootDeviceEnvironment, true, "", CommandStreamReceiverType::tbx); EXPECT_EQ(aub_stream::mode::tbx, aubCenter2.aubStreamMode); - MockAubCenter aubCenter3(rootDeviceEnvironment, true, "", CommandStreamReceiverType::CSR_TBX_WITH_AUB); + MockAubCenter aubCenter3(rootDeviceEnvironment, true, "", CommandStreamReceiverType::tbxWithAub); EXPECT_EQ(aub_stream::mode::aubFileAndTbx, aubCenter3.aubStreamMode); } TEST_F(AubCenterTests, GivenSetCommandStreamReceiverFlagSetWhenAubManagerIsCreatedThenDebugFlagDefinesAubStreamMode) { debugManager.flags.UseAubStream.set(true); - debugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_TBX); + debugManager.flags.SetCommandStreamReceiver.set(static_cast(CommandStreamReceiverType::tbx)); - MockAubCenter aubCenter(rootDeviceEnvironment, true, "", CommandStreamReceiverType::CSR_AUB); + MockAubCenter aubCenter(rootDeviceEnvironment, true, "", CommandStreamReceiverType::aub); EXPECT_EQ(aub_stream::mode::tbx, aubCenter.aubStreamMode); - debugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_TBX_WITH_AUB); + debugManager.flags.SetCommandStreamReceiver.set(static_cast(CommandStreamReceiverType::tbxWithAub)); - MockAubCenter aubCenter2(rootDeviceEnvironment, true, "", CommandStreamReceiverType::CSR_AUB); + MockAubCenter aubCenter2(rootDeviceEnvironment, true, "", CommandStreamReceiverType::aub); EXPECT_EQ(aub_stream::mode::aubFileAndTbx, aubCenter2.aubStreamMode); } TEST_F(AubCenterTests, GivenAubCenterInSubCaptureModeWhenItIsCreatedWithoutDebugFilterSettingsThenItInitializesSubCaptureFiltersWithDefaults) { debugManager.flags.AUBDumpSubCaptureMode.set(static_cast(AubSubCaptureManager::SubCaptureMode::filter)); - MockAubCenter aubCenter(rootDeviceEnvironment, false, "", CommandStreamReceiverType::CSR_AUB); + MockAubCenter aubCenter(rootDeviceEnvironment, false, "", CommandStreamReceiverType::aub); auto subCaptureCommon = aubCenter.getSubCaptureCommon(); EXPECT_NE(nullptr, subCaptureCommon); @@ -178,7 +178,7 @@ TEST_F(AubCenterTests, GivenAubCenterInSubCaptureModeWhenItIsCreatedWithDebugFil debugManager.flags.AUBDumpFilterKernelEndIdx.set(100); debugManager.flags.AUBDumpFilterKernelName.set("kernel_name"); - MockAubCenter aubCenter(rootDeviceEnvironment, false, "", CommandStreamReceiverType::CSR_AUB); + MockAubCenter aubCenter(rootDeviceEnvironment, false, "", CommandStreamReceiverType::aub); auto subCaptureCommon = aubCenter.getSubCaptureCommon(); EXPECT_NE(nullptr, subCaptureCommon); diff --git a/shared/test/unit_test/command_stream/aub_command_stream_receiver_1_tests.cpp b/shared/test/unit_test/command_stream/aub_command_stream_receiver_1_tests.cpp index 9a0c4cf2de..02b9b130fb 100644 --- a/shared/test/unit_test/command_stream/aub_command_stream_receiver_1_tests.cpp +++ b/shared/test/unit_test/command_stream/aub_command_stream_receiver_1_tests.cpp @@ -87,7 +87,7 @@ TEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenItIsCreat TEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenTypeIsCheckedThenAubCsrIsReturned) { std::unique_ptr aubCsr(AUBCommandStreamReceiver::create("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())); EXPECT_NE(nullptr, aubCsr); - EXPECT_EQ(CommandStreamReceiverType::CSR_AUB, aubCsr->getType()); + EXPECT_EQ(CommandStreamReceiverType::aub, aubCsr->getType()); } HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenItIsCreatedThenAubManagerAndHardwareContextAreNull) { @@ -173,7 +173,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenMultipl HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWithAubManagerWhenItIsCreatedThenFileIsCreated) { std::string fileName = "file_name.aub"; MockAubManager *mockManager = new MockAubManager(); - MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, fileName, CommandStreamReceiverType::CSR_AUB); + MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, fileName, CommandStreamReceiverType::aub); mockAubCenter->aubManager = std::unique_ptr(mockManager); pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); @@ -189,7 +189,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCsrWhenOsContextIsSetThenCreateH MockOsContext osContext(0, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::regular}, DeviceBitfield(8))); std::string fileName = "file_name.aub"; MockAubManager *mockManager = new MockAubManager(); - MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, fileName, CommandStreamReceiverType::CSR_AUB); + MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, fileName, CommandStreamReceiverType::aub); mockAubCenter->aubManager = std::unique_ptr(mockManager); pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); @@ -206,7 +206,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCsrAndHighPriorityContextWhenOsC MockOsContext osContext(0, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::highPriority}, DeviceBitfield(1))); std::string fileName = "file_name.aub"; MockAubManager *mockManager = new MockAubManager(); - MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, fileName, CommandStreamReceiverType::CSR_AUB); + MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, fileName, CommandStreamReceiverType::aub); mockAubCenter->aubManager = std::unique_ptr(mockManager); pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); @@ -221,7 +221,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCsrWhenLowPriorityOsContextIsSet MockOsContext osContext(0, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::lowPriority})); std::string fileName = "file_name.aub"; MockAubManager *mockManager = new MockAubManager(); - MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, fileName, CommandStreamReceiverType::CSR_AUB); + MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, fileName, CommandStreamReceiverType::aub); mockAubCenter->aubManager = std::unique_ptr(mockManager); pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); diff --git a/shared/test/unit_test/command_stream/aub_command_stream_receiver_3_tests.cpp b/shared/test/unit_test/command_stream/aub_command_stream_receiver_3_tests.cpp index 0db1c6f9aa..c7d98b2d55 100644 --- a/shared/test/unit_test/command_stream/aub_command_stream_receiver_3_tests.cpp +++ b/shared/test/unit_test/command_stream/aub_command_stream_receiver_3_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -327,7 +327,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenCompressedGraphicsAllocationWritabl debugManager.flags.AUBDumpBufferFormat.set("TRE"); auto gmmHelper = pDevice->executionEnvironment->rootDeviceEnvironments[0]->getGmmHelper(); - MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, "aubfile", CommandStreamReceiverType::CSR_AUB); + MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, "aubfile", CommandStreamReceiverType::aub); mockAubCenter->aubManager = std::make_unique(); pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter.reset(mockAubCenter); diff --git a/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp b/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp index ce0e138f13..9260090457 100644 --- a/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp +++ b/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp @@ -3218,19 +3218,19 @@ HWTEST_F(CommandStreamReceiverHwTest, whenFlushTaskCalledThenSetPassNumClients) HWTEST_F(CommandStreamReceiverHwTest, givenVariousCsrModeWhenGettingTbxModeThenExpectOnlyWhenModeIsTbxOrTbxWithAub) { auto &ultCsr = pDevice->getUltCommandStreamReceiver(); - ultCsr.commandStreamReceiverType = CommandStreamReceiverType::CSR_HW; + ultCsr.commandStreamReceiverType = CommandStreamReceiverType::hardware; EXPECT_FALSE(ultCsr.isTbxMode()); - ultCsr.commandStreamReceiverType = CommandStreamReceiverType::CSR_HW_WITH_AUB; + ultCsr.commandStreamReceiverType = CommandStreamReceiverType::hardwareWithAub; EXPECT_FALSE(ultCsr.isTbxMode()); - ultCsr.commandStreamReceiverType = CommandStreamReceiverType::CSR_AUB; + ultCsr.commandStreamReceiverType = CommandStreamReceiverType::aub; EXPECT_FALSE(ultCsr.isTbxMode()); - ultCsr.commandStreamReceiverType = CommandStreamReceiverType::CSR_TBX; + ultCsr.commandStreamReceiverType = CommandStreamReceiverType::tbx; EXPECT_TRUE(ultCsr.isTbxMode()); - ultCsr.commandStreamReceiverType = CommandStreamReceiverType::CSR_TBX_WITH_AUB; + ultCsr.commandStreamReceiverType = CommandStreamReceiverType::tbxWithAub; EXPECT_TRUE(ultCsr.isTbxMode()); } diff --git a/shared/test/unit_test/command_stream/command_stream_receiver_with_aub_dump_tests.cpp b/shared/test/unit_test/command_stream/command_stream_receiver_with_aub_dump_tests.cpp index a4eae7ee04..b12d27f3c6 100644 --- a/shared/test/unit_test/command_stream/command_stream_receiver_with_aub_dump_tests.cpp +++ b/shared/test/unit_test/command_stream/command_stream_receiver_with_aub_dump_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -204,13 +204,13 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenAubManagerAvailableWhe executionEnvironment->initializeMemoryManager(); std::string fileName = "file_name.aub"; MockAubManager *mockManager = new MockAubManager(); - MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, fileName, CommandStreamReceiverType::CSR_TBX_WITH_AUB); + MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, fileName, CommandStreamReceiverType::tbxWithAub); mockAubCenter->aubManager = std::unique_ptr(mockManager); executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); DeviceBitfield deviceBitfield(1); CommandStreamReceiverWithAUBDump> csrWithAubDump("aubfile", *executionEnvironment, 0, deviceBitfield); ASSERT_EQ(nullptr, csrWithAubDump.aubCSR); - EXPECT_EQ(CommandStreamReceiverType::CSR_TBX_WITH_AUB, csrWithAubDump.getType()); + EXPECT_EQ(CommandStreamReceiverType::tbxWithAub, csrWithAubDump.getType()); } HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenAubManagerAvailableWhenHwCsrWithAubDumpIsCreatedThenAubCsrIsCreated) { @@ -219,21 +219,21 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenAubManagerAvailableWhe std::string fileName = "file_name.aub"; MockAubManager *mockManager = new MockAubManager(); - MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, fileName, CommandStreamReceiverType::CSR_HW_WITH_AUB); + MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, fileName, CommandStreamReceiverType::hardwareWithAub); mockAubCenter->aubManager = std::unique_ptr(mockManager); executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); DeviceBitfield deviceBitfield(1); CommandStreamReceiverWithAUBDump> csrWithAubDump("aubfile", *executionEnvironment, 0, deviceBitfield); ASSERT_NE(nullptr, csrWithAubDump.aubCSR); - EXPECT_EQ(CommandStreamReceiverType::CSR_HW_WITH_AUB, csrWithAubDump.getType()); + EXPECT_EQ(CommandStreamReceiverType::hardwareWithAub, csrWithAubDump.getType()); } HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenCsrWithAubDumpWhenWaitingForTaskCountThenAddPollForCompletion) { auto executionEnvironment = pDevice->getExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); - MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, "file_name.aub", CommandStreamReceiverType::CSR_HW_WITH_AUB); + MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, "file_name.aub", CommandStreamReceiverType::hardwareWithAub); mockAubCenter->aubManager = std::unique_ptr(new MockAubManager()); executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); @@ -257,7 +257,7 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenCsrWithAubDumpWhenPoll auto executionEnvironment = pDevice->getExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); - MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, "file_name.aub", CommandStreamReceiverType::CSR_HW_WITH_AUB); + MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, "file_name.aub", CommandStreamReceiverType::hardwareWithAub); mockAubCenter->aubManager = std::unique_ptr(new MockAubManager()); executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); @@ -346,7 +346,7 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenCsrWithAubDumpWhenCrea auto executionEnvironment = pDevice->getExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); - MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, "file_name.aub", CommandStreamReceiverType::CSR_HW_WITH_AUB); + MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, "file_name.aub", CommandStreamReceiverType::hardwareWithAub); mockAubCenter->aubManager = std::unique_ptr(new MockAubManager()); executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); @@ -371,7 +371,7 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenAubCsrWithHwWhenAdding auto executionEnvironment = pDevice->getExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); - MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, "file_name.aub", CommandStreamReceiverType::CSR_HW_WITH_AUB); + MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, "file_name.aub", CommandStreamReceiverType::hardwareWithAub); auto mockAubManager = new MockAubManager(); mockAubCenter->aubManager.reset(mockAubManager); @@ -388,7 +388,7 @@ HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenAubCsrWithTbxWhenAddin auto executionEnvironment = pDevice->getExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); - MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, "file_name.aub", CommandStreamReceiverType::CSR_TBX_WITH_AUB); + MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, "file_name.aub", CommandStreamReceiverType::tbxWithAub); auto mockAubManager = new MockAubManager(); mockAubCenter->aubManager.reset(mockAubManager); @@ -442,7 +442,7 @@ struct CommandStreamReceiverTagTests : public ::testing::Test { executionEnvironment->initializeMemoryManager(); MockAubManager *mockManager = new MockAubManager(); - MockAubCenter *mockAubCenter = new MockAubCenter(*executionEnvironment->rootDeviceEnvironments[0], false, fileName, CommandStreamReceiverType::CSR_HW_WITH_AUB); + MockAubCenter *mockAubCenter = new MockAubCenter(*executionEnvironment->rootDeviceEnvironments[0], false, fileName, CommandStreamReceiverType::hardwareWithAub); mockAubCenter->aubManager = std::unique_ptr(mockManager); executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); diff --git a/shared/test/unit_test/command_stream/get_devices_tests.cpp b/shared/test/unit_test/command_stream/get_devices_tests.cpp index 0f88f353d0..a286f76666 100644 --- a/shared/test/unit_test/command_stream/get_devices_tests.cpp +++ b/shared/test/unit_test/command_stream/get_devices_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -68,13 +68,13 @@ TEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsWithPciPathW GTEST_SKIP(); } - for (int csrTypes = -1; csrTypes <= CSR_TYPES_NUM; csrTypes++) { + for (int csrTypes = -1; csrTypes <= static_cast(CommandStreamReceiverType::typesNum); csrTypes++) { CommandStreamReceiverType csrType; if (csrTypes != -1) { csrType = static_cast(csrTypes); - debugManager.flags.SetCommandStreamReceiver.set(csrType); + debugManager.flags.SetCommandStreamReceiver.set(csrTypes); } else { - csrType = CSR_HW; + csrType = CommandStreamReceiverType::hardware; debugManager.flags.SetCommandStreamReceiver.set(-1); } @@ -90,9 +90,9 @@ TEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsWithPciPathW hwInfo = exeEnv.rootDeviceEnvironments[i]->getHardwareInfo(); switch (csrType) { - case CSR_HW: - case CSR_HW_WITH_AUB: - case CSR_TYPES_NUM: + case CommandStreamReceiverType::hardware: + case CommandStreamReceiverType::hardwareWithAub: + case CommandStreamReceiverType::typesNum: EXPECT_TRUE(ret); EXPECT_NE(nullptr, hwInfo); break; @@ -112,13 +112,13 @@ TEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsWithPciPathF GTEST_SKIP(); } - for (int csrTypes = -1; csrTypes <= CSR_TYPES_NUM; csrTypes++) { + for (int csrTypes = -1; csrTypes <= static_cast(CommandStreamReceiverType::typesNum); csrTypes++) { CommandStreamReceiverType csrType; if (csrTypes != -1) { csrType = static_cast(csrTypes); - debugManager.flags.SetCommandStreamReceiver.set(csrType); + debugManager.flags.SetCommandStreamReceiver.set(csrTypes); } else { - csrType = CSR_HW; + csrType = CommandStreamReceiverType::hardware; debugManager.flags.SetCommandStreamReceiver.set(-1); } @@ -134,9 +134,9 @@ TEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsWithPciPathF hwInfo = exeEnv.rootDeviceEnvironments[i]->getHardwareInfo(); switch (csrType) { - case CSR_HW: - case CSR_HW_WITH_AUB: - case CSR_TYPES_NUM: + case CommandStreamReceiverType::hardware: + case CommandStreamReceiverType::hardwareWithAub: + case CommandStreamReceiverType::typesNum: EXPECT_TRUE(ret); EXPECT_NE(nullptr, hwInfo); break; @@ -156,13 +156,13 @@ HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsForDepreca GTEST_SKIP(); } - for (int csrTypes = -1; csrTypes <= CSR_TYPES_NUM; csrTypes++) { + for (int csrTypes = -1; csrTypes <= static_cast(CommandStreamReceiverType::typesNum); csrTypes++) { CommandStreamReceiverType csrType; if (csrTypes != -1) { csrType = static_cast(csrTypes); - debugManager.flags.SetCommandStreamReceiver.set(csrType); + debugManager.flags.SetCommandStreamReceiver.set(csrTypes); } else { - csrType = CSR_HW; + csrType = CommandStreamReceiverType::hardware; debugManager.flags.SetCommandStreamReceiver.set(-1); } @@ -177,14 +177,15 @@ HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsForDepreca auto &productHelper = exeEnv.rootDeviceEnvironments[i]->getProductHelper(); auto releaseHelper = exeEnv.rootDeviceEnvironments[i]->getReleaseHelper(); switch (csrType) { - case CSR_HW: - case CSR_HW_WITH_AUB: + case CommandStreamReceiverType::hardware: + case CommandStreamReceiverType::hardwareWithAub: EXPECT_TRUE(ret); EXPECT_NE(nullptr, hwInfo); break; - case CSR_AUB: - case CSR_TBX: - case CSR_TBX_WITH_AUB: { + case CommandStreamReceiverType::aub: + case CommandStreamReceiverType::tbx: + case CommandStreamReceiverType::nullAub: + case CommandStreamReceiverType::tbxWithAub: { EXPECT_TRUE(ret); EXPECT_NE(nullptr, hwInfo); @@ -232,13 +233,13 @@ HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsWhenCsrIsS GTEST_SKIP(); } - for (int csrTypes = -1; csrTypes <= CSR_TYPES_NUM; csrTypes++) { + for (int csrTypes = -1; csrTypes <= static_cast(CommandStreamReceiverType::typesNum); csrTypes++) { CommandStreamReceiverType csrType; if (csrTypes != -1) { csrType = static_cast(csrTypes); - debugManager.flags.SetCommandStreamReceiver.set(csrType); + debugManager.flags.SetCommandStreamReceiver.set(csrTypes); } else { - csrType = CSR_HW; + csrType = CommandStreamReceiverType::hardware; debugManager.flags.SetCommandStreamReceiver.set(-1); } @@ -255,14 +256,15 @@ HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsWhenCsrIsS auto releaseHelper = exeEnv.rootDeviceEnvironments[i]->getReleaseHelper(); switch (csrType) { - case CSR_HW: - case CSR_HW_WITH_AUB: + case CommandStreamReceiverType::hardware: + case CommandStreamReceiverType::hardwareWithAub: EXPECT_TRUE(ret); EXPECT_NE(nullptr, hwInfo); break; - case CSR_AUB: - case CSR_TBX: - case CSR_TBX_WITH_AUB: { + case CommandStreamReceiverType::aub: + case CommandStreamReceiverType::nullAub: + case CommandStreamReceiverType::tbx: + case CommandStreamReceiverType::tbxWithAub: { EXPECT_TRUE(ret); EXPECT_NE(nullptr, hwInfo); @@ -293,7 +295,7 @@ HWTEST_F(PrepareDeviceEnvironmentsTest, givenUpperCaseDeprecatedAcronymsToProduc std::transform(deprecatedAcronym.begin(), deprecatedAcronym.end(), deprecatedAcronym.begin(), ::toupper); debugManager.flags.ProductFamilyOverride.set(deprecatedAcronym); - debugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_AUB); + debugManager.flags.SetCommandStreamReceiver.set(static_cast(CommandStreamReceiverType::aub)); MockExecutionEnvironment exeEnv; bool ret = prepareDeviceEnvironments(exeEnv); @@ -314,7 +316,7 @@ HWTEST_F(PrepareDeviceEnvironmentsTest, givenUpperCaseProductFamilyOverrideFlagS std::transform(product.begin(), product.end(), product.begin(), ::toupper); debugManager.flags.ProductFamilyOverride.set(product); - debugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_AUB); + debugManager.flags.SetCommandStreamReceiver.set(static_cast(CommandStreamReceiverType::aub)); MockExecutionEnvironment exeEnv; bool ret = prepareDeviceEnvironments(exeEnv); @@ -326,11 +328,11 @@ HWTEST_F(PrepareDeviceEnvironmentsTest, givenUpperCaseProductFamilyOverrideFlagS HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsAndUnknownProductFamilyWhenCsrIsSetToValidTypeThenTheFunctionReturnsTheExpectedValueOfHardwareInfo) { uint32_t expectedDevices = 1; debugManager.flags.CreateMultipleRootDevices.set(expectedDevices); - for (int csrTypes = 0; csrTypes <= CSR_TYPES_NUM; csrTypes++) { + for (int csrTypes = 0; csrTypes <= static_cast(CommandStreamReceiverType::typesNum); csrTypes++) { CommandStreamReceiverType csrType = static_cast(csrTypes); std::string productFamily("unk"); - debugManager.flags.SetCommandStreamReceiver.set(csrType); + debugManager.flags.SetCommandStreamReceiver.set(csrTypes); debugManager.flags.ProductFamilyOverride.set(productFamily); MockExecutionEnvironment exeEnv; exeEnv.prepareRootDeviceEnvironments(expectedDevices); @@ -343,13 +345,14 @@ HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsAndUnknown auto releaseHelper = exeEnv.rootDeviceEnvironments[i]->getReleaseHelper(); switch (csrType) { - case CSR_HW: - case CSR_HW_WITH_AUB: + case CommandStreamReceiverType::hardware: + case CommandStreamReceiverType::hardwareWithAub: EXPECT_TRUE(ret); break; - case CSR_AUB: - case CSR_TBX: - case CSR_TBX_WITH_AUB: { + case CommandStreamReceiverType::aub: + case CommandStreamReceiverType::nullAub: + case CommandStreamReceiverType::tbx: + case CommandStreamReceiverType::tbxWithAub: { EXPECT_TRUE(ret); EXPECT_NE(nullptr, hwInfo); for (i = 0; i < IGFX_MAX_PRODUCT; i++) { diff --git a/shared/test/unit_test/command_stream/tbx_command_stream_tests.cpp b/shared/test/unit_test/command_stream/tbx_command_stream_tests.cpp index 9ce62c0cb6..73a0fda376 100644 --- a/shared/test/unit_test/command_stream/tbx_command_stream_tests.cpp +++ b/shared/test/unit_test/command_stream/tbx_command_stream_tests.cpp @@ -48,7 +48,7 @@ struct TbxFixture : public TbxCommandStreamFixture, using TbxCommandStreamFixture::setUp; - TbxFixture() : MockAubCenterFixture(CommandStreamReceiverType::CSR_TBX) {} + TbxFixture() : MockAubCenterFixture(CommandStreamReceiverType::tbx) {} void setUp() { DeviceFixture::setUp(); @@ -103,7 +103,7 @@ TEST(TbxCommandStreamReceiverTest, givenTbxCommandStreamReceiverWhenTypeIsChecke executionEnvironment->initializeMemoryManager(); std::unique_ptr csr(TbxCommandStreamReceiver::create("", false, *executionEnvironment, 0, 1)); EXPECT_NE(nullptr, csr); - EXPECT_EQ(CommandStreamReceiverType::CSR_TBX, csr->getType()); + EXPECT_EQ(CommandStreamReceiverType::tbx, csr->getType()); } HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenMakeResidentIsCalledForGraphicsAllocationThenItShouldPushAllocationForResidencyToCsr) { @@ -570,7 +570,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenDownloadAllocat HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenHardwareContextIsCreatedThenTbxStreamInCsrIsNotInitialized) { MockAubManager *mockManager = new MockAubManager(); - MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, "", CommandStreamReceiverType::CSR_TBX); + MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, "", CommandStreamReceiverType::tbx); mockAubCenter->aubManager = std::unique_ptr(mockManager); pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); @@ -585,7 +585,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenOsContextIsSetThenCreateHardwareC std::string fileName = ""; MockAubManager *mockManager = new MockAubManager(); - MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, fileName, CommandStreamReceiverType::CSR_TBX); + MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, fileName, CommandStreamReceiverType::tbx); mockAubCenter->aubManager = std::unique_ptr(mockManager); pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); @@ -620,7 +620,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenCreatedWithAubDumpThenFileNameIsE executionEnvironment.initGmm(); auto rootDeviceEnvironment = static_cast(executionEnvironment.rootDeviceEnvironments[0].get()); - setMockAubCenter(*rootDeviceEnvironment, CommandStreamReceiverType::CSR_TBX); + setMockAubCenter(*rootDeviceEnvironment, CommandStreamReceiverType::tbx); auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile", mockRootDeviceIndex); diff --git a/shared/test/unit_test/execution_environment/execution_environment_tests.cpp b/shared/test/unit_test/execution_environment/execution_environment_tests.cpp index 6a4b7c3f4b..6e1fef3826 100644 --- a/shared/test/unit_test/execution_environment/execution_environment_tests.cpp +++ b/shared/test/unit_test/execution_environment/execution_environment_tests.cpp @@ -79,7 +79,7 @@ TEST(RootDeviceEnvironment, givenExecutionEnvironmentWhenInitializeAubCenterIsCa MockExecutionEnvironment executionEnvironment; executionEnvironment.rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get()); auto rootDeviceEnvironment = static_cast(executionEnvironment.rootDeviceEnvironments[0].get()); - rootDeviceEnvironment->initAubCenter(true, "test.aub", CommandStreamReceiverType::CSR_AUB); + rootDeviceEnvironment->initAubCenter(true, "test.aub", CommandStreamReceiverType::aub); EXPECT_TRUE(rootDeviceEnvironment->initAubCenterCalled); EXPECT_TRUE(rootDeviceEnvironment->localMemoryEnabledReceived); EXPECT_STREQ(rootDeviceEnvironment->aubFileNameReceived.c_str(), "test.aub"); @@ -117,7 +117,7 @@ TEST(RootDeviceEnvironment, givenUseAubStreamFalseWhenGetAubManagerIsCalledThenR MockExecutionEnvironment executionEnvironment{defaultHwInfo.get(), false, 1u}; auto rootDeviceEnvironment = executionEnvironment.rootDeviceEnvironments[0].get(); - rootDeviceEnvironment->initAubCenter(false, "", CommandStreamReceiverType::CSR_AUB); + rootDeviceEnvironment->initAubCenter(false, "", CommandStreamReceiverType::aub); auto aubManager = rootDeviceEnvironment->aubCenter->getAubManager(); EXPECT_EQ(nullptr, aubManager); } @@ -125,14 +125,14 @@ TEST(RootDeviceEnvironment, givenUseAubStreamFalseWhenGetAubManagerIsCalledThenR TEST(RootDeviceEnvironment, givenExecutionEnvironmentWhenInitializeAubCenterIsCalledThenItIsInitalizedOnce) { MockExecutionEnvironment executionEnvironment{defaultHwInfo.get(), false, 1u}; auto rootDeviceEnvironment = executionEnvironment.rootDeviceEnvironments[0].get(); - rootDeviceEnvironment->initAubCenter(false, "", CommandStreamReceiverType::CSR_AUB); + rootDeviceEnvironment->initAubCenter(false, "", CommandStreamReceiverType::aub); auto currentAubCenter = rootDeviceEnvironment->aubCenter.get(); EXPECT_NE(nullptr, currentAubCenter); auto currentAubStreamProvider = currentAubCenter->getStreamProvider(); EXPECT_NE(nullptr, currentAubStreamProvider); auto currentAubFileStream = currentAubStreamProvider->getStream(); EXPECT_NE(nullptr, currentAubFileStream); - rootDeviceEnvironment->initAubCenter(false, "", CommandStreamReceiverType::CSR_AUB); + rootDeviceEnvironment->initAubCenter(false, "", CommandStreamReceiverType::aub); EXPECT_EQ(currentAubCenter, rootDeviceEnvironment->aubCenter.get()); EXPECT_EQ(currentAubStreamProvider, rootDeviceEnvironment->aubCenter->getStreamProvider()); EXPECT_EQ(currentAubFileStream, rootDeviceEnvironment->aubCenter->getStreamProvider()->getStream()); @@ -340,7 +340,7 @@ TEST(ExecutionEnvironment, givenExecutionEnvironmentWithVariousMembersWhenItIsDe MemoryOperationsHandlerMock(uint32_t &destructorId) : DestructorCounted(destructorId) {} }; struct AubCenterMock : public DestructorCounted { - AubCenterMock(uint32_t &destructorId, const RootDeviceEnvironment &rootDeviceEnvironment) : DestructorCounted(destructorId, rootDeviceEnvironment, false, "", CommandStreamReceiverType::CSR_AUB) {} + AubCenterMock(uint32_t &destructorId, const RootDeviceEnvironment &rootDeviceEnvironment) : DestructorCounted(destructorId, rootDeviceEnvironment, false, "", CommandStreamReceiverType::aub) {} }; struct CompilerInterfaceMock : public DestructorCounted { CompilerInterfaceMock(uint32_t &destructorId) : DestructorCounted(destructorId) {} diff --git a/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp b/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp index 032b059e47..07e101b8a4 100644 --- a/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp +++ b/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp @@ -1354,7 +1354,7 @@ TEST_F(GmmLocalMemoryTests, givenLocalMemoryAndStorageInfoWithLocalOnlyRequiredW gmmRequirements.preferCompressed = false; DebugManagerStateRestore restorer; - for (auto csrMode = static_cast(CommandStreamReceiverType::CSR_HW); csrMode < static_cast(CommandStreamReceiverType::CSR_TYPES_NUM); csrMode++) { + for (auto csrMode = static_cast(CommandStreamReceiverType::hardware); csrMode < static_cast(CommandStreamReceiverType::typesNum); csrMode++) { debugManager.flags.SetCommandStreamReceiver.set(csrMode); auto gmm = std::make_unique(getGmmHelper(), nullptr, 1, 0, GMM_RESOURCE_USAGE_OCL_BUFFER, storageInfo, gmmRequirements); EXPECT_EQ(1u, gmm->resourceParams.Flags.Info.LocalOnly); @@ -1421,7 +1421,7 @@ TEST_F(GmmLocalMemoryTests, givenFtrLocalMemoryWhenUseSystemMemoryIsFalseAndAllo GmmRequirements gmmRequirements{}; gmmRequirements.allowLargePages = true; gmmRequirements.preferCompressed = false; - for (auto csrMode = static_cast(CommandStreamReceiverType::CSR_HW); csrMode < static_cast(CommandStreamReceiverType::CSR_TYPES_NUM); csrMode++) { + for (auto csrMode = static_cast(CommandStreamReceiverType::hardware); csrMode < static_cast(CommandStreamReceiverType::typesNum); csrMode++) { debugManager.flags.SetCommandStreamReceiver.set(csrMode); StorageInfo storageInfo{}; storageInfo.memoryBanks.set(1); diff --git a/shared/test/unit_test/memory_manager/memory_manager_tests.cpp b/shared/test/unit_test/memory_manager/memory_manager_tests.cpp index a7b3e83eb2..12c51f0c94 100644 --- a/shared/test/unit_test/memory_manager/memory_manager_tests.cpp +++ b/shared/test/unit_test/memory_manager/memory_manager_tests.cpp @@ -662,7 +662,7 @@ TEST_F(MemoryAllocatorTest, WhenPopulatingOsHandleThenOneFragmentIsReturned) { TEST_F(MemoryAllocatorTest, givenOsHandleStorageWhenOsHandlesAreCleanedAndAubManagerIsNotAvailableThenFreeMemoryIsNotCalledOnAubManager) { MockExecutionEnvironment mockExecutionEnvironment(defaultHwInfo.get()); MockMemoryManager mockMemoryManager(mockExecutionEnvironment); - auto mockAubCenter = new MockAubCenter(*mockExecutionEnvironment.rootDeviceEnvironments[0], false, "aubfile", CommandStreamReceiverType::CSR_AUB); + auto mockAubCenter = new MockAubCenter(*mockExecutionEnvironment.rootDeviceEnvironments[0], false, "aubfile", CommandStreamReceiverType::aub); mockAubCenter->aubManager.reset(nullptr); mockExecutionEnvironment.rootDeviceEnvironments[0]->aubCenter.reset(mockAubCenter); @@ -682,12 +682,12 @@ TEST_F(MemoryAllocatorTest, givenOsHandleStorageAndFreeMemoryEnabledWhenOsHandle MockExecutionEnvironment mockExecutionEnvironment(defaultHwInfo.get(), true, 3); MockMemoryManager mockMemoryManager(mockExecutionEnvironment); auto mockManager0 = new MockAubManager(); - auto mockAubCenter0 = new MockAubCenter(*mockExecutionEnvironment.rootDeviceEnvironments[0], false, "aubfile", CommandStreamReceiverType::CSR_AUB); + auto mockAubCenter0 = new MockAubCenter(*mockExecutionEnvironment.rootDeviceEnvironments[0], false, "aubfile", CommandStreamReceiverType::aub); mockAubCenter0->aubManager.reset(mockManager0); mockExecutionEnvironment.rootDeviceEnvironments[0]->aubCenter.reset(mockAubCenter0); auto mockManager1 = new MockAubManager(); - auto mockAubCenter1 = new MockAubCenter(*mockExecutionEnvironment.rootDeviceEnvironments[0], false, "aubfile", CommandStreamReceiverType::CSR_AUB); + auto mockAubCenter1 = new MockAubCenter(*mockExecutionEnvironment.rootDeviceEnvironments[0], false, "aubfile", CommandStreamReceiverType::aub); mockAubCenter1->aubManager.reset(mockManager1); mockExecutionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->aubCenter.reset(mockAubCenter1); @@ -706,7 +706,7 @@ HWTEST_F(MemoryAllocatorTest, givenAllocationUsedByContextWhenFreeingThenHandleC debugManager.flags.EnableFreeMemory.set(true); const uint32_t rootDeviceIndex = 0u; auto mockManager0 = new MockAubManager(); - auto mockAubCenter0 = new MockAubCenter(*executionEnvironment->rootDeviceEnvironments[rootDeviceIndex], false, "aubfile", CommandStreamReceiverType::CSR_AUB); + auto mockAubCenter0 = new MockAubCenter(*executionEnvironment->rootDeviceEnvironments[rootDeviceIndex], false, "aubfile", CommandStreamReceiverType::aub); mockAubCenter0->aubManager.reset(mockManager0); executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->aubCenter.reset(mockAubCenter0); @@ -1756,7 +1756,7 @@ TEST(OsAgnosticMemoryManager, givenFreeMemoryEnabledAndNonExternalHostPtrAllocat MockExecutionEnvironment executionEnvironment; OsAgnosticMemoryManager memoryManager(executionEnvironment); MockAubManager *mockManager = new MockAubManager(); - MockAubCenter *mockAubCenter = new MockAubCenter(*executionEnvironment.rootDeviceEnvironments[0], false, "file_name.aub", CommandStreamReceiverType::CSR_AUB); + MockAubCenter *mockAubCenter = new MockAubCenter(*executionEnvironment.rootDeviceEnvironments[0], false, "file_name.aub", CommandStreamReceiverType::aub); mockAubCenter->aubManager = std::unique_ptr(mockManager); executionEnvironment.rootDeviceEnvironments[0]->aubCenter.reset(mockAubCenter); auto gmmHelper = executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper(); @@ -1798,7 +1798,7 @@ TEST(OsAgnosticMemoryManager, givenOsAgnosticMemoryManagerAndFreeMemoryDisabledW MockExecutionEnvironment executionEnvironment; OsAgnosticMemoryManager memoryManager(executionEnvironment); MockAubManager *mockManager = new MockAubManager(); - MockAubCenter *mockAubCenter = new MockAubCenter(*executionEnvironment.rootDeviceEnvironments[0], false, "file_name.aub", CommandStreamReceiverType::CSR_AUB); + MockAubCenter *mockAubCenter = new MockAubCenter(*executionEnvironment.rootDeviceEnvironments[0], false, "file_name.aub", CommandStreamReceiverType::aub); mockAubCenter->aubManager = std::unique_ptr(mockManager); executionEnvironment.rootDeviceEnvironments[0]->aubCenter.reset(mockAubCenter); diff --git a/shared/test/unit_test/page_fault_manager/cpu_page_fault_manager_tests.cpp b/shared/test/unit_test/page_fault_manager/cpu_page_fault_manager_tests.cpp index 2d885a983d..e2bd45bc28 100644 --- a/shared/test/unit_test/page_fault_manager/cpu_page_fault_manager_tests.cpp +++ b/shared/test/unit_test/page_fault_manager/cpu_page_fault_manager_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2023 Intel Corporation + * Copyright (C) 2019-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -753,9 +753,9 @@ TEST_F(PageFaultManagerTest, givenCalWhenSelectingHandlerThenAubTbxAndCalGpuDoma TEST_F(PageFaultManagerTest, givenAubOrTbxCsrWhenSelectingHandlerThenAubAndTbxGpuDomainHandlerIsSet) { DebugManagerStateRestore restorer; - for (auto csrType : {CommandStreamReceiverType::CSR_AUB, CommandStreamReceiverType::CSR_TBX, - CommandStreamReceiverType::CSR_HW_WITH_AUB, CommandStreamReceiverType::CSR_TBX_WITH_AUB}) { - debugManager.flags.SetCommandStreamReceiver.set(csrType); + for (auto csrType : {CommandStreamReceiverType::aub, CommandStreamReceiverType::tbx, + CommandStreamReceiverType::hardwareWithAub, CommandStreamReceiverType::tbxWithAub}) { + debugManager.flags.SetCommandStreamReceiver.set(static_cast(csrType)); auto pageFaultManager2 = std::make_unique(); pageFaultManager2->selectGpuDomainHandler(); @@ -769,7 +769,7 @@ TEST_F(PageFaultManagerTest, givenHwCsrWhenSelectingHandlerThenHwGpuDomainHandle EXPECT_EQ(pageFaultManager->getHwHandlerAddress(), reinterpret_cast(pageFaultManager->gpuDomainHandler)); - debugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_HW); + debugManager.flags.SetCommandStreamReceiver.set(static_cast(CommandStreamReceiverType::hardware)); auto pageFaultManager2 = std::make_unique(); pageFaultManager2->selectGpuDomainHandler(); diff --git a/shared/test/unit_test/xe_hpc_core/aub_command_stream_receiver_2_tests_xe_hpc_core.cpp b/shared/test/unit_test/xe_hpc_core/aub_command_stream_receiver_2_tests_xe_hpc_core.cpp index 2cf8f31df6..8537f9ed8e 100644 --- a/shared/test/unit_test/xe_hpc_core/aub_command_stream_receiver_2_tests_xe_hpc_core.cpp +++ b/shared/test/unit_test/xe_hpc_core/aub_command_stream_receiver_2_tests_xe_hpc_core.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2023 Intel Corporation + * Copyright (C) 2021-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -35,7 +35,7 @@ XE_HPC_CORETEST_F(AubCommandStreamReceiverXeHpcCoreTests, givenLinkBcsEngineWhen auto engineDescriptor = EngineDescriptorHelper::getDefaultDescriptor(); MockAubManager *mockManager = new MockAubManager(); - MockAubCenter *mockAubCenter = new MockAubCenter(device->getRootDeviceEnvironment(), false, "", CommandStreamReceiverType::CSR_AUB); + MockAubCenter *mockAubCenter = new MockAubCenter(device->getRootDeviceEnvironment(), false, "", CommandStreamReceiverType::aub); mockAubCenter->aubManager = std::unique_ptr(mockManager); device->executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter);