mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00

Change-Id: If3a4ea2bb3f47bcb8176516977a626517f25a49f Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
45 lines
1.6 KiB
C++
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);
|
|
}
|
|
}
|
|
}
|
|
}
|