2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2021-05-17 02:51:16 +08:00
|
|
|
* Copyright (C) 2018-2021 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
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/command_stream/command_stream_receiver_hw.h"
|
|
|
|
#include "shared/source/execution_environment/execution_environment.h"
|
2021-01-21 20:10:13 +08:00
|
|
|
#include "shared/test/common/helpers/dispatch_flags_helper.h"
|
2020-02-24 17:22:30 +08:00
|
|
|
|
2020-02-23 05:50:57 +08:00
|
|
|
#include "opencl/source/platform/platform.h"
|
2020-03-17 21:25:44 +08:00
|
|
|
#include "opencl/test/unit_test/mocks/mock_platform.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
#include "test.h"
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
using namespace NEO;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
typedef ::testing::Test Gen8CoherencyRequirements;
|
|
|
|
|
2020-10-28 00:05:12 +08:00
|
|
|
GEN8TEST_F(Gen8CoherencyRequirements, WhenMemoryManagerIsInitializedThenNoCoherencyProgramming) {
|
2020-02-03 23:18:21 +08:00
|
|
|
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
|
2019-09-02 19:23:25 +08:00
|
|
|
executionEnvironment->initializeMemoryManager();
|
2020-10-28 23:08:37 +08:00
|
|
|
CommandStreamReceiverHw<BDWFamily> csr(*executionEnvironment, 0, 1);
|
2017-12-21 07:45:38 +08:00
|
|
|
LinearStream stream;
|
2019-09-13 18:00:30 +08:00
|
|
|
DispatchFlags flags = DispatchFlagsHelper::createDefaultDispatchFlags();
|
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);
|
2018-09-21 20:06:35 +08:00
|
|
|
csr.programComputeMode(stream, flags);
|
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);
|
2018-09-21 20:06:35 +08:00
|
|
|
csr.programComputeMode(stream, flags);
|
2017-12-21 07:45:38 +08:00
|
|
|
EXPECT_EQ(0u, stream.getUsed());
|
|
|
|
}
|