2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2018-09-18 15:11:08 +08:00
|
|
|
* Copyright (C) 2017-2018 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"
|
2017-12-21 07:45:38 +08:00
|
|
|
#include "test.h"
|
|
|
|
|
|
|
|
using namespace OCLRT;
|
|
|
|
|
|
|
|
typedef ::testing::Test Gen8CoherencyRequirements;
|
|
|
|
|
|
|
|
GEN8TEST_F(Gen8CoherencyRequirements, noCoherencyProgramming) {
|
2018-08-08 19:49:09 +08:00
|
|
|
ExecutionEnvironment executionEnvironment;
|
|
|
|
CommandStreamReceiverHw<BDWFamily> csr(*platformDevices[0], executionEnvironment);
|
2017-12-21 07:45:38 +08:00
|
|
|
LinearStream stream;
|
|
|
|
DispatchFlags flags = {};
|
|
|
|
|
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());
|
|
|
|
}
|