diff --git a/opencl/source/command_stream/aub_command_stream_receiver.cpp b/opencl/source/command_stream/aub_command_stream_receiver.cpp index adb8b7a0cc..34322426e7 100644 --- a/opencl/source/command_stream/aub_command_stream_receiver.cpp +++ b/opencl/source/command_stream/aub_command_stream_receiver.cpp @@ -24,7 +24,7 @@ namespace NEO { AubCommandStreamReceiverCreateFunc aubCommandStreamReceiverFactory[IGFX_MAX_CORE] = {}; -std::string AUBCommandStreamReceiver::createFullFilePath(const HardwareInfo &hwInfo, const std::string &filename) { +std::string AUBCommandStreamReceiver::createFullFilePath(const HardwareInfo &hwInfo, const std::string &filename, uint32_t rootDeviceIndex) { std::string hwPrefix = hardwarePrefix[hwInfo.platform.eProductFamily]; // Generate the full filename @@ -36,7 +36,7 @@ std::string AUBCommandStreamReceiver::createFullFilePath(const HardwareInfo &hwI if (subDevicesCount > 1) { strfilename << subDevicesCount << "tx"; } - strfilename << gtSystemInfo.SliceCount << "x" << subSlicesPerSlice << "x" << gtSystemInfo.MaxEuPerSubSlice << "_" << filename << ".aub"; + strfilename << gtSystemInfo.SliceCount << "x" << subSlicesPerSlice << "x" << gtSystemInfo.MaxEuPerSubSlice << "_" << rootDeviceIndex << "_" << filename << ".aub"; // clean-up any fileName issues because of the file system incompatibilities auto fileName = strfilename.str(); @@ -57,7 +57,7 @@ CommandStreamReceiver *AUBCommandStreamReceiver::create(const std::string &baseN uint32_t rootDeviceIndex, const DeviceBitfield deviceBitfield) { auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); - std::string filePath = AUBCommandStreamReceiver::createFullFilePath(*hwInfo, baseName); + std::string filePath = AUBCommandStreamReceiver::createFullFilePath(*hwInfo, baseName, rootDeviceIndex); if (DebugManager.flags.AUBDumpCaptureFileName.get() != "unk") { filePath.assign(DebugManager.flags.AUBDumpCaptureFileName.get()); } diff --git a/opencl/source/command_stream/aub_command_stream_receiver.h b/opencl/source/command_stream/aub_command_stream_receiver.h index 032d9f33d1..828faea9f8 100644 --- a/opencl/source/command_stream/aub_command_stream_receiver.h +++ b/opencl/source/command_stream/aub_command_stream_receiver.h @@ -23,7 +23,7 @@ struct AUBCommandStreamReceiver { ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, const DeviceBitfield deviceBitfield); - static std::string createFullFilePath(const HardwareInfo &hwInfo, const std::string &filename); + static std::string createFullFilePath(const HardwareInfo &hwInfo, const std::string &filename, uint32_t rootDeviceIndex); using AubFileStream = AubMemDump::AubFileStream; }; diff --git a/opencl/source/command_stream/tbx_command_stream_receiver_hw.inl b/opencl/source/command_stream/tbx_command_stream_receiver_hw.inl index eb8ac31858..d3d2a7d0a9 100644 --- a/opencl/source/command_stream/tbx_command_stream_receiver_hw.inl +++ b/opencl/source/command_stream/tbx_command_stream_receiver_hw.inl @@ -164,7 +164,7 @@ CommandStreamReceiver *TbxCommandStreamReceiverHw::create(const std:: auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); if (withAubDump) { auto localMemoryEnabled = hwHelper.getEnableLocalMemory(hwInfo); - auto fullName = AUBCommandStreamReceiver::createFullFilePath(hwInfo, baseName); + auto fullName = AUBCommandStreamReceiver::createFullFilePath(hwInfo, baseName, rootDeviceIndex); if (DebugManager.flags.AUBDumpCaptureFileName.get() != "unk") { fullName.assign(DebugManager.flags.AUBDumpCaptureFileName.get()); } diff --git a/opencl/test/unit_test/command_stream/aub_file_stream_tests.cpp b/opencl/test/unit_test/command_stream/aub_file_stream_tests.cpp index b6dca87495..6ffc967034 100644 --- a/opencl/test/unit_test/command_stream/aub_file_stream_tests.cpp +++ b/opencl/test/unit_test/command_stream/aub_file_stream_tests.cpp @@ -987,10 +987,16 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenCreateFullFilePath DebugManagerStateRestore stateRestore; DebugManager.flags.CreateMultipleSubDevices.set(1); - auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile"); + auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile", mockRootDeviceIndex); EXPECT_EQ(std::string::npos, fullName.find("tx")); DebugManager.flags.CreateMultipleSubDevices.set(2); - fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile"); + fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile", mockRootDeviceIndex); EXPECT_NE(std::string::npos, fullName.find("2tx")); } + +HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenCreateFullFilePathIsCalledThenFileNameIsExtendedWithRootDeviceIndex) { + uint32_t rootDeviceIndex = 123u; + auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile", rootDeviceIndex); + EXPECT_NE(std::string::npos, fullName.find("_123_aubfile.aub")); +} diff --git a/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp b/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp index fdf4cb30b9..51328c438f 100644 --- a/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp +++ b/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp @@ -576,7 +576,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenCreatedWithAubDumpThenFileNameIsE auto rootDeviceEnvironment = static_cast(executionEnvironment.rootDeviceEnvironments[0].get()); setMockAubCenter(*rootDeviceEnvironment, CommandStreamReceiverType::CSR_TBX); - auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile"); + auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile", mockRootDeviceIndex); std::unique_ptr> tbxCsr(reinterpret_cast *>(TbxCommandStreamReceiver::create("aubfile", true, executionEnvironment, 0, 1))); EXPECT_STREQ(fullName.c_str(), rootDeviceEnvironment->aubFileNameReceived.c_str());