Files
compute-runtime/opencl/test/unit_test/gen12lp/tgllp/kernel_tests_tgllp.cpp
Filip Hazubski 43dba9de4a Move MockDevice to shared
Change-Id: If3a4ea2bb3f47bcb8176516977a626517f25a49f
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
2020-04-03 08:23:06 +02:00

45 lines
1.6 KiB
C++

/*
* Copyright (C) 2019-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/test/unit_test/mocks/mock_device.h"
#include "opencl/source/helpers/hardware_commands_helper.h"
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
#include "opencl/test/unit_test/mocks/mock_kernel.h"
#include "test.h"
using namespace NEO;
using KernelTgllpTests = ::testing::Test;
TGLLPTEST_F(KernelTgllpTests, GivenUseOffsetToSkipSetFFIDGPWorkaroundActiveWhenSettingKernelStartOffsetThenAdditionalOffsetIsSet) {
const uint64_t defaultKernelStartOffset = 0;
const uint64_t additionalOffsetDueToFfid = 0x1234;
SPatchThreadPayload threadPayload{};
threadPayload.OffsetToSkipSetFFIDGP = additionalOffsetDueToFfid;
auto hwInfo = *defaultHwInfo;
unsigned short steppings[] = {REVISION_A0, REVISION_A0 + 1};
for (auto stepping : steppings) {
hwInfo.platform.usRevId = stepping;
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
MockKernelWithInternals mockKernelWithInternals{*device};
mockKernelWithInternals.kernelInfo.patchInfo.threadPayload = &threadPayload;
for (auto isCcsUsed : ::testing::Bool()) {
uint64_t kernelStartOffset = mockKernelWithInternals.mockKernel->getKernelStartOffset(false, false, isCcsUsed);
if (stepping == REVISION_A0 && isCcsUsed) {
EXPECT_EQ(defaultKernelStartOffset + additionalOffsetDueToFfid, kernelStartOffset);
} else {
EXPECT_EQ(defaultKernelStartOffset, kernelStartOffset);
}
}
}
}