Add EngineType suffix to aub file name in AubFixture

Change-Id: I9b8f27461e6d36d596e85fde973aa1b2f34dbede
This commit is contained in:
Hoppe, Mateusz 2018-10-01 13:36:15 -07:00 committed by sys_ocldev
parent 9a1adc3095
commit 5f11e68861
6 changed files with 33 additions and 5 deletions

View File

@ -70,9 +70,8 @@ Device::Device(const HardwareInfo &hwInfo, ExecutionEnvironment *executionEnviro
deviceExtensions.reserve(1000);
name.reserve(100);
preemptionMode = PreemptionHelper::getDefaultPreemptionMode(hwInfo);
engineType = DebugManager.flags.NodeOrdinal.get() == -1
? hwInfo.capabilityTable.defaultEngineType
: static_cast<EngineType>(DebugManager.flags.NodeOrdinal.get());
engineType = getChosenEngineType(hwInfo);
if (!getSourceLevelDebugger()) {
this->executionEnvironment->initSourceLevelDebugger(hwInfo);
}

View File

@ -7,6 +7,7 @@
#include "hw_info.h"
#include "hw_cmds.h"
#include "runtime/os_interface/debug_settings_manager.h"
namespace OCLRT {
HardwareInfo::HardwareInfo(const PLATFORM *platform, const FeatureTable *skuTable, const WorkaroundTable *waTable,
@ -42,4 +43,10 @@ bool getHwInfoForPlatformString(const char *str, const HardwareInfo *&hwInfoIn)
}
return ret;
}
EngineType getChosenEngineType(const HardwareInfo &hwInfo) {
return DebugManager.flags.NodeOrdinal.get() == -1
? hwInfo.capabilityTable.defaultEngineType
: static_cast<EngineType>(DebugManager.flags.NodeOrdinal.get());
}
} // namespace OCLRT

View File

@ -113,4 +113,5 @@ struct EnableGfxFamilyHw {
const char *getPlatformType(const HardwareInfo &hwInfo);
bool getHwInfoForPlatformString(const char *str, const HardwareInfo *&hwInfoIn);
EngineType getChosenEngineType(const HardwareInfo &hwInfo);
} // namespace OCLRT

View File

@ -6,6 +6,7 @@
target_sources(igdrcl_aub_tests PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/aub_fixture.h
${CMAKE_CURRENT_SOURCE_DIR}/aub_parent_kernel_fixture.h
${CMAKE_CURRENT_SOURCE_DIR}/fixture_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/hello_world_fixture.h

View File

@ -28,9 +28,12 @@ class AUBFixture : public CommandQueueHwFixture {
const HardwareInfo &hwInfo = hardwareInfo ? *hardwareInfo : *platformDevices[0];
uint32_t deviceIndex = 0;
auto &hwHelper = HwHelper::get(hwInfo.pPlatform->eRenderCoreFamily);
EngineType engineType = getChosenEngineType(hwInfo);
const ::testing::TestInfo *const testInfo = ::testing::UnitTest::GetInstance()->current_test_info();
std::stringstream strfilename;
strfilename << testInfo->test_case_name() << "_" << testInfo->name();
strfilename << testInfo->test_case_name() << "_" << testInfo->name() << "_" << hwHelper.getCsTraits(engineType).name;
executionEnvironment = new ExecutionEnvironment;

View File

@ -5,8 +5,9 @@
*
*/
#include "unit_tests/helpers/hw_helper_tests.h"
#include "runtime/helpers/options.h"
#include "unit_tests/helpers/debug_manager_state_restore.h"
#include "unit_tests/helpers/hw_helper_tests.h"
void HwHelperTest::SetUp() {
memcpy(&testPlatform, platformDevices[0]->pPlatform, sizeof(testPlatform));
@ -153,3 +154,19 @@ TEST(HwInfoTest, givenHwInfoWhenIsNotCoreThenPlatformTypeIsLp) {
auto platformType = getPlatformType(hwInfo);
EXPECT_STREQ("lp", platformType);
}
TEST(HwInfoTest, givenHwInfoWhenChosenEngineTypeQueriedThenDefaultIsReturned) {
HardwareInfo hwInfo;
hwInfo.capabilityTable.defaultEngineType = EngineType::ENGINE_RCS;
auto engineType = getChosenEngineType(hwInfo);
EXPECT_EQ(EngineType::ENGINE_RCS, engineType);
}
TEST(HwInfoTest, givenNodeOrdinalSetWhenChosenEngineTypeQueriedThenSetValueIsReturned) {
DebugManagerStateRestore dbgRestore;
DebugManager.flags.NodeOrdinal.set(EngineType::ENGINE_VECS);
HardwareInfo hwInfo;
hwInfo.capabilityTable.defaultEngineType = EngineType::ENGINE_RCS;
auto engineType = getChosenEngineType(hwInfo);
EXPECT_EQ(EngineType::ENGINE_VECS, engineType);
}