Skip to content

Commit 6ea2d8c

Browse files
Extract creating aub file name to separate function
Change-Id: Ie0506f1847684cc3aabd8bee153c944b2f49bdb8 Signed-off-by: Dunajski, Bartosz <[email protected]>
1 parent 25a93d4 commit 6ea2d8c

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

runtime/command_stream/aub_command_stream_receiver.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2017-2018 Intel Corporation
2+
* Copyright (C) 2017-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -18,14 +18,14 @@
1818
namespace OCLRT {
1919
AubCommandStreamReceiverCreateFunc aubCommandStreamReceiverFactory[IGFX_MAX_CORE] = {};
2020

21-
CommandStreamReceiver *AUBCommandStreamReceiver::create(const HardwareInfo &hwInfo, const std::string &baseName, bool standalone, ExecutionEnvironment &executionEnvironment) {
21+
std::string AUBCommandStreamReceiver::createFullFilePath(const HardwareInfo &hwInfo, const std::string &filename) {
2222
std::string hwPrefix = hardwarePrefix[hwInfo.pPlatform->eProductFamily];
2323

2424
// Generate the full filename
2525
const auto &gtSystemInfo = *hwInfo.pSysInfo;
2626
std::stringstream strfilename;
2727
uint32_t subSlicesPerSlice = gtSystemInfo.SubSliceCount / gtSystemInfo.SliceCount;
28-
strfilename << hwPrefix << "_" << gtSystemInfo.SliceCount << "x" << subSlicesPerSlice << "x" << gtSystemInfo.MaxEuPerSubSlice << "_" << baseName << ".aub";
28+
strfilename << hwPrefix << "_" << gtSystemInfo.SliceCount << "x" << subSlicesPerSlice << "x" << gtSystemInfo.MaxEuPerSubSlice << "_" << filename << ".aub";
2929

3030
// clean-up any fileName issues because of the file system incompatibilities
3131
auto fileName = strfilename.str();
@@ -37,6 +37,11 @@ CommandStreamReceiver *AUBCommandStreamReceiver::create(const HardwareInfo &hwIn
3737
filePath.append(Os::fileSeparator);
3838
filePath.append(fileName);
3939

40+
return filePath;
41+
}
42+
43+
CommandStreamReceiver *AUBCommandStreamReceiver::create(const HardwareInfo &hwInfo, const std::string &baseName, bool standalone, ExecutionEnvironment &executionEnvironment) {
44+
std::string filePath = AUBCommandStreamReceiver::createFullFilePath(hwInfo, baseName);
4045
if (DebugManager.flags.AUBDumpCaptureFileName.get() != "unk") {
4146
filePath.assign(DebugManager.flags.AUBDumpCaptureFileName.get());
4247
}

runtime/command_stream/aub_command_stream_receiver.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2017-2018 Intel Corporation
2+
* Copyright (C) 2017-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -16,6 +16,7 @@ class ExecutionEnvironment;
1616

1717
struct AUBCommandStreamReceiver {
1818
static CommandStreamReceiver *create(const HardwareInfo &hwInfo, const std::string &filename, bool standalone, ExecutionEnvironment &executionEnvironment);
19+
static std::string createFullFilePath(const HardwareInfo &hwInfo, const std::string &filename);
1920

2021
using AubFileStream = AubMemDump::AubFileStream;
2122
};

0 commit comments

Comments
 (0)