diff --git a/opencl/test/unit_test/api/cl_enqueue_verify_memory.inl b/opencl/test/unit_test/api/cl_enqueue_verify_memory.inl index b6ee5f4f7d..2f19547aa5 100644 --- a/opencl/test/unit_test/api/cl_enqueue_verify_memory.inl +++ b/opencl/test/unit_test/api/cl_enqueue_verify_memory.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 Intel Corporation + * Copyright (C) 2019-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -13,10 +13,7 @@ #include "opencl/test/unit_test/api/cl_api_tests.h" using namespace NEO; - -namespace AubMemDump { #include "aub_services.h" -} TEST(CheckVerifyMemoryRelatedApiConstants, givenVerifyMemoryRelatedApiConstantsWhenVerifyingTheirValueThenCorrectValuesAreReturned) { EXPECT_EQ(AubMemDump::CmdServicesMemTraceMemoryCompare::CompareOperationValues::CompareEqual, CL_MEM_COMPARE_EQUAL); diff --git a/shared/source/aub_mem_dump/aub_header.h b/shared/source/aub_mem_dump/aub_header.h index b1cf2b35b5..b22bae2b87 100644 --- a/shared/source/aub_mem_dump/aub_header.h +++ b/shared/source/aub_mem_dump/aub_header.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -14,7 +14,7 @@ #else #pragma pack(push, 4) #endif - +namespace AubMemDump { inline void setMisalignedUint64(uint64_t *address, const uint64_t value) { uint32_t *addressBits = reinterpret_cast(address); addressBits[0] = static_cast(value); @@ -62,7 +62,6 @@ struct AubCmdDumpBmpHd { } }; static_assert(44 == sizeof(AubCmdDumpBmpHd), "Invalid size for AubCmdDumpBmpHd"); - struct AubPpgttContextCreate { AubCmdHdr header; uint32_t handle; @@ -112,7 +111,7 @@ struct AubCaptureBinaryDumpHD { } }; static_assert(56 == sizeof(AubCaptureBinaryDumpHD), "Invalid size for AubCaptureBinaryDumpHD"); - +} // namespace AubMemDump #ifndef WIN32 #pragma pack() #else diff --git a/shared/source/aub_mem_dump/aub_mem_dump.h b/shared/source/aub_mem_dump/aub_mem_dump.h index 08f4cf0f10..47795026b8 100644 --- a/shared/source/aub_mem_dump/aub_mem_dump.h +++ b/shared/source/aub_mem_dump/aub_mem_dump.h @@ -9,16 +9,14 @@ #include "shared/source/aub_mem_dump/aub_data.h" #include -#include #include namespace NEO { class AubHelper; } -namespace AubMemDump { #include "aub_services.h" - +namespace AubMemDump { inline constexpr uint32_t rcsRegisterBase = 0x2000; #ifndef BIT @@ -137,11 +135,9 @@ struct AubFileStream : public AubStream { MOCKABLE_VIRTUAL void expectMemory(uint64_t physAddress, const void *memory, size_t size, uint32_t addressSpace, uint32_t compareOperation); MOCKABLE_VIRTUAL bool addComment(const char *message); - [[nodiscard]] MOCKABLE_VIRTUAL std::unique_lock lockStream(); std::ofstream fileHandle; std::string fileName; - std::mutex mutex; }; template diff --git a/shared/source/aub_mem_dump/definitions/aub_services.h b/shared/source/aub_mem_dump/definitions/aub_services.h index f9daaba302..0b2965018a 100644 --- a/shared/source/aub_mem_dump/definitions/aub_services.h +++ b/shared/source/aub_mem_dump/definitions/aub_services.h @@ -16,7 +16,7 @@ #else #pragma pack(push, 4) #endif - +namespace AubMemDump { struct CmdServicesMemTraceVersion { union { AubCmdHdr header; @@ -1445,6 +1445,7 @@ struct CmdServicesMemTraceDumpCompress { TrmodeYs = 2 }; }; }; +} // namespace AubMemDump #ifndef WIN32 #pragma pack() #else diff --git a/shared/source/command_stream/aub_command_stream_receiver.cpp b/shared/source/command_stream/aub_command_stream_receiver.cpp index 7206bbb013..5808b4119b 100644 --- a/shared/source/command_stream/aub_command_stream_receiver.cpp +++ b/shared/source/command_stream/aub_command_stream_receiver.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2024 Intel Corporation + * Copyright (C) 2018-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -8,6 +8,7 @@ #include "shared/source/command_stream/aub_command_stream_receiver.h" #include "shared/source/aub/aub_helper.h" +#include "shared/source/command_stream/aub_command_stream_receiver_hw.h" #include "shared/source/debug_settings/debug_settings_manager.h" #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" @@ -300,9 +301,4 @@ bool AubFileStream::addComment(const char *message) { } return true; } - -std::unique_lock AubFileStream::lockStream() { - return std::unique_lock(mutex); -} - } // namespace AubMemDump 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 e48354767c..337509d53d 100644 --- a/shared/source/command_stream/aub_command_stream_receiver_hw.h +++ b/shared/source/command_stream/aub_command_stream_receiver_hw.h @@ -9,6 +9,8 @@ #include "shared/source/command_stream/command_stream_receiver_simulated_hw.h" #include "shared/source/memory_manager/residency_container.h" +#include + namespace NEO { class PDPE; class PML4; @@ -106,6 +108,12 @@ class AUBCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw lockStream() { + return std::unique_lock(mutex); + } + protected: constexpr static uint32_t getMaskAndValueForPollForCompletion(); diff --git a/shared/source/command_stream/aub_command_stream_receiver_hw_base.inl b/shared/source/command_stream/aub_command_stream_receiver_hw_base.inl index e13dd44b4d..b9be3cbf75 100644 --- a/shared/source/command_stream/aub_command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/aub_command_stream_receiver_hw_base.inl @@ -104,13 +104,13 @@ AUBCommandStreamReceiverHw::~AUBCommandStreamReceiverHw() { template void AUBCommandStreamReceiverHw::openFile(const std::string &fileName) { - auto streamLocked = getAubStream()->lockStream(); + auto streamLocked = lockStream(); initFile(fileName); } template bool AUBCommandStreamReceiverHw::reopenFile(const std::string &fileName) { - auto streamLocked = getAubStream()->lockStream(); + auto streamLocked = lockStream(); if (isFileOpen()) { if (fileName != getFileName()) { @@ -182,7 +182,7 @@ const std::string AUBCommandStreamReceiverHw::getFileName() { template void AUBCommandStreamReceiverHw::initializeEngine() { - auto streamLocked = getAubStream()->lockStream(); + auto streamLocked = lockStream(); isEngineInitialized = true; if (hardwareContextController) { @@ -426,7 +426,7 @@ bool AUBCommandStreamReceiverHw::addPatchInfoComments() { template void AUBCommandStreamReceiverHw::submitBatchBufferAub(uint64_t batchBufferGpuAddress, const void *batchBuffer, size_t batchBufferSize, uint32_t memoryBank, uint64_t entryBits) { - auto streamLocked = getAubStream()->lockStream(); + auto streamLocked = lockStream(); if (hardwareContextController) { if (batchBufferSize) { @@ -602,7 +602,7 @@ void AUBCommandStreamReceiverHw::pollForCompletionImpl() { } } - auto streamLocked = getAubStream()->lockStream(); + auto streamLocked = lockStream(); if (hardwareContextController) { hardwareContextController->pollForCompletion(); @@ -682,7 +682,7 @@ bool AUBCommandStreamReceiverHw::writeMemory(GraphicsAllocation &gfxA return false; } - auto streamLocked = getAubStream()->lockStream(); + auto streamLocked = lockStream(); if (aubManager) { this->writeMemoryWithAubManager(gfxAllocation, isChunkCopy, gpuVaChunkOffset, chunkSize); @@ -712,7 +712,7 @@ bool AUBCommandStreamReceiverHw::writeMemory(AllocationView &allocati template void AUBCommandStreamReceiverHw::writeMMIO(uint32_t offset, uint32_t value) { - auto streamLocked = getAubStream()->lockStream(); + auto streamLocked = lockStream(); if (hardwareContextController) { hardwareContextController->writeMMIO(offset, value); @@ -733,7 +733,7 @@ bool AUBCommandStreamReceiverHw::expectMemory(const void *gfxAddress, size_t length, uint32_t compareOperation) { pollForCompletion(); - auto streamLocked = getAubStream()->lockStream(); + auto streamLocked = lockStream(); if (hardwareContextController) { hardwareContextController->expectMemory(reinterpret_cast(gfxAddress), srcAddress, length, compareOperation); @@ -807,7 +807,7 @@ void AUBCommandStreamReceiverHw::dumpAllocation(GraphicsAllocation &g pollForCompletion(); } - auto streamLocked = getAubStream()->lockStream(); + auto streamLocked = lockStream(); if (hardwareContextController) { auto surfaceInfo = std::unique_ptr(AubAllocDump::getDumpSurfaceInfo(gfxAllocation, *this->peekGmmHelper(), dumpFormat)); @@ -838,11 +838,12 @@ AubSubCaptureStatus AUBCommandStreamReceiverHw::checkAndActivateAubSu template void AUBCommandStreamReceiverHw::addAubComment(const char *message) { - auto streamLocked = getAubStream()->lockStream(); + auto streamLocked = lockStream(); if (aubManager) { aubManager->addComment(message); return; } + getAubStream()->addComment(message); } diff --git a/shared/source/command_stream/command_stream_receiver.cpp b/shared/source/command_stream/command_stream_receiver.cpp index 89101fdf1a..4c3c4f580d 100644 --- a/shared/source/command_stream/command_stream_receiver.cpp +++ b/shared/source/command_stream/command_stream_receiver.cpp @@ -42,13 +42,11 @@ #include "shared/source/utilities/tag_allocator.h" #include "shared/source/utilities/wait_util.h" +#include "aub_services.h" + #include #include -namespace AubMemDump { -#include "aub_services.h" -} - namespace NEO { // Global table of CommandStreamReceiver factories for HW and tests diff --git a/shared/source/gen12lp/hw_info_adln.cpp b/shared/source/gen12lp/hw_info_adln.cpp index d624236a5b..239a5d462e 100644 --- a/shared/source/gen12lp/hw_info_adln.cpp +++ b/shared/source/gen12lp/hw_info_adln.cpp @@ -33,46 +33,46 @@ const PLATFORM ADLN::platform = { const RuntimeCapabilityTable ADLN::capabilityTable{ EngineDirectSubmissionInitVec{ {aub_stream::ENGINE_RCS, {true, true}}, - {aub_stream::ENGINE_CCS, {true, true}}}, // directSubmissionEngines - {0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties - MemoryConstants::max64BitAppAddress, // gpuAddressSpace - 0, // sharedSystemMemCapabilities - MemoryConstants::pageSize, // requiredPreemptionSurfaceSize - "", // deviceName - nullptr, // preferredPlatformName - PreemptionMode::ThreadGroup, // defaultPreemptionMode - aub_stream::ENGINE_RCS, // defaultEngineType - 0, // maxRenderFrequency - 30, // clVersionSupport - CmdServicesMemTraceVersion::DeviceValues::Adln, // aubDeviceId - 1, // extraQuantityThreadsPerEU - 64, // maxProgrammableSlmSize - sizeof(ADLN::GRF), // grfSize - 36u, // timestampValidBits - 32u, // kernelTimestampValidBits - false, // blitterOperationsSupported - true, // ftrSupportsInteger64BitAtomics - false, // ftrSupportsFP64 - false, // ftrSupportsFP64Emulation - false, // ftrSupports64BitMath - false, // ftrSupportsCoherency - false, // ftrRenderCompressedBuffers - false, // ftrRenderCompressedImages - true, // instrumentationEnabled - true, // ftr64KBpages - false, // supportCacheFlushAfterWalker - true, // supportsImages - true, // supportsOcl21Features - false, // supportsOnDemandPageFaults - false, // supportsIndependentForwardProgress - true, // isIntegratedDevice - true, // supportsMediaBlock - false, // p2pAccessSupported - false, // p2pAtomicAccessSupported - true, // fusedEuEnabled - false, // l0DebuggerSupported; - true, // supportsFloatAtomics - 0 // cxlType + {aub_stream::ENGINE_CCS, {true, true}}}, // directSubmissionEngines + {0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties + MemoryConstants::max64BitAppAddress, // gpuAddressSpace + 0, // sharedSystemMemCapabilities + MemoryConstants::pageSize, // requiredPreemptionSurfaceSize + "", // deviceName + nullptr, // preferredPlatformName + PreemptionMode::ThreadGroup, // defaultPreemptionMode + aub_stream::ENGINE_RCS, // defaultEngineType + 0, // maxRenderFrequency + 30, // clVersionSupport + AubMemDump::CmdServicesMemTraceVersion::DeviceValues::Adln, // aubDeviceId + 1, // extraQuantityThreadsPerEU + 64, // maxProgrammableSlmSize + sizeof(ADLN::GRF), // grfSize + 36u, // timestampValidBits + 32u, // kernelTimestampValidBits + false, // blitterOperationsSupported + true, // ftrSupportsInteger64BitAtomics + false, // ftrSupportsFP64 + false, // ftrSupportsFP64Emulation + false, // ftrSupports64BitMath + false, // ftrSupportsCoherency + false, // ftrRenderCompressedBuffers + false, // ftrRenderCompressedImages + true, // instrumentationEnabled + true, // ftr64KBpages + false, // supportCacheFlushAfterWalker + true, // supportsImages + true, // supportsOcl21Features + false, // supportsOnDemandPageFaults + false, // supportsIndependentForwardProgress + true, // isIntegratedDevice + true, // supportsMediaBlock + false, // p2pAccessSupported + false, // p2pAtomicAccessSupported + true, // fusedEuEnabled + false, // l0DebuggerSupported; + true, // supportsFloatAtomics + 0 // cxlType }; WorkaroundTable ADLN::workaroundTable = {}; diff --git a/shared/source/gen12lp/hw_info_adlp.cpp b/shared/source/gen12lp/hw_info_adlp.cpp index f4666a348b..1ceddc9c37 100644 --- a/shared/source/gen12lp/hw_info_adlp.cpp +++ b/shared/source/gen12lp/hw_info_adlp.cpp @@ -33,46 +33,46 @@ const PLATFORM ADLP::platform = { const RuntimeCapabilityTable ADLP::capabilityTable{ EngineDirectSubmissionInitVec{ {aub_stream::ENGINE_RCS, {true, true}}, - {aub_stream::ENGINE_CCS, {true, true}}}, // directSubmissionEngines - {0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties - MemoryConstants::max64BitAppAddress, // gpuAddressSpace - 0, // sharedSystemMemCapabilities - MemoryConstants::pageSize, // requiredPreemptionSurfaceSize - "", // deviceName - nullptr, // preferredPlatformName - PreemptionMode::ThreadGroup, // defaultPreemptionMode - aub_stream::ENGINE_RCS, // defaultEngineType - 0, // maxRenderFrequency - 30, // clVersionSupport - CmdServicesMemTraceVersion::DeviceValues::Adlp, // aubDeviceId - 1, // extraQuantityThreadsPerEU - 64, // maxProgrammableSlmSize - sizeof(ADLP::GRF), // grfSize - 36u, // timestampValidBits - 32u, // kernelTimestampValidBits - false, // blitterOperationsSupported - true, // ftrSupportsInteger64BitAtomics - false, // ftrSupportsFP64 - false, // ftrSupportsFP64Emulation - false, // ftrSupports64BitMath - false, // ftrSupportsCoherency - false, // ftrRenderCompressedBuffers - false, // ftrRenderCompressedImages - true, // instrumentationEnabled - true, // ftr64KBpages - false, // supportCacheFlushAfterWalker - true, // supportsImages - true, // supportsOcl21Features - false, // supportsOnDemandPageFaults - false, // supportsIndependentForwardProgress - true, // isIntegratedDevice - true, // supportsMediaBlock - false, // p2pAccessSupported - false, // p2pAtomicAccessSupported - true, // fusedEuEnabled - false, // l0DebuggerSupported; - true, // supportsFloatAtomics - 0 // cxlType + {aub_stream::ENGINE_CCS, {true, true}}}, // directSubmissionEngines + {0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties + MemoryConstants::max64BitAppAddress, // gpuAddressSpace + 0, // sharedSystemMemCapabilities + MemoryConstants::pageSize, // requiredPreemptionSurfaceSize + "", // deviceName + nullptr, // preferredPlatformName + PreemptionMode::ThreadGroup, // defaultPreemptionMode + aub_stream::ENGINE_RCS, // defaultEngineType + 0, // maxRenderFrequency + 30, // clVersionSupport + AubMemDump::CmdServicesMemTraceVersion::DeviceValues::Adlp, // aubDeviceId + 1, // extraQuantityThreadsPerEU + 64, // maxProgrammableSlmSize + sizeof(ADLP::GRF), // grfSize + 36u, // timestampValidBits + 32u, // kernelTimestampValidBits + false, // blitterOperationsSupported + true, // ftrSupportsInteger64BitAtomics + false, // ftrSupportsFP64 + false, // ftrSupportsFP64Emulation + false, // ftrSupports64BitMath + false, // ftrSupportsCoherency + false, // ftrRenderCompressedBuffers + false, // ftrRenderCompressedImages + true, // instrumentationEnabled + true, // ftr64KBpages + false, // supportCacheFlushAfterWalker + true, // supportsImages + true, // supportsOcl21Features + false, // supportsOnDemandPageFaults + false, // supportsIndependentForwardProgress + true, // isIntegratedDevice + true, // supportsMediaBlock + false, // p2pAccessSupported + false, // p2pAtomicAccessSupported + true, // fusedEuEnabled + false, // l0DebuggerSupported; + true, // supportsFloatAtomics + 0 // cxlType }; WorkaroundTable ADLP::workaroundTable = {}; diff --git a/shared/source/gen12lp/hw_info_adls.cpp b/shared/source/gen12lp/hw_info_adls.cpp index 6154e88d56..c936c56266 100644 --- a/shared/source/gen12lp/hw_info_adls.cpp +++ b/shared/source/gen12lp/hw_info_adls.cpp @@ -33,46 +33,46 @@ const PLATFORM ADLS::platform = { const RuntimeCapabilityTable ADLS::capabilityTable{ EngineDirectSubmissionInitVec{ {aub_stream::ENGINE_RCS, {true, true}}, - {aub_stream::ENGINE_CCS, {true, true}}}, // directSubmissionEngines - {0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties - MemoryConstants::max64BitAppAddress, // gpuAddressSpace - 0, // sharedSystemMemCapabilities - MemoryConstants::pageSize, // requiredPreemptionSurfaceSize - "", // deviceName - nullptr, // preferredPlatformName - PreemptionMode::ThreadGroup, // defaultPreemptionMode - aub_stream::ENGINE_RCS, // defaultEngineType - 0, // maxRenderFrequency - 30, // clVersionSupport - CmdServicesMemTraceVersion::DeviceValues::Adls, // aubDeviceId - 1, // extraQuantityThreadsPerEU - 64, // maxProgrammableSlmSize - sizeof(ADLS::GRF), // grfSize - 36u, // timestampValidBits - 32u, // kernelTimestampValidBits - false, // blitterOperationsSupported - true, // ftrSupportsInteger64BitAtomics - false, // ftrSupportsFP64 - false, // ftrSupportsFP64Emulation - false, // ftrSupports64BitMath - false, // ftrSupportsCoherency - false, // ftrRenderCompressedBuffers - false, // ftrRenderCompressedImages - true, // instrumentationEnabled - true, // ftr64KBpages - false, // supportCacheFlushAfterWalker - true, // supportsImages - true, // supportsOcl21Features - false, // supportsOnDemandPageFaults - false, // supportsIndependentForwardProgress - true, // isIntegratedDevice - true, // supportsMediaBlock - false, // p2pAccessSupported - false, // p2pAtomicAccessSupported - true, // fusedEuEnabled - false, // l0DebuggerSupported; - true, // supportsFloatAtomics - 0 // cxlType + {aub_stream::ENGINE_CCS, {true, true}}}, // directSubmissionEngines + {0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties + MemoryConstants::max64BitAppAddress, // gpuAddressSpace + 0, // sharedSystemMemCapabilities + MemoryConstants::pageSize, // requiredPreemptionSurfaceSize + "", // deviceName + nullptr, // preferredPlatformName + PreemptionMode::ThreadGroup, // defaultPreemptionMode + aub_stream::ENGINE_RCS, // defaultEngineType + 0, // maxRenderFrequency + 30, // clVersionSupport + AubMemDump::CmdServicesMemTraceVersion::DeviceValues::Adls, // aubDeviceId + 1, // extraQuantityThreadsPerEU + 64, // maxProgrammableSlmSize + sizeof(ADLS::GRF), // grfSize + 36u, // timestampValidBits + 32u, // kernelTimestampValidBits + false, // blitterOperationsSupported + true, // ftrSupportsInteger64BitAtomics + false, // ftrSupportsFP64 + false, // ftrSupportsFP64Emulation + false, // ftrSupports64BitMath + false, // ftrSupportsCoherency + false, // ftrRenderCompressedBuffers + false, // ftrRenderCompressedImages + true, // instrumentationEnabled + true, // ftr64KBpages + false, // supportCacheFlushAfterWalker + true, // supportsImages + true, // supportsOcl21Features + false, // supportsOnDemandPageFaults + false, // supportsIndependentForwardProgress + true, // isIntegratedDevice + true, // supportsMediaBlock + false, // p2pAccessSupported + false, // p2pAtomicAccessSupported + true, // fusedEuEnabled + false, // l0DebuggerSupported; + true, // supportsFloatAtomics + 0 // cxlType }; WorkaroundTable ADLS::workaroundTable = {}; diff --git a/shared/source/gen12lp/hw_info_dg1.cpp b/shared/source/gen12lp/hw_info_dg1.cpp index 4c8a12222b..0c65824bf2 100644 --- a/shared/source/gen12lp/hw_info_dg1.cpp +++ b/shared/source/gen12lp/hw_info_dg1.cpp @@ -33,46 +33,46 @@ const PLATFORM DG1::platform = { const RuntimeCapabilityTable DG1::capabilityTable{ EngineDirectSubmissionInitVec{ {aub_stream::ENGINE_RCS, {true, true}}, - {aub_stream::ENGINE_CCS, {true, true}}}, // directSubmissionEngines - {0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties - MemoryConstants::max64BitAppAddress, // gpuAddressSpace - 0, // sharedSystemMemCapabilities - MemoryConstants::pageSize, // requiredPreemptionSurfaceSize - "", // deviceName - nullptr, // preferredPlatformName - PreemptionMode::ThreadGroup, // defaultPreemptionMode - aub_stream::ENGINE_RCS, // defaultEngineType - 0, // maxRenderFrequency - 30, // clVersionSupport - CmdServicesMemTraceVersion::DeviceValues::Dg1, // aubDeviceId - 1, // extraQuantityThreadsPerEU - 64, // maxProgrammableSlmSize - sizeof(DG1::GRF), // grfSize - 36u, // timestampValidBits - 32u, // kernelTimestampValidBits - false, // blitterOperationsSupported - true, // ftrSupportsInteger64BitAtomics - false, // ftrSupportsFP64 - false, // ftrSupportsFP64Emulation - false, // ftrSupports64BitMath - false, // ftrSupportsCoherency - false, // ftrRenderCompressedBuffers - false, // ftrRenderCompressedImages - true, // ftr64KBpages - true, // instrumentationEnabled - true, // supportCacheFlushAfterWalker - true, // supportsImages, - true, // supportsOcl21Features - false, // supportsOnDemandPageFaults - false, // supportsIndependentForwardProgress - false, // isIntegratedDevice - true, // supportsMediaBlock - true, // p2pAccessSupported - false, // p2pAtomicAccessSupported - true, // fusedEuEnabled - true, // l0DebuggerSupported; - true, // supportsFloatAtomics - 0 // cxlType + {aub_stream::ENGINE_CCS, {true, true}}}, // directSubmissionEngines + {0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties + MemoryConstants::max64BitAppAddress, // gpuAddressSpace + 0, // sharedSystemMemCapabilities + MemoryConstants::pageSize, // requiredPreemptionSurfaceSize + "", // deviceName + nullptr, // preferredPlatformName + PreemptionMode::ThreadGroup, // defaultPreemptionMode + aub_stream::ENGINE_RCS, // defaultEngineType + 0, // maxRenderFrequency + 30, // clVersionSupport + AubMemDump::CmdServicesMemTraceVersion::DeviceValues::Dg1, // aubDeviceId + 1, // extraQuantityThreadsPerEU + 64, // maxProgrammableSlmSize + sizeof(DG1::GRF), // grfSize + 36u, // timestampValidBits + 32u, // kernelTimestampValidBits + false, // blitterOperationsSupported + true, // ftrSupportsInteger64BitAtomics + false, // ftrSupportsFP64 + false, // ftrSupportsFP64Emulation + false, // ftrSupports64BitMath + false, // ftrSupportsCoherency + false, // ftrRenderCompressedBuffers + false, // ftrRenderCompressedImages + true, // ftr64KBpages + true, // instrumentationEnabled + true, // supportCacheFlushAfterWalker + true, // supportsImages, + true, // supportsOcl21Features + false, // supportsOnDemandPageFaults + false, // supportsIndependentForwardProgress + false, // isIntegratedDevice + true, // supportsMediaBlock + true, // p2pAccessSupported + false, // p2pAtomicAccessSupported + true, // fusedEuEnabled + true, // l0DebuggerSupported; + true, // supportsFloatAtomics + 0 // cxlType }; WorkaroundTable DG1::workaroundTable = {}; diff --git a/shared/source/gen12lp/hw_info_rkl.cpp b/shared/source/gen12lp/hw_info_rkl.cpp index 90de5ef512..30cb67d79b 100644 --- a/shared/source/gen12lp/hw_info_rkl.cpp +++ b/shared/source/gen12lp/hw_info_rkl.cpp @@ -33,46 +33,46 @@ const PLATFORM RKL::platform = { const RuntimeCapabilityTable RKL::capabilityTable{ EngineDirectSubmissionInitVec{ {aub_stream::ENGINE_RCS, {true, true}}, - {aub_stream::ENGINE_CCS, {true, true}}}, // directSubmissionEngines - {0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties - MemoryConstants::max48BitAddress, // gpuAddressSpace - 0, // sharedSystemMemCapabilities - MemoryConstants::pageSize, // requiredPreemptionSurfaceSize - "", // deviceName - nullptr, // preferredPlatformName - PreemptionMode::ThreadGroup, // defaultPreemptionMode - aub_stream::ENGINE_RCS, // defaultEngineType - 0, // maxRenderFrequency - 30, // clVersionSupport - CmdServicesMemTraceVersion::DeviceValues::Tgllp, // aubDeviceId - 1, // extraQuantityThreadsPerEU - 64, // maxProgrammableSlmSize - sizeof(RKL::GRF), // grfSize - 36u, // timestampValidBits - 32u, // kernelTimestampValidBits - false, // blitterOperationsSupported - true, // ftrSupportsInteger64BitAtomics - false, // ftrSupportsFP64 - false, // ftrSupportsFP64Emulation - false, // ftrSupports64BitMath - false, // ftrSupportsCoherency - false, // ftrRenderCompressedBuffers - false, // ftrRenderCompressedImages - true, // ftr64KBpages - true, // instrumentationEnabled - false, // supportCacheFlushAfterWalker - true, // supportsImages - true, // supportsOcl21Features - false, // supportsOnDemandPageFaults - false, // supportsIndependentForwardProgress - true, // isIntegratedDevice - true, // supportsMediaBlock - false, // p2pAccessSupported - false, // p2pAtomicAccessSupported - true, // fusedEuEnabled - false, // l0DebuggerSupported; - true, // supportsFloatAtomics - 0 // cxlType + {aub_stream::ENGINE_CCS, {true, true}}}, // directSubmissionEngines + {0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties + MemoryConstants::max48BitAddress, // gpuAddressSpace + 0, // sharedSystemMemCapabilities + MemoryConstants::pageSize, // requiredPreemptionSurfaceSize + "", // deviceName + nullptr, // preferredPlatformName + PreemptionMode::ThreadGroup, // defaultPreemptionMode + aub_stream::ENGINE_RCS, // defaultEngineType + 0, // maxRenderFrequency + 30, // clVersionSupport + AubMemDump::CmdServicesMemTraceVersion::DeviceValues::Tgllp, // aubDeviceId + 1, // extraQuantityThreadsPerEU + 64, // maxProgrammableSlmSize + sizeof(RKL::GRF), // grfSize + 36u, // timestampValidBits + 32u, // kernelTimestampValidBits + false, // blitterOperationsSupported + true, // ftrSupportsInteger64BitAtomics + false, // ftrSupportsFP64 + false, // ftrSupportsFP64Emulation + false, // ftrSupports64BitMath + false, // ftrSupportsCoherency + false, // ftrRenderCompressedBuffers + false, // ftrRenderCompressedImages + true, // ftr64KBpages + true, // instrumentationEnabled + false, // supportCacheFlushAfterWalker + true, // supportsImages + true, // supportsOcl21Features + false, // supportsOnDemandPageFaults + false, // supportsIndependentForwardProgress + true, // isIntegratedDevice + true, // supportsMediaBlock + false, // p2pAccessSupported + false, // p2pAtomicAccessSupported + true, // fusedEuEnabled + false, // l0DebuggerSupported; + true, // supportsFloatAtomics + 0 // cxlType }; WorkaroundTable RKL::workaroundTable = {}; diff --git a/shared/source/gen12lp/hw_info_tgllp.cpp b/shared/source/gen12lp/hw_info_tgllp.cpp index f82bc77036..2cb7e03ba8 100644 --- a/shared/source/gen12lp/hw_info_tgllp.cpp +++ b/shared/source/gen12lp/hw_info_tgllp.cpp @@ -33,46 +33,46 @@ const PLATFORM TGLLP::platform = { const RuntimeCapabilityTable TGLLP::capabilityTable{ EngineDirectSubmissionInitVec{ {aub_stream::ENGINE_RCS, {true, true}}, - {aub_stream::ENGINE_CCS, {true, true}}}, // directSubmissionEngines - {0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties - MemoryConstants::max64BitAppAddress, // gpuAddressSpace - 0, // sharedSystemMemCapabilities - MemoryConstants::pageSize, // requiredPreemptionSurfaceSize - "", // deviceName - nullptr, // preferredPlatformName - PreemptionMode::ThreadGroup, // defaultPreemptionMode - aub_stream::ENGINE_RCS, // defaultEngineType - 0, // maxRenderFrequency - 30, // clVersionSupport - CmdServicesMemTraceVersion::DeviceValues::Tgllp, // aubDeviceId - 1, // extraQuantityThreadsPerEU - 64, // maxProgrammableSlmSize - sizeof(TGLLP::GRF), // grfSize - 36u, // timestampValidBits - 32u, // kernelTimestampValidBits - false, // blitterOperationsSupported - true, // ftrSupportsInteger64BitAtomics - false, // ftrSupportsFP64 - false, // ftrSupportsFP64Emulation - false, // ftrSupports64BitMath - false, // ftrSupportsCoherency - false, // ftrRenderCompressedBuffers - false, // ftrRenderCompressedImages - true, // instrumentationEnabled - true, // ftr64KBpages - false, // supportCacheFlushAfterWalker - true, // supportsImages - true, // supportsOcl21Features - false, // supportsOnDemandPageFaults - false, // supportsIndependentForwardProgress - true, // isIntegratedDevice - true, // supportsMediaBlock - false, // p2pAccessSupported - false, // p2pAtomicAccessSupported - true, // fusedEuEnabled - false, // l0DebuggerSupported; - true, // supportsFloatAtomics - 0 // cxlType + {aub_stream::ENGINE_CCS, {true, true}}}, // directSubmissionEngines + {0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties + MemoryConstants::max64BitAppAddress, // gpuAddressSpace + 0, // sharedSystemMemCapabilities + MemoryConstants::pageSize, // requiredPreemptionSurfaceSize + "", // deviceName + nullptr, // preferredPlatformName + PreemptionMode::ThreadGroup, // defaultPreemptionMode + aub_stream::ENGINE_RCS, // defaultEngineType + 0, // maxRenderFrequency + 30, // clVersionSupport + AubMemDump::CmdServicesMemTraceVersion::DeviceValues::Tgllp, // aubDeviceId + 1, // extraQuantityThreadsPerEU + 64, // maxProgrammableSlmSize + sizeof(TGLLP::GRF), // grfSize + 36u, // timestampValidBits + 32u, // kernelTimestampValidBits + false, // blitterOperationsSupported + true, // ftrSupportsInteger64BitAtomics + false, // ftrSupportsFP64 + false, // ftrSupportsFP64Emulation + false, // ftrSupports64BitMath + false, // ftrSupportsCoherency + false, // ftrRenderCompressedBuffers + false, // ftrRenderCompressedImages + true, // instrumentationEnabled + true, // ftr64KBpages + false, // supportCacheFlushAfterWalker + true, // supportsImages + true, // supportsOcl21Features + false, // supportsOnDemandPageFaults + false, // supportsIndependentForwardProgress + true, // isIntegratedDevice + true, // supportsMediaBlock + false, // p2pAccessSupported + false, // p2pAtomicAccessSupported + true, // fusedEuEnabled + false, // l0DebuggerSupported; + true, // supportsFloatAtomics + 0 // cxlType }; WorkaroundTable TGLLP::workaroundTable = {}; diff --git a/shared/source/xe2_hpg_core/hw_info_bmg.cpp b/shared/source/xe2_hpg_core/hw_info_bmg.cpp index 9d39f5b493..708e0fe1c3 100644 --- a/shared/source/xe2_hpg_core/hw_info_bmg.cpp +++ b/shared/source/xe2_hpg_core/hw_info_bmg.cpp @@ -36,46 +36,46 @@ const RuntimeCapabilityTable BMG::capabilityTable{ EngineDirectSubmissionInitVec{ {aub_stream::ENGINE_CCS, {true, false, false, true}}, {aub_stream::ENGINE_CCS1, {true, false, true, true}}, - {aub_stream::ENGINE_BCS, {true, false, true, true}}}, // directSubmissionEngines - {0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties - MemoryConstants::max48BitAddress, // gpuAddressSpace - 0, // sharedSystemMemCapabilities - MemoryConstants::pageSize, // requiredPreemptionSurfaceSize - "", // deviceName - nullptr, // preferredPlatformName - PreemptionMode::MidThread, // defaultPreemptionMode - aub_stream::ENGINE_CCS, // defaultEngineType - 0, // maxRenderFrequency - 30, // clVersionSupport - CmdServicesMemTraceVersion::DeviceValues::Bmg, // aubDeviceId - 0, // extraQuantityThreadsPerEU - 128, // maxProgrammableSlmSize - sizeof(BMG::GRF), // grfSize - 64, // timestampValidBits - 64, // kernelTimestampValidBits - false, // blitterOperationsSupported - true, // ftrSupportsInteger64BitAtomics - true, // ftrSupportsFP64 - false, // ftrSupportsFP64Emulation - true, // ftrSupports64BitMath - false, // ftrSupportsCoherency - false, // ftrRenderCompressedBuffers - false, // ftrRenderCompressedImages - true, // ftr64KBpages - true, // instrumentationEnabled - false, // supportCacheFlushAfterWalker - true, // supportsImages - true, // supportsOcl21Features - true, // supportsOnDemandPageFaults - true, // supportsIndependentForwardProgress - false, // isIntegratedDevice - false, // supportsMediaBlock - false, // p2pAccessSupported - false, // p2pAtomicAccessSupported - false, // fusedEuEnabled - true, // l0DebuggerSupported; - true, // supportsFloatAtomics - 0 // cxlType + {aub_stream::ENGINE_BCS, {true, false, true, true}}}, // directSubmissionEngines + {0, 0, 0, 0, false, false, false, false}, // kmdNotifyProperties + MemoryConstants::max48BitAddress, // gpuAddressSpace + 0, // sharedSystemMemCapabilities + MemoryConstants::pageSize, // requiredPreemptionSurfaceSize + "", // deviceName + nullptr, // preferredPlatformName + PreemptionMode::MidThread, // defaultPreemptionMode + aub_stream::ENGINE_CCS, // defaultEngineType + 0, // maxRenderFrequency + 30, // clVersionSupport + AubMemDump::CmdServicesMemTraceVersion::DeviceValues::Bmg, // aubDeviceId + 0, // extraQuantityThreadsPerEU + 128, // maxProgrammableSlmSize + sizeof(BMG::GRF), // grfSize + 64, // timestampValidBits + 64, // kernelTimestampValidBits + false, // blitterOperationsSupported + true, // ftrSupportsInteger64BitAtomics + true, // ftrSupportsFP64 + false, // ftrSupportsFP64Emulation + true, // ftrSupports64BitMath + false, // ftrSupportsCoherency + false, // ftrRenderCompressedBuffers + false, // ftrRenderCompressedImages + true, // ftr64KBpages + true, // instrumentationEnabled + false, // supportCacheFlushAfterWalker + true, // supportsImages + true, // supportsOcl21Features + true, // supportsOnDemandPageFaults + true, // supportsIndependentForwardProgress + false, // isIntegratedDevice + false, // supportsMediaBlock + false, // p2pAccessSupported + false, // p2pAtomicAccessSupported + false, // fusedEuEnabled + true, // l0DebuggerSupported; + true, // supportsFloatAtomics + 0 // cxlType }; void BMG::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo, const ReleaseHelper &releaseHelper) { diff --git a/shared/source/xe2_hpg_core/hw_info_lnl.cpp b/shared/source/xe2_hpg_core/hw_info_lnl.cpp index 6bd3df9832..cf779e669b 100644 --- a/shared/source/xe2_hpg_core/hw_info_lnl.cpp +++ b/shared/source/xe2_hpg_core/hw_info_lnl.cpp @@ -45,7 +45,7 @@ const RuntimeCapabilityTable LNL::capabilityTable{ aub_stream::ENGINE_CCS, // defaultEngineType 0, // maxRenderFrequency 30, // clVersionSupport - CmdServicesMemTraceVersion::DeviceValues::Lnl, // aubDeviceId + AubMemDump::CmdServicesMemTraceVersion::DeviceValues::Lnl, // aubDeviceId 0, // extraQuantityThreadsPerEU 128, // maxProgrammableSlmSize sizeof(LNL::GRF), // grfSize diff --git a/shared/source/xe3_core/hw_info_ptl.cpp b/shared/source/xe3_core/hw_info_ptl.cpp index 82d01ea040..1792d9fc69 100644 --- a/shared/source/xe3_core/hw_info_ptl.cpp +++ b/shared/source/xe3_core/hw_info_ptl.cpp @@ -45,7 +45,7 @@ const RuntimeCapabilityTable PTL::capabilityTable{ aub_stream::ENGINE_CCS, // defaultEngineType 0, // maxRenderFrequency 30, // clVersionSupport - CmdServicesMemTraceVersion::DeviceValues::Ptl, // aubDeviceId + AubMemDump::CmdServicesMemTraceVersion::DeviceValues::Ptl, // aubDeviceId 0, // extraQuantityThreadsPerEU 128, // maxProgrammableSlmSize sizeof(PTL::GRF), // grfSize diff --git a/shared/source/xe_hpc_core/hw_info_pvc.cpp b/shared/source/xe_hpc_core/hw_info_pvc.cpp index e8b63c79c2..088bb4491e 100644 --- a/shared/source/xe_hpc_core/hw_info_pvc.cpp +++ b/shared/source/xe_hpc_core/hw_info_pvc.cpp @@ -57,7 +57,7 @@ const RuntimeCapabilityTable PVC::capabilityTable{ aub_stream::ENGINE_CCS, // defaultEngineType 0, // maxRenderFrequency 30, // clVersionSupport - CmdServicesMemTraceVersion::DeviceValues::Pvc, // aubDeviceId + AubMemDump::CmdServicesMemTraceVersion::DeviceValues::Pvc, // aubDeviceId 0, // extraQuantityThreadsPerEU 128, // maxProgrammableSlmSize sizeof(PVC::GRF), // grfSize diff --git a/shared/source/xe_hpg_core/hw_info_arl.cpp b/shared/source/xe_hpg_core/hw_info_arl.cpp index e7f4e001a3..ed77b1428d 100644 --- a/shared/source/xe_hpg_core/hw_info_arl.cpp +++ b/shared/source/xe_hpg_core/hw_info_arl.cpp @@ -42,7 +42,7 @@ const RuntimeCapabilityTable ARL::capabilityTable{ aub_stream::ENGINE_CCS, // defaultEngineType 0, // maxRenderFrequency 30, // clVersionSupport - CmdServicesMemTraceVersion::DeviceValues::Arl, // aubDeviceId + AubMemDump::CmdServicesMemTraceVersion::DeviceValues::Arl, // aubDeviceId 0, // extraQuantityThreadsPerEU 64, // maxProgrammableSlmSize sizeof(ARL::GRF), // grfSize diff --git a/shared/source/xe_hpg_core/hw_info_dg2.cpp b/shared/source/xe_hpg_core/hw_info_dg2.cpp index 239925d45c..1ff8d3c9bc 100644 --- a/shared/source/xe_hpg_core/hw_info_dg2.cpp +++ b/shared/source/xe_hpg_core/hw_info_dg2.cpp @@ -47,7 +47,7 @@ const RuntimeCapabilityTable DG2::capabilityTable{ aub_stream::ENGINE_CCS, // defaultEngineType 0, // maxRenderFrequency 30, // clVersionSupport - CmdServicesMemTraceVersion::DeviceValues::Dg2, // aubDeviceId + AubMemDump::CmdServicesMemTraceVersion::DeviceValues::Dg2, // aubDeviceId 0, // extraQuantityThreadsPerEU 64, // maxProgrammableSlmSize sizeof(DG2::GRF), // grfSize diff --git a/shared/source/xe_hpg_core/hw_info_mtl.cpp b/shared/source/xe_hpg_core/hw_info_mtl.cpp index 9e469f79e9..d8c59232f5 100644 --- a/shared/source/xe_hpg_core/hw_info_mtl.cpp +++ b/shared/source/xe_hpg_core/hw_info_mtl.cpp @@ -43,7 +43,7 @@ const RuntimeCapabilityTable MTL::capabilityTable{ aub_stream::ENGINE_CCS, // defaultEngineType 0, // maxRenderFrequency 30, // clVersionSupport - CmdServicesMemTraceVersion::DeviceValues::Mtl, // aubDeviceId + AubMemDump::CmdServicesMemTraceVersion::DeviceValues::Mtl, // aubDeviceId 0, // extraQuantityThreadsPerEU 64, // maxProgrammableSlmSize sizeof(MTL::GRF), // grfSize diff --git a/shared/test/common/mocks/mock_aub_center.h b/shared/test/common/mocks/mock_aub_center.h index 96c2ac7335..e1f3af99b0 100644 --- a/shared/test/common/mocks/mock_aub_center.h +++ b/shared/test/common/mocks/mock_aub_center.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -12,15 +12,6 @@ #include "shared/test/common/mocks/mock_aub_file_stream.h" namespace NEO { -class MockAubStreamProvider : public AubStreamProvider { - public: - AubMemDump::AubFileStream *getStream() override { - return &stream; - } - - protected: - MockAubFileStream stream; -}; class MockAubCenter : public AubCenter { public: @@ -30,7 +21,6 @@ class MockAubCenter : public AubCenter { using AubCenter::stepping; MockAubCenter() { - streamProvider.reset(new MockAubStreamProvider()); } ~MockAubCenter() override = default; diff --git a/shared/test/common/mocks/mock_aub_csr.h b/shared/test/common/mocks/mock_aub_csr.h index d8458962fc..b8eb72e71f 100644 --- a/shared/test/common/mocks/mock_aub_csr.h +++ b/shared/test/common/mocks/mock_aub_csr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2024 Intel Corporation + * Copyright (C) 2018-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -172,7 +172,12 @@ struct MockAubCsr : public AUBCommandStreamReceiverHw { bool addAubCommentCalled = false; bool dumpAllocationCalled = false; bool skipTaskCountCheckForCompletionPoll = false; + bool lockStreamCalled = false; + std::unique_lock lockStream() override { + lockStreamCalled = true; + return AUBCommandStreamReceiverHw::lockStream(); + } void initFile(const std::string &fileName) override { fileIsOpen = true; openFileName = fileName; diff --git a/shared/test/common/mocks/mock_aub_file_stream.h b/shared/test/common/mocks/mock_aub_file_stream.h index d606d8bf3c..865283c3f4 100644 --- a/shared/test/common/mocks/mock_aub_file_stream.h +++ b/shared/test/common/mocks/mock_aub_file_stream.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -12,7 +12,6 @@ #include namespace NEO { - struct MockAubFileStream : public AUBCommandStreamReceiver::AubFileStream { bool init(uint32_t stepping, uint32_t device) override { initCalledCnt++; @@ -37,10 +36,6 @@ struct MockAubFileStream : public AUBCommandStreamReceiver::AubFileStream { void flush() override { flushCalled = true; } - std::unique_lock lockStream() override { - lockStreamCalled = true; - return AUBCommandStreamReceiver::AubFileStream::lockStream(); - } void expectMMIO(uint32_t mmioRegister, uint32_t expectedValue) override { mmioRegisterFromExpectMMIO = mmioRegister; expectedValueFromExpectMMIO = expectedValue; diff --git a/shared/test/unit_test/command_stream/aub_file_stream_tests.cpp b/shared/test/unit_test/command_stream/aub_file_stream_tests.cpp index 68dc591b9c..527af27dc1 100644 --- a/shared/test/unit_test/command_stream/aub_file_stream_tests.cpp +++ b/shared/test/unit_test/command_stream/aub_file_stream_tests.cpp @@ -163,126 +163,95 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithAubManagerWhenFile } HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenOpenFileIsCalledThenFileStreamShouldBeLocked) { - auto mockAubFileStream = std::make_unique(); - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); std::string fileName = "file_name.aub"; - aubCsr->stream = mockAubFileStream.get(); - aubCsr->openFile(fileName); - EXPECT_TRUE(mockAubFileStream->lockStreamCalled); + + EXPECT_TRUE(aubCsr->lockStreamCalled); } HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenReopenFileIsCalledThenFileStreamShouldBeLocked) { - auto mockAubFileStream = std::make_unique(); - auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); + auto aubCsr = std::make_unique>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); std::string fileName = "file_name.aub"; - aubCsr->stream = mockAubFileStream.get(); - aubCsr->reopenFile(fileName); - EXPECT_TRUE(mockAubFileStream->lockStreamCalled); + EXPECT_TRUE(aubCsr->lockStreamCalled); } HWTEST_F(AubFileStreamWithoutAubStreamTests, givenAubCommandStreamReceiverWhenInitializeEngineIsCalledThenFileStreamShouldBeLocked) { - - auto mockAubFileStream = std::make_unique(); - auto aubExecutionEnvironment = getEnvironment>(true, true, true); - auto aubCsr = aubExecutionEnvironment->template getCsr>(); - - aubCsr->stream = static_cast(mockAubFileStream.get()); + auto aubExecutionEnvironment = getEnvironment>(true, true, true); + auto aubCsr = aubExecutionEnvironment->template getCsr>(); aubCsr->initializeEngine(); - EXPECT_TRUE(mockAubFileStream->lockStreamCalled); + EXPECT_TRUE(aubCsr->lockStreamCalled); } HWTEST_F(AubFileStreamWithoutAubStreamTests, givenAubCommandStreamReceiverWhenSubmitBatchBufferIsCalledThenFileStreamShouldBeLocked) { - - auto mockAubFileStream = std::make_unique(); - auto aubExecutionEnvironment = getEnvironment>(true, true, true); - auto aubCsr = aubExecutionEnvironment->template getCsr>(); + auto aubExecutionEnvironment = getEnvironment>(true, true, true); + auto aubCsr = aubExecutionEnvironment->template getCsr>(); LinearStream cs(aubExecutionEnvironment->commandBuffer); BatchBuffer batchBuffer = BatchBufferHelper::createDefaultBatchBuffer(cs.getGraphicsAllocation(), &cs, cs.getUsed()); - aubCsr->stream = static_cast(mockAubFileStream.get()); - auto pBatchBuffer = ptrOffset(batchBuffer.commandBufferAllocation->getUnderlyingBuffer(), batchBuffer.startOffset); auto batchBufferGpuAddress = ptrOffset(batchBuffer.commandBufferAllocation->getGpuAddress(), batchBuffer.startOffset); auto currentOffset = batchBuffer.usedSize; auto sizeBatchBuffer = currentOffset - batchBuffer.startOffset; aubCsr->initializeEngine(); - mockAubFileStream->lockStreamCalled = false; + aubCsr->lockStreamCalled = false; aubCsr->submitBatchBufferAub(batchBufferGpuAddress, pBatchBuffer, sizeBatchBuffer, aubCsr->getMemoryBank(batchBuffer.commandBufferAllocation), aubCsr->getPPGTTAdditionalBits(batchBuffer.commandBufferAllocation)); - EXPECT_TRUE(mockAubFileStream->lockStreamCalled); + EXPECT_TRUE(aubCsr->lockStreamCalled); } HWTEST_F(AubFileStreamWithoutAubStreamTests, givenAubCommandStreamReceiverWhenWriteMemoryIsCalledThenFileStreamShouldBeLocked) { + auto aubExecutionEnvironment = getEnvironment>(true, true, true); + auto aubCsr = aubExecutionEnvironment->template getCsr>(); - auto mockAubFileStream = std::make_unique(); - auto aubExecutionEnvironment = getEnvironment>(true, true, true); - auto aubCsr = aubExecutionEnvironment->template getCsr>(); aubCsr->initializeEngine(); - aubCsr->stream = static_cast(mockAubFileStream.get()); - MockGraphicsAllocation allocation(reinterpret_cast(0x1000), 0x1000); aubCsr->writeMemory(allocation); - EXPECT_TRUE(mockAubFileStream->lockStreamCalled); + EXPECT_TRUE(aubCsr->lockStreamCalled); } HWTEST_F(AubFileStreamWithoutAubStreamTests, givenAubCommandStreamReceiverWhenPollForCompletionIsCalledThenFileStreamShouldBeLocked) { - - auto mockAubFileStream = std::make_unique(); auto aubExecutionEnvironment = getEnvironment>(true, true, true); auto aubCsr = aubExecutionEnvironment->template getCsr>(); - aubCsr->stream = static_cast(mockAubFileStream.get()); - aubCsr->latestSentTaskCount = 1; aubCsr->pollForCompletionTaskCount = 0; aubCsr->pollForCompletion(); - EXPECT_TRUE(mockAubFileStream->lockStreamCalled); + EXPECT_TRUE(aubCsr->lockStreamCalled); } HWTEST_F(AubFileStreamWithoutAubStreamTests, givenAubCommandStreamReceiverWhenExpectMemoryEqualIsCalledThenFileStreamShouldBeLocked) { - - auto mockAubFileStream = std::make_unique(); auto aubExecutionEnvironment = getEnvironment>(true, true, true); auto aubCsr = aubExecutionEnvironment->template getCsr>(); - aubCsr->stream = static_cast(mockAubFileStream.get()); - aubCsr->expectMemoryEqual(reinterpret_cast(0x1000), reinterpret_cast(0x1000), 0x1000); - EXPECT_TRUE(mockAubFileStream->lockStreamCalled); + EXPECT_TRUE(aubCsr->lockStreamCalled); } HWTEST_F(AubFileStreamWithoutAubStreamTests, givenAubCommandStreamReceiverWhenAddAubCommentIsCalledThenFileStreamShouldBeLocked) { - - auto mockAubFileStream = std::make_unique(); auto aubExecutionEnvironment = getEnvironment>(true, true, true); auto aubCsr = aubExecutionEnvironment->template getCsr>(); - aubCsr->stream = static_cast(mockAubFileStream.get()); - aubCsr->addAubComment("comment"); - EXPECT_TRUE(mockAubFileStream->lockStreamCalled); + EXPECT_TRUE(aubCsr->lockStreamCalled); } HWTEST_F(AubFileStreamWithoutAubStreamTests, givenAubCommandStreamReceiverWhenDumpAllocationIsCalledThenFileStreamShouldBeLocked) { - auto mockAubFileStream = std::make_unique(); auto aubExecutionEnvironment = getEnvironment>(true, true, true); auto aubCsr = aubExecutionEnvironment->template getCsr>(); GraphicsAllocation allocation{0, 1u /*num gmms*/, AllocationType::unknown, nullptr, 0, 0, 0, MemoryPool::memoryNull, MemoryManager::maxOsContextCount}; - aubCsr->stream = static_cast(mockAubFileStream.get()); - aubCsr->dumpAllocation(allocation); - EXPECT_TRUE(mockAubFileStream->lockStreamCalled); + EXPECT_TRUE(aubCsr->lockStreamCalled); } HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenFlushIsCalledThenItShouldCallTheExpectedFunctions) { 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 0419773e55..c1f3d014e4 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 @@ -531,19 +531,6 @@ HWTEST_F(SimulatedCsrTest, givenTbxWithAubDumpCsrTypeWhenCreateCommandStreamRece EXPECT_NE(nullptr, rootDeviceEnvironment->aubCenter.get()); } -HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenNullAubManagerAvailableWhenTbxCsrWithAubDumpIsCreatedThenAubCsrIsCreated) { - DebugManagerStateRestore stateRestore; - debugManager.flags.UseAubStream.set(false); - - MockAubCenter *mockAubCenter = new MockAubCenter(); - ExecutionEnvironment *executionEnvironment = pDevice->getExecutionEnvironment(); - executionEnvironment->initializeMemoryManager(); - executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr(mockAubCenter); - DeviceBitfield deviceBitfield(1); - CommandStreamReceiverWithAUBDump> csrWithAubDump("aubfile", *executionEnvironment, 0, deviceBitfield); - EXPECT_NE(nullptr, csrWithAubDump.aubCSR); -} - HWTEST_F(CommandStreamReceiverWithAubDumpSimpleTest, givenAubManagerNotAvailableWhenHwCsrWithAubDumpIsCreatedThenAubCsrIsCreated) { std::string fileName = "file_name.aub";