Initialize HwInfo in tests

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2021-06-30 08:56:08 +00:00
committed by Compute-Runtime-Automation
parent 363a92f456
commit a49b45a679
33 changed files with 80 additions and 67 deletions

View File

@ -58,8 +58,8 @@ const RuntimeCapabilityTable EHL::capabilityTable{
false, // ftrSupports64BitMath
false, // ftrSvm
false, // ftrSupportsCoherency
true, // ftrSupportsVmeAvcTextureSampler
true, // ftrSupportsVmeAvcPreemption
false, // ftrSupportsVmeAvcTextureSampler
false, // ftrSupportsVmeAvcPreemption
false, // ftrRenderCompressedBuffers
false, // ftrRenderCompressedImages
true, // ftr64KBpages

View File

@ -69,7 +69,7 @@ EHLTEST_F(HwInfoConfigTestLinuxEhl, GivenInvalidDeviceIdWhenConfiguringHwInfoThe
template <typename T>
class EhlHwInfoTests : public ::testing::Test {};
TEST(EhlHwInfoTests, WhenGtIsSetupThenGtSystemInfoIsCorrect) {
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());

View File

@ -5,14 +5,15 @@
*
*/
#include "test.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "test.h"
using namespace NEO;
using EhlHwInfo = ::testing::Test;
EHLTEST_F(EhlHwInfo, givenHwInfoConfigStringThenAfterSetupResultingVmeIsDisabled) {
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
hardwareInfoSetup[productFamily](&hwInfo, false, 0x100040008);
EXPECT_FALSE(hwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler);
@ -23,7 +24,7 @@ EHLTEST_F(EhlHwInfo, givenHwInfoConfigStringThenAfterSetupResultingVmeIsDisabled
EHLTEST_F(EhlHwInfo, givenBoolWhenCallEhlHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
bool boolValue[]{
true, false};
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;

View File

@ -71,7 +71,7 @@ class IcllpHwInfoTests : public ::testing::Test {};
typedef ::testing::Types<ICLLP_1x8x8, ICLLP_1x4x8, ICLLP_1x6x8> icllpTestTypes;
TYPED_TEST_CASE(IcllpHwInfoTests, icllpTestTypes);
TYPED_TEST(IcllpHwInfoTests, WhenGettingSystemInfoThenParamsAreValid) {
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]);

View File

@ -5,15 +5,16 @@
*
*/
#include "test.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "test.h"
using namespace NEO;
TEST(IcllpHwInfoConfig, givenInvalidSystemInfoWhenSettingHardwareInfoThenExpectThrow) {
if (IGFX_ICELAKE_LP != productFamily) {
return;
}
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
gtSystemInfo = {0};
@ -36,7 +37,7 @@ ICLLPTEST_F(IcllpHwInfo, givenBoolWhenCallIcllpHardwareInfoSetupThenFeatureTable
bool boolValue[]{
true, false};
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;

View File

@ -71,7 +71,7 @@ class LkfHwInfoTests : public ::testing::Test {};
typedef ::testing::Types<LKF_1x8x8> lkfTestTypes;
TYPED_TEST_CASE(LkfHwInfoTests, lkfTestTypes);
TYPED_TEST(LkfHwInfoTests, gtSetupIsCorrect) {
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());

View File

@ -5,15 +5,16 @@
*
*/
#include "test.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "test.h"
using namespace NEO;
TEST(LkfHwInfoConfig, givenInvalidSystemInfoWhenSettingHardwareInfoThenExpectThrow) {
if (IGFX_LAKEFIELD != productFamily) {
return;
}
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
uint64_t config = 0xdeadbeef;
@ -28,7 +29,7 @@ TEST(LkfHwInfoConfig, givenInvalidSystemInfoWhenSettingHardwareInfoThenExpectThr
using LkfHwInfo = ::testing::Test;
LKFTEST_F(LkfHwInfo, givenHwInfoConfigStringThenAfterSetupResultingVmeIsDisabled) {
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
uint64_t config = 0x100080008;
hardwareInfoSetup[productFamily](&hwInfo, false, config);
@ -40,7 +41,7 @@ LKFTEST_F(LkfHwInfo, givenHwInfoConfigStringThenAfterSetupResultingVmeIsDisabled
LKFTEST_F(LkfHwInfo, givenBoolWhenCallLkfHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
bool boolValue[]{
true, false};
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;

View File

@ -72,7 +72,7 @@ ADLSTEST_F(HwInfoConfigTestLinuxAdls, GivenIncorrectDataWhenConfiguringHwInfoThe
}
TEST(AdlsHwInfoTests, WhenSettingUpHwInfoThenConfigIsCorrect) {
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());

View File

@ -7,6 +7,7 @@
#include "shared/source/helpers/hw_info.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "opencl/test/unit_test/helpers/gtest_helpers.h"
#include "test.h"
@ -18,7 +19,7 @@ typedef ::testing::Types<DG1_CONFIG> dg1TestTypes;
TYPED_TEST_CASE(Dg1HwInfoTests, dg1TestTypes);
TYPED_TEST(Dg1HwInfoTests, WhenSetupHardwareInfoWithSetupFeatureTableFlagTrueOrFalseIsCalledThenFeatureTableHasCorrectValueOfLocalMemoryFeature) {
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
FeatureTable &featureTable = hwInfo.featureTable;
EXPECT_FALSE(featureTable.ftrLocalMemory);

View File

@ -6,6 +6,7 @@
*/
#include "shared/source/helpers/hw_helper.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "opencl/source/helpers/hardware_commands_helper.h"
#include "test.h"
@ -16,7 +17,7 @@ TEST(Dg1HwInfoConfig, givenInvalidSystemInfoWhenSettingHardwareInfoThenExpectThr
if (IGFX_DG1 != productFamily) {
return;
}
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
uint64_t config = 0xdeadbeef;
@ -33,7 +34,7 @@ using Dg1HwInfo = ::testing::Test;
DG1TEST_F(Dg1HwInfo, givenBoolWhenCallDg1HardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
bool boolValue[]{
true, false};
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;

View File

@ -72,7 +72,7 @@ RKLTEST_F(HwInfoConfigTestLinuxRkl, GivenIncorrectDataWhenConfiguringHwInfoThenE
}
TEST(RklHwInfoTests, WhenSettingUpHwInfoThenConfigIsCorrect) {
HardwareInfo hwInfo{};
HardwareInfo hwInfo = *defaultHwInfo;
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());

View File

@ -90,7 +90,7 @@ class TgllpHwInfoTests : public ::testing::Test {};
typedef ::testing::Types<TGLLP_1x6x16> tgllpTestTypes;
TYPED_TEST_CASE(TgllpHwInfoTests, tgllpTestTypes);
TYPED_TEST(TgllpHwInfoTests, gtSetupIsCorrect) {
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());

View File

@ -16,7 +16,7 @@ using namespace NEO;
using TgllpHwInfoConfig = ::testing::Test;
TGLLPTEST_F(TgllpHwInfoConfig, givenHwInfoErrorneousConfigStringThenThrow) {
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
uint64_t config = 0xdeadbeef;
@ -29,7 +29,7 @@ TGLLPTEST_F(TgllpHwInfoConfig, givenHwInfoErrorneousConfigStringThenThrow) {
}
TGLLPTEST_F(TgllpHwInfoConfig, whenUsingCorrectConfigValueThenCorrectHwInfoIsReturned) {
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
uint64_t config = 0x100060010;
@ -52,7 +52,7 @@ using TgllpHwInfo = ::testing::Test;
TGLLPTEST_F(TgllpHwInfo, givenBoolWhenCallTgllpHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
static bool boolValue[]{
true, false};
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;
@ -98,7 +98,7 @@ TGLLPTEST_F(TgllpHwInfo, givenBoolWhenCallTgllpHardwareInfoSetupThenFeatureTable
}
TGLLPTEST_F(TgllpHwInfo, givenHwInfoConfigStringThenAfterSetupResultingVmeIsDisabled) {
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
uint64_t config = 0x100060010;
hardwareInfoSetup[productFamily](&hwInfo, false, config);

View File

@ -156,7 +156,7 @@ class BdwHwInfoTests : public ::testing::Test {
typedef ::testing::Types<BDW_1x2x6, BDW_1x3x6, BDW_1x3x8, BDW_2x3x8> bdwTestTypes;
TYPED_TEST_CASE(BdwHwInfoTests, bdwTestTypes);
TYPED_TEST(BdwHwInfoTests, WhenGtIsSetupThenGtSystemInfoIsCorrect) {
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());

View File

@ -5,15 +5,16 @@
*
*/
#include "test.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "test.h"
using namespace NEO;
TEST(BdwHwInfoConfig, givenInvalidSystemInfoWhenSettingHardwareInfoThenExpectThrow) {
if (IGFX_BROADWELL != productFamily) {
return;
}
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
uint64_t config = 0xdeadbeef;
@ -35,7 +36,7 @@ BDWTEST_F(BdwHwInfo, givenBoolWhenCallBdwHardwareInfoSetupThenFeatureTableAndWor
0x100030006};
bool boolValue[]{
true, false};
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;
@ -68,7 +69,7 @@ BDWTEST_F(BdwHwInfo, givenBoolWhenCallBdwHardwareInfoSetupThenFeatureTableAndWor
}
BDWTEST_F(BdwHwInfo, givenHwInfoConfigStringThenAfterSetupResultingVmeIsDisabled) {
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
uint64_t config = 0x0;
hardwareInfoSetup[productFamily](&hwInfo, false, config);

View File

@ -5,9 +5,10 @@
*
*/
#include "shared/test/common/helpers/default_hw_info.h"
#include "opencl/test/unit_test/helpers/gtest_helpers.h"
#include "opencl/test/unit_test/os_interface/linux/hw_info_config_linux_tests.h"
using namespace NEO;
struct HwInfoConfigTestLinuxBxt : HwInfoConfigTestLinux {
@ -215,7 +216,7 @@ class BxtHwInfoTests : public ::testing::Test {
typedef ::testing::Types<BXT_1x2x6, BXT_1x3x6> bxtTestTypes;
TYPED_TEST_CASE(BxtHwInfoTests, bxtTestTypes);
TYPED_TEST(BxtHwInfoTests, WhenConfiguringHwInfoThenConfigIsCorrect) {
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());

View File

@ -5,15 +5,16 @@
*
*/
#include "test.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "test.h"
using namespace NEO;
TEST(BxtHwInfoConfig, givenInvalidSystemInfoWhenSettingHardwareInfoThenExpectThrow) {
if (IGFX_BROXTON != productFamily) {
return;
}
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
uint64_t config = 0xdeadbeef;
@ -33,7 +34,7 @@ BXTTEST_F(BxtHwInfo, givenBoolWhenCallBxtHardwareInfoSetupThenFeatureTableAndWor
0x100030006};
bool boolValue[]{
true, false};
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;

View File

@ -170,7 +170,7 @@ class CflHwInfoTests : public ::testing::Test {
typedef ::testing::Types<CFL_1x2x6, CFL_1x3x6, CFL_1x3x8, CFL_2x3x8, CFL_3x3x8> cflTestTypes;
TYPED_TEST_CASE(CflHwInfoTests, cflTestTypes);
TYPED_TEST(CflHwInfoTests, WhenGtIsSetupThenGtSystemInfoIsCorrect) {
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());

View File

@ -5,15 +5,16 @@
*
*/
#include "test.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "test.h"
using namespace NEO;
TEST(CflHwInfoConfig, GivenIncorrectDataWhenConfiguringHwInfoThenErrorIsReturned) {
if (IGFX_COFFEELAKE != productFamily) {
return;
}
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
uint64_t config = 0xdeadbeef;
@ -36,7 +37,7 @@ CFLTEST_F(CflHwInfo, givenBoolWhenCallCflHardwareInfoSetupThenFeatureTableAndWor
0x100030006};
bool boolValue[]{
true, false};
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;

View File

@ -206,7 +206,7 @@ class GlkHwInfoTests : public ::testing::Test {
typedef ::testing::Types<GLK_1x3x6, GLK_1x2x6> glkTestTypes;
TYPED_TEST_CASE(GlkHwInfoTests, glkTestTypes);
TYPED_TEST(GlkHwInfoTests, WhenGtIsSetupThenGtSystemInfoIsCorrect) {
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());

View File

@ -5,15 +5,16 @@
*
*/
#include "test.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "test.h"
using namespace NEO;
TEST(GlkHwInfoConfig, GivenIncorrectDataWhenConfiguringHwInfoThenErrorIsReturned) {
if (IGFX_GEMINILAKE != productFamily) {
return;
}
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
gtSystemInfo = {0};
@ -34,7 +35,7 @@ GLKTEST_F(GlkHwInfo, givenBoolWhenCallGlkHardwareInfoSetupThenFeatureTableAndWor
0x100030006};
bool boolValue[]{
true, false};
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;

View File

@ -225,7 +225,7 @@ class KblHwInfoTests : public ::testing::Test {
typedef ::testing::Types<KBL_1x2x6, KBL_1x3x6, KBL_1x3x8, KBL_2x3x8, KBL_3x3x8> kblTestTypes;
TYPED_TEST_CASE(KblHwInfoTests, kblTestTypes);
TYPED_TEST(KblHwInfoTests, WhenGtIsSetupThenGtSystemInfoIsCorrect) {
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());

View File

@ -5,15 +5,16 @@
*
*/
#include "test.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "test.h"
using namespace NEO;
TEST(KblHwInfoConfig, GivenIncorrectDataWhenConfiguringHwInfoThenErrorIsReturned) {
if (IGFX_KABYLAKE != productFamily) {
return;
}
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
uint64_t config = 0xdeadbeef;
@ -36,7 +37,7 @@ KBLTEST_F(KblHwInfo, givenBoolWhenCallKblHardwareInfoSetupThenFeatureTableAndWor
0x100030006};
bool boolValue[]{
true, false};
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;

View File

@ -249,7 +249,7 @@ class SklHwInfoTests : public ::testing::Test {
typedef ::testing::Types<SKL_1x2x6, SKL_1x3x6, SKL_1x3x8, SKL_2x3x8, SKL_3x3x8> sklTestTypes;
TYPED_TEST_CASE(SklHwInfoTests, sklTestTypes);
TYPED_TEST(SklHwInfoTests, WhenGtIsSetupThenGtSystemInfoIsCorrect) {
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
@ -271,7 +271,7 @@ TYPED_TEST(SklHwInfoTests, WhenGtIsSetupThenGtSystemInfoIsCorrect) {
}
TYPED_TEST(SklHwInfoTests, givenGTSystemInfoTypeWhenConfigureHardwareCustomThenSliceCountDontChange) {
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
auto osInterface = std::unique_ptr<OSInterface>(new OSInterface());
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;

View File

@ -5,15 +5,16 @@
*
*/
#include "test.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "test.h"
using namespace NEO;
TEST(SklHwInfoConfig, GivenIncorrectDataWhenConfiguringHwInfoThenErrorIsReturned) {
if (IGFX_SKYLAKE != productFamily) {
return;
}
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
gtSystemInfo = {0};
@ -37,7 +38,7 @@ SKLTEST_F(SklHwInfo, givenBoolWhenCallSklHardwareInfoSetupThenFeatureTableAndWor
bool boolValue[]{
true, false};
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;

View File

@ -368,7 +368,7 @@ HWTEST_F(PipeControlHelperTests, givenNotifyEnableArgumentIsTrueWhenHelperIsUsed
}
TEST(HwInfoTest, givenHwInfoWhenChosenEngineTypeQueriedThenDefaultIsReturned) {
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS;
auto engineType = getChosenEngineType(hwInfo);
EXPECT_EQ(aub_stream::ENGINE_RCS, engineType);
@ -377,7 +377,7 @@ TEST(HwInfoTest, givenHwInfoWhenChosenEngineTypeQueriedThenDefaultIsReturned) {
TEST(HwInfoTest, givenNodeOrdinalSetWhenChosenEngineTypeQueriedThenSetValueIsReturned) {
DebugManagerStateRestore dbgRestore;
DebugManager.flags.NodeOrdinal.set(aub_stream::ENGINE_VECS);
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS;
auto engineType = getChosenEngineType(hwInfo);
EXPECT_EQ(aub_stream::ENGINE_VECS, engineType);
@ -1301,9 +1301,9 @@ TEST_F(HwHelperTest, whenGettingDefaultRevisionIdThenCorrectValueIsReturned) {
}
}
TEST_F(HwHelperTest, whenGettingNumberOfCacheRegionsThenReturnZero) {
HWTEST_F(HwHelperTest, whenGettingNumberOfCacheRegionsThenReturnZero) {
auto &hwHelper = HwHelper::get(renderCoreFamily);
EXPECT_EQ(0u, hwHelper.getNumCacheRegions(*defaultHwInfo));
EXPECT_EQ(0u, hwHelper.getNumCacheRegions());
}
HWCMDTEST_F(IGFX_GEN8_CORE, HwHelperTest, whenCheckingForSmallKernelPreferenceThenFalseIsReturned) {

View File

@ -4404,7 +4404,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmAllocationWithHostPtrWhenItIsCreatedWithCac
memoryManager->cleanOsHandles(storage, rootDeviceIndex);
}
TEST_F(DrmMemoryManagerTest, givenDrmAllocationWithHostPtrWhenItIsCreatedWithIncorrectCacheRegionThenReturnNull) {
HWTEST_F(DrmMemoryManagerTest, givenDrmAllocationWithHostPtrWhenItIsCreatedWithIncorrectCacheRegionThenReturnNull) {
mock->ioctl_expected.total = -1;
auto drm = static_cast<DrmMockCustom *>(executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->osInterface->getDriverModel()->as<Drm>());
drm->setupCacheInfo(*defaultHwInfo.get());
@ -4420,7 +4420,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmAllocationWithHostPtrWhenItIsCreatedWithInc
EXPECT_EQ(allocation, nullptr);
}
TEST_F(DrmMemoryManagerTest, givenDrmAllocationWithWithAlignmentFromUserptrWhenItIsCreatedWithIncorrectCacheRegionThenReturnNull) {
HWTEST_F(DrmMemoryManagerTest, givenDrmAllocationWithWithAlignmentFromUserptrWhenItIsCreatedWithIncorrectCacheRegionThenReturnNull) {
mock->ioctl_expected.total = -1;
auto drm = static_cast<DrmMockCustom *>(executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->osInterface->getDriverModel()->as<Drm>());
drm->setupCacheInfo(*defaultHwInfo.get());

View File

@ -60,7 +60,7 @@ TEST(DrmSystemInfoTest, givenSetupHardwareInfoWhenQuerySystemInfoFailsThenSystem
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
DrmMockToFailQuerySystemInfo drm(*executionEnvironment->rootDeviceEnvironments[0]);
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
auto setupHardwareInfo = [](HardwareInfo *, bool) {};
DeviceDescriptor device = {0, &hwInfo, setupHardwareInfo, GTTYPE_UNDEFINED};
@ -79,7 +79,7 @@ TEST(DrmSystemInfoTest, givenSetupHardwareInfoWhenSystemInfoIsCreatedThenSetHard
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]);
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
auto setupHardwareInfo = [](HardwareInfo *, bool) {};
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
DeviceDescriptor device = {0, &hwInfo, setupHardwareInfo, GTTYPE_UNDEFINED};

View File

@ -140,7 +140,7 @@ class HwHelper {
virtual bool isDirectSubmissionSupported() const = 0;
virtual aub_stream::MMIOList getExtraMmioList(const HardwareInfo &hwInfo, const GmmHelper &gmmHelper) const = 0;
virtual uint32_t getDefaultRevisionId(const HardwareInfo &hwInfo) const = 0;
virtual uint32_t getNumCacheRegions(const HardwareInfo &hwInfo) const = 0;
virtual uint32_t getNumCacheRegions() const = 0;
virtual bool isSubDeviceEngineSupported(const HardwareInfo &hwInfo, const DeviceBitfield &deviceBitfield, aub_stream::EngineType engineType) const = 0;
virtual uint32_t getPlanarYuvMaxHeight() const = 0;
virtual bool isBlitterForImagesSupported(const HardwareInfo &hwInfo) const = 0;
@ -363,7 +363,7 @@ class HwHelperHw : public HwHelper {
uint32_t getDefaultRevisionId(const HardwareInfo &hwInfo) const override;
uint32_t getNumCacheRegions(const HardwareInfo &hwInfo) const override;
uint32_t getNumCacheRegions() const override;
bool isSubDeviceEngineSupported(const HardwareInfo &hwInfo, const DeviceBitfield &deviceBitfield, aub_stream::EngineType engineType) const override;

View File

@ -633,7 +633,7 @@ uint32_t HwHelperHw<GfxFamily>::getDefaultRevisionId(const HardwareInfo &hwInfo)
}
template <typename GfxFamily>
uint32_t HwHelperHw<GfxFamily>::getNumCacheRegions(const HardwareInfo &hwInfo) const {
uint32_t HwHelperHw<GfxFamily>::getNumCacheRegions() const {
return 0;
}

View File

@ -6,10 +6,10 @@
*/
#include "shared/source/helpers/hw_helper.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "opencl/source/helpers/hardware_commands_helper.h"
#include "test.h"
using namespace NEO;
using AdlsHwInfo = ::testing::Test;
@ -17,7 +17,7 @@ using AdlsHwInfo = ::testing::Test;
ADLSTEST_F(AdlsHwInfo, givenBoolWhenCallAdlsHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
static bool boolValue[]{
true, false};
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;

View File

@ -6,6 +6,7 @@
*/
#include "shared/source/helpers/hw_helper.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "opencl/source/helpers/hardware_commands_helper.h"
#include "test.h"
@ -19,7 +20,7 @@ RKLTEST_F(RklHwInfo, givenBoolWhenCallRklHardwareInfoSetupThenFeatureTableAndWor
0x100020010};
bool boolValue[]{
true, false};
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;

View File

@ -142,7 +142,7 @@ TEST(CompilerCacheHashTests, WhenHashingThenResultIsDeterministic) {
TEST(CompilerCacheHashTests, GivenCompilingOptionsWhenGettingCacheThenCorrectCacheIsReturned) {
static const size_t bufSize = 64;
HardwareInfo hwInfo;
HardwareInfo hwInfo = *defaultHwInfo;
std::set<std::string> hashes;