mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Reorganize systolic tests
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
e2dfe05f97
commit
eea582355d
@ -32,6 +32,7 @@ void CommandStreamReceiverFixture::setUp() {
|
||||
|
||||
flushTaskFlags.preemptionMode = PreemptionHelper::getDefaultPreemptionMode(pDevice->getHardwareInfo());
|
||||
}
|
||||
|
||||
void CommandStreamReceiverFixture::tearDown() {
|
||||
DeviceFixture::tearDown();
|
||||
|
||||
|
@ -31,3 +31,8 @@ struct CommandStreamReceiverFixture : public NEO::DeviceFixture {
|
||||
|
||||
uint32_t taskLevel = 2;
|
||||
};
|
||||
|
||||
struct CommandStreamReceiverSystolicFixture : public CommandStreamReceiverFixture {
|
||||
template <typename FamilyType>
|
||||
void testBody();
|
||||
};
|
||||
|
@ -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);
|
||||
}
|
@ -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
|
||||
|
@ -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; }
|
||||
|
@ -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()
|
||||
|
@ -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>();
|
||||
}
|
||||
|
Reference in New Issue
Block a user