Skip to content

Commit 9ff91de

Browse files
Add API name to aub file name
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
1 parent 0a83d61 commit 9ff91de

File tree

10 files changed

+33
-12
lines changed

10 files changed

+33
-12
lines changed

level_zero/core/source/helpers/api_specific_config_l0.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ ApiSpecificConfig::ApiType ApiSpecificConfig::getApiType() {
2929
return ApiSpecificConfig::L0;
3030
}
3131

32-
const char *ApiSpecificConfig::getAubPrefixForSpecificApi() {
33-
return "l0_";
32+
std::string ApiSpecificConfig::getName() {
33+
return "l0";
3434
}
3535

3636
uint64_t ApiSpecificConfig::getReducedMaxAllocSize(uint64_t maxAllocSize) {

level_zero/core/test/unit_tests/sources/helper/api_specific_config_l0_tests.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ TEST(ApiSpecificConfigL0Tests, WhenGettingApiTypeThenCorrectTypeIsReturned) {
1616
}
1717

1818
TEST(ApiSpecificConfigL0Tests, WhenGettingAUBPrefixByApiTypeL0IsReturned) {
19-
EXPECT_EQ(0, strcmp("l0_", ApiSpecificConfig::getAubPrefixForSpecificApi()));
19+
EXPECT_EQ(0, strcmp("l0_", ApiSpecificConfig::getAubPrefixForSpecificApi().c_str()));
20+
}
21+
22+
TEST(ApiSpecificConfigL0Tests, WhenGettingNameL0IsReturned) {
23+
EXPECT_EQ(0, strcmp("l0", ApiSpecificConfig::getName().c_str()));
2024
}
2125

2226
TEST(ApiSpecificConfigL0Tests, WhenCheckingIfStatelessCompressionIsSupportedThenReturnFalse) {

opencl/source/command_stream/create_command_stream_impl.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "shared/source/command_stream/tbx_command_stream_receiver.h"
1010
#include "shared/source/execution_environment/execution_environment.h"
1111
#include "shared/source/execution_environment/root_device_environment.h"
12+
#include "shared/source/helpers/api_specific_config.h"
1213
#include "shared/source/os_interface/device_factory.h"
1314

1415
#include "opencl/source/command_stream/command_stream_receiver_with_aub_dump.h"
@@ -29,12 +30,13 @@ CommandStreamReceiver *createCommandStreamImpl(ExecutionEnvironment &executionEn
2930
if (csr < 0) {
3031
csr = CommandStreamReceiverType::CSR_HW;
3132
}
33+
3234
switch (csr) {
3335
case CSR_HW:
3436
commandStreamReceiver = funcCreate(false, executionEnvironment, rootDeviceIndex, deviceBitfield);
3537
break;
3638
case CSR_AUB:
37-
commandStreamReceiver = AUBCommandStreamReceiver::create("aubfile", true, executionEnvironment, rootDeviceIndex, deviceBitfield);
39+
commandStreamReceiver = AUBCommandStreamReceiver::create(ApiSpecificConfig::getName(), true, executionEnvironment, rootDeviceIndex, deviceBitfield);
3840
break;
3941
case CSR_TBX:
4042
commandStreamReceiver = TbxCommandStreamReceiver::create("", false, executionEnvironment, rootDeviceIndex, deviceBitfield);
@@ -43,7 +45,7 @@ CommandStreamReceiver *createCommandStreamImpl(ExecutionEnvironment &executionEn
4345
commandStreamReceiver = funcCreate(true, executionEnvironment, rootDeviceIndex, deviceBitfield);
4446
break;
4547
case CSR_TBX_WITH_AUB:
46-
commandStreamReceiver = TbxCommandStreamReceiver::create("aubfile", true, executionEnvironment, rootDeviceIndex, deviceBitfield);
48+
commandStreamReceiver = TbxCommandStreamReceiver::create(ApiSpecificConfig::getName(), true, executionEnvironment, rootDeviceIndex, deviceBitfield);
4749
break;
4850
default:
4951
break;

opencl/source/helpers/api_specific_config_ocl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ ApiSpecificConfig::ApiType ApiSpecificConfig::getApiType() {
2929
return ApiSpecificConfig::OCL;
3030
}
3131

32-
const char *ApiSpecificConfig::getAubPrefixForSpecificApi() {
33-
return "ocl_";
32+
std::string ApiSpecificConfig::getName() {
33+
return "ocl";
3434
}
3535

3636
uint64_t ApiSpecificConfig::getReducedMaxAllocSize(uint64_t maxAllocSize) {

opencl/source/os_interface/linux/device_command_stream.inl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include "shared/source/command_stream/device_command_stream.h"
99
#include "shared/source/debug_settings/debug_settings_manager.h"
10+
#include "shared/source/helpers/api_specific_config.h"
1011

1112
#include "opencl/source/command_stream/command_stream_receiver_with_aub_dump.h"
1213
#include "opencl/source/os_interface/linux/drm_command_stream.h"
@@ -19,7 +20,7 @@ CommandStreamReceiver *createDrmCommandStreamReceiver(bool withAubDump,
1920
uint32_t rootDeviceIndex,
2021
const DeviceBitfield deviceBitfield) {
2122
if (withAubDump) {
22-
return new CommandStreamReceiverWithAUBDump<DrmCommandStreamReceiver<GfxFamily>>("aubfile",
23+
return new CommandStreamReceiverWithAUBDump<DrmCommandStreamReceiver<GfxFamily>>(ApiSpecificConfig::getName(),
2324
executionEnvironment,
2425
rootDeviceIndex,
2526
deviceBitfield);

opencl/source/os_interface/windows/device_command_stream.inl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#pragma warning(push)
1111
#pragma warning(disable : 4005)
1212
#include "shared/source/command_stream/device_command_stream.h"
13+
#include "shared/source/helpers/api_specific_config.h"
1314

1415
#include "opencl/source/command_stream/command_stream_receiver_with_aub_dump.h"
1516
#include "opencl/source/os_interface/windows/wddm_device_command_stream.h"
@@ -25,7 +26,7 @@ CommandStreamReceiver *createWddmCommandStreamReceiver(bool withAubDump,
2526
uint32_t rootDeviceIndex,
2627
const DeviceBitfield deviceBitfield) {
2728
if (withAubDump) {
28-
return new CommandStreamReceiverWithAUBDump<WddmCommandStreamReceiver<GfxFamily>>("aubfile",
29+
return new CommandStreamReceiverWithAUBDump<WddmCommandStreamReceiver<GfxFamily>>(ApiSpecificConfig::getName(),
2930
executionEnvironment,
3031
rootDeviceIndex,
3132
deviceBitfield);

opencl/source/os_interface/windows/wddm_device_command_stream.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ CommandStreamReceiver *createWddmDeviceCommandStreamReceiver(bool withAubDump,
166166
uint32_t rootDeviceIndex,
167167
const DeviceBitfield deviceBitfield) {
168168
if (withAubDump) {
169-
return new CommandStreamReceiverWithAUBDump<WddmCommandStreamReceiver<GfxFamily>>("aubfile",
169+
return new CommandStreamReceiverWithAUBDump<WddmCommandStreamReceiver<GfxFamily>>(ApiSpecificConfig::getName(),
170170
executionEnvironment,
171171
rootDeviceIndex,
172172
deviceBitfield);

opencl/test/unit_test/helpers/api_specific_config_ocl_tests.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ TEST(ApiSpecificConfigOclTests, WhenGettingApiTypeThenCorrectTypeIsReturned) {
1616
}
1717

1818
TEST(ApiSpecificConfigOclTests, WhenGettingAUBPrefixByApiTypeOCLIsReturned) {
19-
EXPECT_EQ(0, strcmp("ocl_", ApiSpecificConfig::getAubPrefixForSpecificApi()));
19+
EXPECT_EQ(0, strcmp("ocl_", ApiSpecificConfig::getAubPrefixForSpecificApi().c_str()));
20+
}
21+
22+
TEST(ApiSpecificConfigOclTests, WhenGettingNameOCLIsReturned) {
23+
EXPECT_EQ(0, strcmp("ocl", ApiSpecificConfig::getName().c_str()));
2024
}
2125

2226
TEST(ApiSpecificConfigOclTests, WhenCheckingIfStatelessCompressionIsSupportedThenReturnTrue) {

shared/source/helpers/api_specific_config.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
#include <cstdint>
9+
#include <string>
910

1011
#pragma once
1112
namespace NEO {
@@ -16,7 +17,11 @@ struct ApiSpecificConfig {
1617
static bool getHeapConfiguration();
1718
static bool getBindlessConfiguration();
1819
static ApiType getApiType();
19-
static const char *getAubPrefixForSpecificApi();
20+
static std::string getName();
2021
static uint64_t getReducedMaxAllocSize(uint64_t maxAllocSize);
22+
23+
static std::string getAubPrefixForSpecificApi() {
24+
return (getName() + "_");
25+
}
2126
};
2227
} // namespace NEO

shared/test/common/helpers/api_specific_config_shared_tests.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,8 @@ uint64_t ApiSpecificConfig::getReducedMaxAllocSize(uint64_t maxAllocSize) {
3030
return maxAllocSize / 2;
3131
}
3232

33+
std::string ApiSpecificConfig::getName() {
34+
return "shared";
35+
}
36+
3337
} // namespace NEO

0 commit comments

Comments
 (0)