Remove PatchTokens from KernelInfo

Use KernelDescriptor instead of patchTokens stored in KernelInfo's
patchInfo.
Removed: SPatchMediaInterfaceDescriptorLoad, SPatchAllocateLocalSurface,
SPatchMediaVFEState(slot 0), SPatchMediaVFEState(slot 1),
SPatchInterfaceDescriptorData, SPatchSamplerStateArray,
SPatchBindingTableState, SPatchDataParameterBuffer,
SPatchDataParameterStream, SPatchThreadPayload,
SPatchKernelAttributesInfo, SPatchAllocateStatelessPrivateSurface,
SPatchAllocateSyncBuffer,
SPatchAllocateStatelessConstantMemorySurfaceWithInitialization,
SPatchAllocateStatelessGlobalMemorySurfaceWithInitialization,
SPatchAllocateSystemThreadSurface.

Related-To: NEO-4729
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
This commit is contained in:
Krystian Chmielewski
2021-03-04 10:14:23 +01:00
committed by Compute-Runtime-Automation
parent 03631ce22b
commit 41f3bd00ff
64 changed files with 790 additions and 1015 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2020 Intel Corporation
* Copyright (C) 2017-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -135,9 +135,9 @@ TEST_F(clEnqueueNDRangeKernelTests, GivenKernelWithAllocateSyncBufferPatchWhenEx
cl_event *eventWaitList = nullptr;
cl_event *event = nullptr;
SPatchAllocateSyncBuffer patchAllocateSyncBuffer;
pProgram->mockKernelInfo.patchInfo.pAllocateSyncBuffer = &patchAllocateSyncBuffer;
populateKernelDescriptor(pProgram->mockKernelInfo.kernelDescriptor, patchAllocateSyncBuffer);
EXPECT_TRUE(pKernel->isUsingSyncBuffer(testedRootDeviceIndex));
EXPECT_TRUE(pKernel->usesSyncBuffer(testedRootDeviceIndex));
retVal = clEnqueueNDRangeKernel(
pCommandQueue,

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2020 Intel Corporation
* Copyright (C) 2017-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -141,11 +141,11 @@ TEST_F(KernelSubGroupInfoKhrReturnCompileSizeTest, GivenKernelWhenGettingRequire
EXPECT_EQ(paramValueSizeRet, sizeof(size_t));
size_t requiredSubGroupSize = 0;
auto start = pKernel->getKernelInfo(rootDeviceIndex).attributes.find("intel_reqd_sub_group_size(");
auto start = pKernel->getKernelInfo(rootDeviceIndex).kernelDescriptor.kernelMetadata.kernelLanguageAttributes.find("intel_reqd_sub_group_size(");
if (start != std::string::npos) {
start += strlen("intel_reqd_sub_group_size(");
auto stop = pKernel->getKernelInfo(rootDeviceIndex).attributes.find(")", start);
requiredSubGroupSize = stoi(pKernel->getKernelInfo(rootDeviceIndex).attributes.substr(start, stop - start));
auto stop = pKernel->getKernelInfo(rootDeviceIndex).kernelDescriptor.kernelMetadata.kernelLanguageAttributes.find(")", start);
requiredSubGroupSize = stoi(pKernel->getKernelInfo(rootDeviceIndex).kernelDescriptor.kernelMetadata.kernelLanguageAttributes.substr(start, stop - start));
}
EXPECT_EQ(paramValue, requiredSubGroupSize);

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2020 Intel Corporation
* Copyright (C) 2017-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -286,11 +286,11 @@ TEST_F(KernelSubGroupInfoReturnCompileSizeTest, GivenKernelWhenGettingCompileSub
EXPECT_EQ(paramValueSizeRet, sizeof(size_t));
size_t requiredSubGroupSize = 0;
auto start = pKernel->getKernelInfo(rootDeviceIndex).attributes.find("intel_reqd_sub_group_size(");
auto start = pKernel->getKernelInfo(rootDeviceIndex).kernelDescriptor.kernelMetadata.kernelLanguageAttributes.find("intel_reqd_sub_group_size(");
if (start != std::string::npos) {
start += strlen("intel_reqd_sub_group_size(");
auto stop = pKernel->getKernelInfo(rootDeviceIndex).attributes.find(")", start);
requiredSubGroupSize = stoi(pKernel->getKernelInfo(rootDeviceIndex).attributes.substr(start, stop - start));
auto stop = pKernel->getKernelInfo(rootDeviceIndex).kernelDescriptor.kernelMetadata.kernelLanguageAttributes.find(")", start);
requiredSubGroupSize = stoi(pKernel->getKernelInfo(rootDeviceIndex).kernelDescriptor.kernelMetadata.kernelLanguageAttributes.substr(start, stop - start));
}
EXPECT_EQ(paramValue[0], requiredSubGroupSize);

View File

@ -5,6 +5,8 @@
*
*/
#include "shared/source/device_binary_format/patchtokens_decoder.h"
#include "opencl/test/unit_test/fixtures/kernel_work_group_info_fixture.h"
using namespace NEO;
@ -79,7 +81,7 @@ TEST_F(clGetKernelWorkGroupInfoTests, GivenKernelRequiringScratchSpaceWhenGettin
MockKernelWithInternals mockKernel(*pDevice);
SPatchMediaVFEState mediaVFEstate;
mediaVFEstate.PerThreadScratchSpace = 1024; //whatever greater than 0
mockKernel.kernelInfo.patchInfo.mediavfestate = &mediaVFEstate;
populateKernelDescriptor(mockKernel.kernelInfo.kernelDescriptor, mediaVFEstate, 0);
cl_ulong scratchSpaceSize = static_cast<cl_ulong>(mockKernel.mockKernel->getScratchSize(testedRootDeviceIndex));
EXPECT_EQ(scratchSpaceSize, 1024u);
@ -106,7 +108,7 @@ HWTEST2_F(clGetKernelWorkGroupInfoTests, givenKernelHavingPrivateMemoryAllocatio
MockKernelWithInternals mockKernel(*pDevice);
SPatchAllocateStatelessPrivateSurface privateAllocation;
privateAllocation.PerThreadPrivateMemorySize = 1024;
mockKernel.kernelInfo.patchInfo.pAllocateStatelessPrivateSurface = &privateAllocation;
populateKernelDescriptor(mockKernel.kernelInfo.kernelDescriptor, privateAllocation);
retVal = clGetKernelWorkGroupInfo(
mockKernel,
@ -116,9 +118,9 @@ HWTEST2_F(clGetKernelWorkGroupInfoTests, givenKernelHavingPrivateMemoryAllocatio
&param_value,
&paramValueSizeRet);
EXPECT_EQ(retVal, CL_SUCCESS);
EXPECT_EQ(paramValueSizeRet, sizeof(cl_ulong));
EXPECT_EQ(param_value, privateAllocation.PerThreadPrivateMemorySize);
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(sizeof(cl_ulong), paramValueSizeRet);
EXPECT_EQ(PatchTokenBinary::getPerHwThreadPrivateSurfaceSize(privateAllocation, mockKernel.kernelInfo.kernelDescriptor.kernelAttributes.simdSize), param_value);
}
TEST_F(clGetKernelWorkGroupInfoTests, givenKernelNotHavingPrivateMemoryAllocationWhenAskedForPrivateAllocationSizeThenZeroIsReturned) {