Reorganize systolic tests

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2022-09-16 03:43:18 +00:00
committed by Compute-Runtime-Automation
parent e2dfe05f97
commit eea582355d
10 changed files with 136 additions and 84 deletions

View File

@ -32,6 +32,7 @@ void CommandStreamReceiverFixture::setUp() {
flushTaskFlags.preemptionMode = PreemptionHelper::getDefaultPreemptionMode(pDevice->getHardwareInfo());
}
void CommandStreamReceiverFixture::tearDown() {
DeviceFixture::tearDown();

View File

@ -31,3 +31,8 @@ struct CommandStreamReceiverFixture : public NEO::DeviceFixture {
uint32_t taskLevel = 2;
};
struct CommandStreamReceiverSystolicFixture : public CommandStreamReceiverFixture {
template <typename FamilyType>
void testBody();
};

View File

@ -0,0 +1,46 @@
/*
* Copyright (C) 2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/command_stream/stream_properties.h"
#include "shared/test/common/fixtures/command_stream_receiver_fixture.h"
#include "shared/test/common/libult/ult_command_stream_receiver.h"
template <typename FamilyType>
void CommandStreamReceiverSystolicFixture::testBody() {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
StreamProperties &streamProperties = commandStreamReceiver.getStreamProperties();
commandStreamReceiver.isPreambleSent = true;
commandStreamReceiver.lastMediaSamplerConfig = false;
flushTaskFlags.pipelineSelectArgs.systolicPipelineSelectMode = true;
flushTaskFlags.pipelineSelectArgs.mediaSamplerRequired = false;
commandStreamReceiver.flushTask(commandStream,
0,
&dsh,
&ioh,
&ssh,
taskLevel,
flushTaskFlags,
*pDevice);
EXPECT_EQ(true, commandStreamReceiver.lastSystolicPipelineSelectMode);
EXPECT_EQ(1, streamProperties.pipelineSelect.systolicMode.value);
flushTaskFlags.pipelineSelectArgs.systolicPipelineSelectMode = false;
commandStreamReceiver.flushTask(commandStream,
0,
&dsh,
&ioh,
&ssh,
taskLevel,
flushTaskFlags,
*pDevice);
EXPECT_EQ(false, commandStreamReceiver.lastSystolicPipelineSelectMode);
EXPECT_EQ(0, streamProperties.pipelineSelect.systolicMode.value);
}

View File

@ -68,6 +68,7 @@ append_sources_from_properties(neo_libult_common_SRCS_ENABLE_TESTED_HW NEO_SRCS_
set(neo_libult_common_SRCS_LIB_ULT
${NEO_SHARED_TEST_DIRECTORY}/common/fixtures/aub_command_stream_receiver_fixture.h
${NEO_SHARED_TEST_DIRECTORY}/common/fixtures/command_stream_receiver_fixture.cpp
${NEO_SHARED_TEST_DIRECTORY}/common/fixtures/command_stream_receiver_fixture.inl
${NEO_SHARED_TEST_DIRECTORY}/common/fixtures/command_stream_receiver_fixture.h
${NEO_SHARED_TEST_DIRECTORY}/common/fixtures/device_fixture.cpp
${NEO_SHARED_TEST_DIRECTORY}/common/fixtures/device_fixture.h

View File

@ -696,6 +696,14 @@ struct IsNotWithinProducts {
}
};
template <PRODUCT_FAMILY... args>
struct IsAnyProducts {
template <PRODUCT_FAMILY productFamily>
static constexpr bool isMatched() {
return (... || IsProduct<args>::template isMatched<productFamily>());
}
};
struct MatchAny {
template <PRODUCT_FAMILY productFamily>
static constexpr bool isMatched() { return true; }

View File

@ -36,4 +36,4 @@ if(TESTS_PVC_AND_LATER)
target_sources(neo_shared_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/compute_mode_tests_pvc_and_later.cpp)
endif()
add_subdirectories()
add_subdirectories()

View File

@ -17,7 +17,7 @@
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/os_interface/os_interface.h"
#include "shared/source/utilities/tag_allocator.h"
#include "shared/test/common/fixtures/command_stream_receiver_fixture.h"
#include "shared/test/common/fixtures/command_stream_receiver_fixture.inl"
#include "shared/test/common/fixtures/device_fixture.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/engine_descriptor_helper.h"
@ -2118,39 +2118,9 @@ TEST_F(CommandStreamReceiverTest, givenPreemptionSentIsInitialWhenSettingPreempt
EXPECT_EQ(mode, commandStreamReceiver->getPreemptionMode());
}
using CommandStreamReceiverHwTests = Test<CommandStreamReceiverFixture>;
using SystolicSupport = IsWithinProducts<IGFX_XE_HP_SDV, IGFX_PVC>;
HWTEST2_F(CommandStreamReceiverHwTests, givenSystolicModeChangedWhenFlushTaskCalledThenSystolicStateIsUpdated, SystolicSupport) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
StreamProperties &streamProperties = commandStreamReceiver.getStreamProperties();
using CommandStreamReceiverSystolicTests = Test<CommandStreamReceiverSystolicFixture>;
using SystolicSupport = IsAnyProducts<IGFX_ALDERLAKE_P, IGFX_XE_HP_SDV, IGFX_DG2, IGFX_PVC>;
commandStreamReceiver.isPreambleSent = true;
commandStreamReceiver.lastMediaSamplerConfig = false;
flushTaskFlags.pipelineSelectArgs.systolicPipelineSelectMode = true;
flushTaskFlags.pipelineSelectArgs.mediaSamplerRequired = false;
commandStreamReceiver.flushTask(commandStream,
0,
&dsh,
&ioh,
&ssh,
taskLevel,
flushTaskFlags,
*pDevice);
EXPECT_EQ(true, commandStreamReceiver.lastSystolicPipelineSelectMode);
EXPECT_EQ(1, streamProperties.pipelineSelect.systolicMode.value);
flushTaskFlags.pipelineSelectArgs.systolicPipelineSelectMode = false;
commandStreamReceiver.flushTask(commandStream,
0,
&dsh,
&ioh,
&ssh,
taskLevel,
flushTaskFlags,
*pDevice);
EXPECT_EQ(false, commandStreamReceiver.lastSystolicPipelineSelectMode);
EXPECT_EQ(0, streamProperties.pipelineSelect.systolicMode.value);
HWTEST2_F(CommandStreamReceiverSystolicTests, givenSystolicModeChangedWhenFlushTaskCalledThenSystolicStateIsUpdated, SystolicSupport) {
testBody<FamilyType>();
}