Debian Codegraph @

shared/test/unit_test/gen12lp/adlp/command_stream_receiver_hw_tests_adlp.cpp

raw
1 /*
2 * Copyright (C) 2022-2023 Intel Corporation
3 *
4 * SPDX-License-Identifier: MIT
5 *
6 */
7
8 #include "shared/source/command_stream/stream_properties.h"
9 #include "shared/source/gen12lp/hw_cmds_adlp.h"
10 #include "shared/source/gen12lp/hw_info_adlp.h"
11 #include "shared/test/common/fixtures/command_stream_receiver_fixture.h"
12 #include "shared/test/common/helpers/default_hw_info.h"
13 #include "shared/test/common/libult/ult_command_stream_receiver.h"
14 #include "shared/test/common/mocks/mock_device.h"
15 #include "shared/test/common/test_macros/header/per_product_test_definitions.h"
16 #include "shared/test/common/test_macros/test.h"
17
18 using namespace NEO;
19
20 using Gen12LpCommandStreamReceiverHwTests = Test<CommandStreamReceiverFixture>;
21
22 ADLPTEST_F(Gen12LpCommandStreamReceiverHwTests, givenSystolicModeChangedWhenFlushTaskCalledThenSystolicStateIsUpdated) {
23 auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
24 StreamProperties &streamProperties = commandStreamReceiver.getStreamProperties();
25
26 commandStreamReceiver.isPreambleSent = true;
27 commandStreamReceiver.lastMediaSamplerConfig = false;
28
29 flushTaskFlags.pipelineSelectArgs.systolicPipelineSelectMode = true;
30 flushTaskFlags.pipelineSelectArgs.mediaSamplerRequired = false;
31
32 commandStreamReceiver.flushTask(commandStream,
33 0,
34 &dsh,
35 &ioh,
36 &ssh,
37 taskLevel,
38 flushTaskFlags,
39 *pDevice);
40 EXPECT_EQ(true, commandStreamReceiver.lastSystolicPipelineSelectMode);
41 EXPECT_EQ(1, streamProperties.pipelineSelect.systolicMode.value);
42
43 flushTaskFlags.pipelineSelectArgs.systolicPipelineSelectMode = false;
44
45 commandStreamReceiver.flushTask(commandStream,
46 0,
47 &dsh,
48 &ioh,
49 &ssh,
50 taskLevel,
51 flushTaskFlags,
52 *pDevice);
53 EXPECT_EQ(false, commandStreamReceiver.lastSystolicPipelineSelectMode);
54 EXPECT_EQ(0, streamProperties.pipelineSelect.systolicMode.value);
55 }