Code cleanup

Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2020-12-17 12:32:47 +00:00
committed by Compute-Runtime-Automation
parent aa27b4890b
commit 2a8bdaf28c
4 changed files with 52 additions and 62 deletions

View File

@ -1203,21 +1203,18 @@ TEST(CommandQueue, givenCopySizeAndOffsetWhenCallingBlitEnqueueImageAllowedThenR
auto maxBlitWidth = static_cast<size_t>(BlitterConstants::maxBlitWidth);
auto maxBlitHeight = static_cast<size_t>(BlitterConstants::maxBlitHeight);
std::array<std::tuple<size_t, size_t, size_t, size_t, bool>, 7> testParams{
std::make_tuple(1, 1, 0, 0, true),
std::make_tuple(maxBlitWidth, maxBlitHeight, 0, 0, true),
std::make_tuple(maxBlitWidth + 1, maxBlitHeight, 0, 0, false),
std::make_tuple(maxBlitWidth, maxBlitHeight + 1, 0, 0, false),
std::make_tuple(maxBlitWidth, maxBlitHeight, 1, 0, false),
std::make_tuple(maxBlitWidth, maxBlitHeight, 0, 1, false),
std::make_tuple(maxBlitWidth - 1, maxBlitHeight - 1, 1, 1, true)};
for (auto &params : testParams) {
size_t region[3];
size_t origin[3];
bool expectedResult;
std::tie(region[0], region[1], origin[0], origin[1], expectedResult) = params;
std::tuple<size_t, size_t, size_t, size_t, bool> testParams[]{
{1, 1, 0, 0, true},
{maxBlitWidth, maxBlitHeight, 0, 0, true},
{maxBlitWidth + 1, maxBlitHeight, 0, 0, false},
{maxBlitWidth, maxBlitHeight + 1, 0, 0, false},
{maxBlitWidth, maxBlitHeight, 1, 0, false},
{maxBlitWidth, maxBlitHeight, 0, 1, false},
{maxBlitWidth - 1, maxBlitHeight - 1, 1, 1, true}};
for (auto &[regionX, regionY, originX, originY, expectedResult] : testParams) {
size_t region[3] = {regionX, regionY, 0};
size_t origin[3] = {originX, originY, 0};
EXPECT_EQ(expectedResult, queue.blitEnqueueImageAllowed(origin, region));
}
}

View File

@ -265,22 +265,18 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenTgllpWhenIsFusedEuDispatchEnabledIsCalle
DebugManagerStateRestore restorer;
auto &helper = HwHelper::get(renderCoreFamily);
auto &waTable = hardwareInfo.workaroundTable;
bool wa;
int32_t debugKey;
size_t expectedResult;
const std::array<std::tuple<bool, bool, int32_t>, 6> testParams{std::make_tuple(true, false, -1),
std::make_tuple(false, true, -1),
std::make_tuple(true, false, 0),
std::make_tuple(true, true, 0),
std::make_tuple(false, false, 1),
std::make_tuple(false, true, 1)};
std::tuple<bool, bool, int32_t> testParams[]{
{true, false, -1},
{false, true, -1},
{true, false, 0},
{true, true, 0},
{false, false, 1},
{false, true, 1}};
for (const auto &params : testParams) {
std::tie(expectedResult, wa, debugKey) = params;
for (auto &[expectedResult, wa, debugKey] : testParams) {
waTable.waDisableFusedThreadScheduling = wa;
DebugManager.flags.CFEFusedEUDispatch.set(debugKey);
EXPECT_EQ(expectedResult, helper.isFusedEuDispatchEnabled(hardwareInfo));
}
}

View File

@ -27,31 +27,31 @@ TEST_P(HasAlphaChannelTest, GivenImageFormatWhenCheckingForAlphaChannelThenRetur
}
std::tuple<uint32_t, bool> paramsForAlphaChannelTests[] = {
std::make_tuple<uint32_t, bool>(CL_R, false),
std::make_tuple<uint32_t, bool>(CL_A, true),
std::make_tuple<uint32_t, bool>(CL_RG, false),
std::make_tuple<uint32_t, bool>(CL_RA, true),
std::make_tuple<uint32_t, bool>(CL_RGB, false),
std::make_tuple<uint32_t, bool>(CL_RGBA, true),
std::make_tuple<uint32_t, bool>(CL_BGRA, true),
std::make_tuple<uint32_t, bool>(CL_ARGB, true),
std::make_tuple<uint32_t, bool>(CL_INTENSITY, true),
std::make_tuple<uint32_t, bool>(CL_LUMINANCE, false),
std::make_tuple<uint32_t, bool>(CL_Rx, true),
std::make_tuple<uint32_t, bool>(CL_RGx, true),
std::make_tuple<uint32_t, bool>(CL_RGBx, true),
std::make_tuple<uint32_t, bool>(CL_DEPTH, false),
std::make_tuple<uint32_t, bool>(CL_DEPTH_STENCIL, false),
std::make_tuple<uint32_t, bool>(CL_sRGB, false),
std::make_tuple<uint32_t, bool>(CL_sRGBx, true),
std::make_tuple<uint32_t, bool>(CL_sRGBA, true),
std::make_tuple<uint32_t, bool>(CL_sBGRA, true),
std::make_tuple<uint32_t, bool>(CL_ABGR, true),
std::make_tuple<uint32_t, bool>(CL_NV12_INTEL, false),
std::make_tuple<uint32_t, bool>(CL_YUYV_INTEL, false),
std::make_tuple<uint32_t, bool>(CL_UYVY_INTEL, false),
std::make_tuple<uint32_t, bool>(CL_YVYU_INTEL, false),
std::make_tuple<uint32_t, bool>(CL_VYUY_INTEL, false)};
{CL_R, false},
{CL_A, true},
{CL_RG, false},
{CL_RA, true},
{CL_RGB, false},
{CL_RGBA, true},
{CL_BGRA, true},
{CL_ARGB, true},
{CL_INTENSITY, true},
{CL_LUMINANCE, false},
{CL_Rx, true},
{CL_RGx, true},
{CL_RGBx, true},
{CL_DEPTH, false},
{CL_DEPTH_STENCIL, false},
{CL_sRGB, false},
{CL_sRGBx, true},
{CL_sRGBA, true},
{CL_sBGRA, true},
{CL_ABGR, true},
{CL_NV12_INTEL, false},
{CL_YUYV_INTEL, false},
{CL_UYVY_INTEL, false},
{CL_YVYU_INTEL, false},
{CL_VYUY_INTEL, false}};
INSTANTIATE_TEST_CASE_P(
ImageFormatTests,

View File

@ -140,18 +140,15 @@ HWTEST2_F(Gen12LpPreambleVfeState, givenCfeFusedEuDispatchFlagsWhenprogramAdditi
*pMediaVfeState = FamilyType::cmdInitMediaVfeState;
auto &waTable = pHwInfo->workaroundTable;
const std::array<std::tuple<bool, bool, int32_t>, 6> testParams{{std::make_tuple(false, false, 0),
std::make_tuple(false, true, 0),
std::make_tuple(false, false, -1),
std::make_tuple(true, false, 1),
std::make_tuple(true, true, -1),
std::make_tuple(true, true, 1)}};
for (const auto &params : testParams) {
bool expectedValue, waDisableFusedThreadScheduling;
int32_t debugKeyValue;
std::tie(expectedValue, waDisableFusedThreadScheduling, debugKeyValue) = params;
std::tuple<bool, bool, int32_t> testParams[]{
{false, false, 0},
{false, true, 0},
{false, false, -1},
{true, false, 1},
{true, true, -1},
{true, true, 1}};
for (auto &[expectedValue, waDisableFusedThreadScheduling, debugKeyValue] : testParams) {
waTable.waDisableFusedThreadScheduling = waDisableFusedThreadScheduling;
::DebugManager.flags.CFEFusedEUDispatch.set(debugKeyValue);
PreambleHelper<FamilyType>::programAdditionalFieldsInVfeState(pMediaVfeState, *pHwInfo);