2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2019-02-27 17:06:14 +08:00
|
|
|
* Copyright (C) 2017-2019 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
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "runtime/command_stream/command_stream_receiver_hw.h"
|
2018-08-08 19:49:09 +08:00
|
|
|
#include "runtime/execution_environment/execution_environment.h"
|
2019-02-27 17:06:14 +08:00
|
|
|
#include "runtime/platform/platform.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
#include "test.h"
|
2019-09-13 18:00:30 +08:00
|
|
|
#include "unit_tests/helpers/dispatch_flags_helper.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
using namespace NEO;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
typedef ::testing::Test Gen8CoherencyRequirements;
|
|
|
|
|
|
|
|
GEN8TEST_F(Gen8CoherencyRequirements, noCoherencyProgramming) {
|
2019-02-27 17:06:14 +08:00
|
|
|
ExecutionEnvironment *executionEnvironment = platformImpl->peekExecutionEnvironment();
|
2019-09-02 19:23:25 +08:00
|
|
|
executionEnvironment->initializeMemoryManager();
|
2019-02-27 17:06:14 +08:00
|
|
|
CommandStreamReceiverHw<BDWFamily> csr(*executionEnvironment);
|
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());
|
|
|
|
}
|