2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2022-03-10 01:15:48 +08:00
|
|
|
* Copyright (C) 2018-2022 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2022-06-30 03:17:47 +08:00
|
|
|
#include "shared/source/gen8/hw_cmds.h"
|
2021-07-06 21:29:10 +08:00
|
|
|
#include "shared/test/common/helpers/default_hw_info.h"
|
2021-01-21 20:10:13 +08:00
|
|
|
#include "shared/test/common/helpers/dispatch_flags_helper.h"
|
2022-03-10 01:15:48 +08:00
|
|
|
#include "shared/test/common/libult/ult_command_stream_receiver.h"
|
|
|
|
#include "shared/test/common/mocks/mock_device.h"
|
|
|
|
#include "shared/test/common/mocks/ult_device_factory.h"
|
2022-06-30 03:17:47 +08:00
|
|
|
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
|
|
|
|
#include "shared/test/common/test_macros/test.h"
|
2020-02-24 17:22:30 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
using namespace NEO;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2021-12-23 17:28:36 +08:00
|
|
|
using Gen8CoherencyRequirements = ::testing::Test;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-10-28 00:05:12 +08:00
|
|
|
GEN8TEST_F(Gen8CoherencyRequirements, WhenMemoryManagerIsInitializedThenNoCoherencyProgramming) {
|
2022-03-10 01:15:48 +08:00
|
|
|
UltDeviceFactory deviceFactory{1, 0};
|
2017-12-21 07:45:38 +08:00
|
|
|
LinearStream stream;
|
2019-09-13 18:00:30 +08:00
|
|
|
DispatchFlags flags = DispatchFlagsHelper::createDefaultDispatchFlags();
|
2022-03-10 01:15:48 +08:00
|
|
|
auto &csr = deviceFactory.rootDevices[0]->getUltCommandStreamReceiver<FamilyType>();
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-09-21 20:06:35 +08:00
|
|
|
auto retSize = csr.getCmdSizeForComputeMode();
|
2017-12-21 07:45:38 +08:00
|
|
|
EXPECT_EQ(0u, retSize);
|
2021-07-06 21:29:10 +08:00
|
|
|
csr.programComputeMode(stream, flags, *defaultHwInfo);
|
2017-12-21 07:45:38 +08:00
|
|
|
EXPECT_EQ(0u, stream.getUsed());
|
|
|
|
|
|
|
|
flags.requiresCoherency = true;
|
2018-09-21 20:06:35 +08:00
|
|
|
retSize = csr.getCmdSizeForComputeMode();
|
2017-12-21 07:45:38 +08:00
|
|
|
EXPECT_EQ(0u, retSize);
|
2021-07-06 21:29:10 +08:00
|
|
|
csr.programComputeMode(stream, flags, *defaultHwInfo);
|
2017-12-21 07:45:38 +08:00
|
|
|
EXPECT_EQ(0u, stream.getUsed());
|
|
|
|
}
|