AUB file name with suffix to indicate multiple subdevices

Change-Id: I8a6417e0c1b30c938ce863c15c5cf91da504d330
Signed-off-by: Slawomir Milczarek <slawomir.milczarek@intel.com>
This commit is contained in:
Slawomir Milczarek
2019-12-08 21:23:58 +01:00
parent f2e927004c
commit 9a4e360fc2
2 changed files with 19 additions and 1 deletions

View File

@@ -10,6 +10,7 @@
#include "core/helpers/debug_helpers.h" #include "core/helpers/debug_helpers.h"
#include "core/helpers/hw_info.h" #include "core/helpers/hw_info.h"
#include "runtime/execution_environment/execution_environment.h" #include "runtime/execution_environment/execution_environment.h"
#include "runtime/helpers/device_helpers.h"
#include "runtime/helpers/options.h" #include "runtime/helpers/options.h"
#include "runtime/memory_manager/os_agnostic_memory_manager.h" #include "runtime/memory_manager/os_agnostic_memory_manager.h"
#include "runtime/os_interface/os_inc_base.h" #include "runtime/os_interface/os_inc_base.h"
@@ -27,8 +28,13 @@ std::string AUBCommandStreamReceiver::createFullFilePath(const HardwareInfo &hwI
// Generate the full filename // Generate the full filename
const auto &gtSystemInfo = hwInfo.gtSystemInfo; const auto &gtSystemInfo = hwInfo.gtSystemInfo;
std::stringstream strfilename; std::stringstream strfilename;
auto subDevicesCount = DeviceHelper::getSubDevicesCount(&hwInfo);
uint32_t subSlicesPerSlice = gtSystemInfo.SubSliceCount / gtSystemInfo.SliceCount; uint32_t subSlicesPerSlice = gtSystemInfo.SubSliceCount / gtSystemInfo.SliceCount;
strfilename << hwPrefix << "_" << gtSystemInfo.SliceCount << "x" << subSlicesPerSlice << "x" << gtSystemInfo.MaxEuPerSubSlice << "_" << filename << ".aub"; strfilename << hwPrefix << "_";
if (subDevicesCount > 1) {
strfilename << subDevicesCount << "tx";
}
strfilename << gtSystemInfo.SliceCount << "x" << subSlicesPerSlice << "x" << gtSystemInfo.MaxEuPerSubSlice << "_" << filename << ".aub";
// clean-up any fileName issues because of the file system incompatibilities // clean-up any fileName issues because of the file system incompatibilities
auto fileName = strfilename.str(); auto fileName = strfilename.str();

View File

@@ -975,3 +975,15 @@ HWTEST_F(AubFileStreamTests, givenAddPatchInfoCommentsCalledWhenTargetAllocation
lineNo++; lineNo++;
} }
} }
HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenCreateFullFilePathIsCalledForMultipleDevicesThenFileNameIsExtendedWithSuffixToIndicateMultipleDevices) {
DebugManagerStateRestore stateRestore;
DebugManager.flags.CreateMultipleSubDevices.set(1);
auto fullName = AUBCommandStreamReceiver::createFullFilePath(*platformDevices[0], "aubfile");
EXPECT_EQ(std::string::npos, fullName.find("tx"));
DebugManager.flags.CreateMultipleSubDevices.set(2);
fullName = AUBCommandStreamReceiver::createFullFilePath(*platformDevices[0], "aubfile");
EXPECT_NE(std::string::npos, fullName.find("2tx"));
}