Files
compute-runtime/opencl/test/unit_test/gen9/coherency_tests_gen9.cpp
Andrzej Swierczynski 1eb3bd5c0a Move platform() and constructPlatform() to MockPlatform
Related-To: NEO-4207

Change-Id: I7ed1c16f2eb357c3143d2a3f0b688f3cc747e9ff
Signed-off-by: Andrzej Swierczynski <andrzej.swierczynski@intel.com>
2020-03-23 23:49:39 +01:00

38 lines
1.2 KiB
C++

/*
* Copyright (C) 2017-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/command_stream/command_stream_receiver_hw.h"
#include "shared/source/execution_environment/execution_environment.h"
#include "opencl/source/platform/platform.h"
#include "opencl/test/unit_test/helpers/dispatch_flags_helper.h"
#include "opencl/test/unit_test/mocks/mock_platform.h"
#include "test.h"
using namespace NEO;
typedef ::testing::Test Gen9CoherencyRequirements;
GEN9TEST_F(Gen9CoherencyRequirements, noCoherencyProgramming) {
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
executionEnvironment->initializeMemoryManager();
CommandStreamReceiverHw<SKLFamily> csr(*executionEnvironment, 0);
LinearStream stream;
DispatchFlags flags = DispatchFlagsHelper::createDefaultDispatchFlags();
auto retSize = csr.getCmdSizeForComputeMode();
EXPECT_EQ(0u, retSize);
csr.programComputeMode(stream, flags);
EXPECT_EQ(0u, stream.getUsed());
flags.requiresCoherency = true;
retSize = csr.getCmdSizeForComputeMode();
EXPECT_EQ(0u, retSize);
csr.programComputeMode(stream, flags);
EXPECT_EQ(0u, stream.getUsed());
}