Files
compute-runtime/unit_tests/gen_common/hw_cmds_tests.cpp
Filip Hazubski 6a7b7013fe Add programBarrierEnable helper function
Related-To: NEO-3211

Change-Id: I7afe11fa9d440837d66f0003b9e02db1f404d650
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
2019-10-11 09:17:06 +02:00

30 lines
1023 B
C++

/*
* Copyright (C) 2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/gen_common/hw_cmds.h"
#include "runtime/helpers/hardware_commands_helper.h"
#include "test.h"
#include "unit_tests/mocks/mock_device.h"
using InterfaceDescriptorDataTests = ::testing::Test;
HWCMDTEST_F(IGFX_GEN8_CORE, InterfaceDescriptorDataTests, givenVariousValuesWhenCallingSetBarrierEnableThenCorrectValueIsSet) {
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
INTERFACE_DESCRIPTOR_DATA idd = FamilyType::cmdInitInterfaceDescriptorData;
MockDevice device;
auto hwInfo = device.getHardwareInfo();
HardwareCommandsHelper<FamilyType>::programBarrierEnable(&idd, 0, hwInfo);
EXPECT_FALSE(idd.getBarrierEnable());
HardwareCommandsHelper<FamilyType>::programBarrierEnable(&idd, 1, hwInfo);
EXPECT_TRUE(idd.getBarrierEnable());
HardwareCommandsHelper<FamilyType>::programBarrierEnable(&idd, 2, hwInfo);
EXPECT_TRUE(idd.getBarrierEnable());
}