Skip to content

Commit 5f11e68

Browse files
Add EngineType suffix to aub file name in AubFixture
Change-Id: I9b8f27461e6d36d596e85fde973aa1b2f34dbede
1 parent 9a1adc3 commit 5f11e68

File tree

6 files changed

+33
-5
lines changed

6 files changed

+33
-5
lines changed

runtime/device/device.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,8 @@ Device::Device(const HardwareInfo &hwInfo, ExecutionEnvironment *executionEnviro
7070
deviceExtensions.reserve(1000);
7171
name.reserve(100);
7272
preemptionMode = PreemptionHelper::getDefaultPreemptionMode(hwInfo);
73-
engineType = DebugManager.flags.NodeOrdinal.get() == -1
74-
? hwInfo.capabilityTable.defaultEngineType
75-
: static_cast<EngineType>(DebugManager.flags.NodeOrdinal.get());
73+
engineType = getChosenEngineType(hwInfo);
74+
7675
if (!getSourceLevelDebugger()) {
7776
this->executionEnvironment->initSourceLevelDebugger(hwInfo);
7877
}

runtime/helpers/hw_info.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include "hw_info.h"
99
#include "hw_cmds.h"
10+
#include "runtime/os_interface/debug_settings_manager.h"
1011

1112
namespace OCLRT {
1213
HardwareInfo::HardwareInfo(const PLATFORM *platform, const FeatureTable *skuTable, const WorkaroundTable *waTable,
@@ -42,4 +43,10 @@ bool getHwInfoForPlatformString(const char *str, const HardwareInfo *&hwInfoIn)
4243
}
4344
return ret;
4445
}
46+
47+
EngineType getChosenEngineType(const HardwareInfo &hwInfo) {
48+
return DebugManager.flags.NodeOrdinal.get() == -1
49+
? hwInfo.capabilityTable.defaultEngineType
50+
: static_cast<EngineType>(DebugManager.flags.NodeOrdinal.get());
51+
}
4552
} // namespace OCLRT

runtime/helpers/hw_info.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,5 @@ struct EnableGfxFamilyHw {
113113

114114
const char *getPlatformType(const HardwareInfo &hwInfo);
115115
bool getHwInfoForPlatformString(const char *str, const HardwareInfo *&hwInfoIn);
116+
EngineType getChosenEngineType(const HardwareInfo &hwInfo);
116117
} // namespace OCLRT

unit_tests/aub_tests/fixtures/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
target_sources(igdrcl_aub_tests PRIVATE
88
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
9+
${CMAKE_CURRENT_SOURCE_DIR}/aub_fixture.h
910
${CMAKE_CURRENT_SOURCE_DIR}/aub_parent_kernel_fixture.h
1011
${CMAKE_CURRENT_SOURCE_DIR}/fixture_tests.cpp
1112
${CMAKE_CURRENT_SOURCE_DIR}/hello_world_fixture.h

unit_tests/aub_tests/fixtures/aub_fixture.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,12 @@ class AUBFixture : public CommandQueueHwFixture {
2828
const HardwareInfo &hwInfo = hardwareInfo ? *hardwareInfo : *platformDevices[0];
2929
uint32_t deviceIndex = 0;
3030

31+
auto &hwHelper = HwHelper::get(hwInfo.pPlatform->eRenderCoreFamily);
32+
EngineType engineType = getChosenEngineType(hwInfo);
33+
3134
const ::testing::TestInfo *const testInfo = ::testing::UnitTest::GetInstance()->current_test_info();
3235
std::stringstream strfilename;
33-
strfilename << testInfo->test_case_name() << "_" << testInfo->name();
36+
strfilename << testInfo->test_case_name() << "_" << testInfo->name() << "_" << hwHelper.getCsTraits(engineType).name;
3437

3538
executionEnvironment = new ExecutionEnvironment;
3639

unit_tests/helpers/hw_helper_tests.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
*
66
*/
77

8-
#include "unit_tests/helpers/hw_helper_tests.h"
98
#include "runtime/helpers/options.h"
9+
#include "unit_tests/helpers/debug_manager_state_restore.h"
10+
#include "unit_tests/helpers/hw_helper_tests.h"
1011

1112
void HwHelperTest::SetUp() {
1213
memcpy(&testPlatform, platformDevices[0]->pPlatform, sizeof(testPlatform));
@@ -153,3 +154,19 @@ TEST(HwInfoTest, givenHwInfoWhenIsNotCoreThenPlatformTypeIsLp) {
153154
auto platformType = getPlatformType(hwInfo);
154155
EXPECT_STREQ("lp", platformType);
155156
}
157+
158+
TEST(HwInfoTest, givenHwInfoWhenChosenEngineTypeQueriedThenDefaultIsReturned) {
159+
HardwareInfo hwInfo;
160+
hwInfo.capabilityTable.defaultEngineType = EngineType::ENGINE_RCS;
161+
auto engineType = getChosenEngineType(hwInfo);
162+
EXPECT_EQ(EngineType::ENGINE_RCS, engineType);
163+
}
164+
165+
TEST(HwInfoTest, givenNodeOrdinalSetWhenChosenEngineTypeQueriedThenSetValueIsReturned) {
166+
DebugManagerStateRestore dbgRestore;
167+
DebugManager.flags.NodeOrdinal.set(EngineType::ENGINE_VECS);
168+
HardwareInfo hwInfo;
169+
hwInfo.capabilityTable.defaultEngineType = EngineType::ENGINE_RCS;
170+
auto engineType = getChosenEngineType(hwInfo);
171+
EXPECT_EQ(EngineType::ENGINE_VECS, engineType);
172+
}

0 commit comments

Comments
 (0)