Remove KernelArgInfo and use KernelDescriptor's args instead

Related-To: NEO-4729
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
This commit is contained in:
Krystian Chmielewski
2021-04-08 11:05:45 +02:00
committed by Compute-Runtime-Automation
parent 215051c48f
commit ef71915c71
111 changed files with 1882 additions and 3729 deletions

View File

@@ -12,9 +12,6 @@
#include "shared/source/utilities/const_stringref.h"
#include "opencl/source/program/heap_info.h"
#include "opencl/source/program/kernel_arg_info.h"
#include "patch_info.h"
#include <algorithm>
#include <array>
@@ -39,8 +36,6 @@ struct KernelArgumentType;
class GraphicsAllocation;
class MemoryManager;
extern bool useKernelDescriptor;
extern std::map<std::string, size_t> typeSizeMap;
static const float YTilingRatioValue = 1.3862943611198906188344642429164f;
@@ -81,28 +76,19 @@ struct KernelInfo {
KernelInfo &operator=(const KernelInfo &) = delete;
~KernelInfo();
void storeArgInfo(uint32_t argNum, ArgTypeTraits metadata, std::unique_ptr<ArgTypeMetadataExtended> metadataExtended);
void storeKernelArgument(const SPatchDataParameterBuffer *pDataParameterKernelArg);
void storeKernelArgument(const SPatchStatelessGlobalMemoryObjectKernelArgument *pStatelessGlobalKernelArg);
void storeKernelArgument(const SPatchImageMemoryObjectKernelArgument *pImageMemObjKernelArg);
void storeKernelArgument(const SPatchGlobalMemoryObjectKernelArgument *pGlobalMemObjKernelArg);
void storeKernelArgument(const SPatchStatelessConstantMemoryObjectKernelArgument *pStatelessConstMemObjKernelArg);
void storeKernelArgument(const SPatchStatelessDeviceQueueKernelArgument *pStatelessDeviceQueueKernelArg);
void storeKernelArgument(const SPatchSamplerKernelArgument *pSamplerKernelArg);
void storePatchToken(const SPatchExecutionEnvironment *execEnv);
GraphicsAllocation *getGraphicsAllocation() const { return this->kernelAllocation; }
void resizeKernelArgInfoAndRegisterParameter(uint32_t argCount) {
if (kernelArgInfo.size() <= argCount) {
kernelArgInfo.resize(argCount + 1);
}
if (!kernelArgInfo[argCount].needPatch) {
kernelArgInfo[argCount].needPatch = true;
argumentsToPatchNum++;
}
const ArgDescriptor &getArgDescriptorAt(uint32_t index) const {
DEBUG_BREAK_IF(index >= kernelDescriptor.payloadMappings.explicitArgs.size());
return kernelDescriptor.payloadMappings.explicitArgs[index];
}
const StackVec<ArgDescriptor, 16> &getExplicitArgs() const {
return kernelDescriptor.payloadMappings.explicitArgs;
}
const ArgTypeMetadataExtended &getExtendedMetadata(uint32_t index) const {
DEBUG_BREAK_IF(index >= kernelDescriptor.explicitArgsExtendedMetadata.size());
return kernelDescriptor.explicitArgsExtendedMetadata[index];
}
void storeKernelArgPatchInfo(uint32_t argNum, uint32_t dataSize, uint32_t crossthreadOffset, uint32_t sourceOffset, uint32_t offsetSSH);
size_t getSamplerStateArrayCount() const;
size_t getSamplerStateArraySize(const HardwareInfo &hwInfo) const;
size_t getBorderColorStateSize() const;
@@ -128,35 +114,18 @@ struct KernelInfo {
}
uint32_t getConstantBufferSize() const;
int32_t getArgNumByName(const char *name) const {
int32_t argNum = 0;
for (auto &arg : kernelArgInfo) {
if (arg.metadataExtended && (arg.metadataExtended->argName == name)) {
return argNum;
}
++argNum;
}
return -1;
}
int32_t getArgNumByName(const char *name) const;
bool createKernelAllocation(const Device &device, bool internalIsa);
void apply(const DeviceInfoKernelPayloadConstants &constants);
HeapInfo heapInfo = {};
PatchInfo patchInfo = {};
std::vector<KernelArgInfo> kernelArgInfo;
std::vector<KernelArgInfo> kernelNonArgInfo;
std::vector<std::pair<uint32_t, uint32_t>> childrenKernelsIdOffset;
bool usesSsh = false;
bool requiresSshForBuffers = false;
bool hasIndirectStatelessAccess = false;
bool isVmeWorkload = false;
char *crossThreadData = nullptr;
uint32_t gpuPointerSize = 0;
const BuiltinDispatchInfoBuilder *builtinDispatchBuilder = nullptr;
uint32_t argumentsToPatchNum = 0;
uint32_t systemKernelOffset = 0;
uint64_t kernelId = 0;
bool hasIndirectStatelessAccess = false;
bool isKernelHeapSubstituted = false;
GraphicsAllocation *kernelAllocation = nullptr;
DebugData debugData;