2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2021-05-17 02:51:16 +08:00
|
|
|
* Copyright (C) 2018-2021 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-10-07 21:09:42 +08:00
|
|
|
#include "shared/source/helpers/local_id_gen.h"
|
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>
2021-03-04 17:14:23 +08:00
|
|
|
#include "shared/source/kernel/kernel_descriptor.h"
|
2020-02-23 05:50:57 +08:00
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
#include "patch_shared.h"
|
|
|
|
|
2019-02-27 18:39:32 +08:00
|
|
|
#include <array>
|
|
|
|
#include <cstddef>
|
|
|
|
#include <cstdint>
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2017-12-21 07:45:38 +08:00
|
|
|
class LinearStream;
|
|
|
|
|
|
|
|
struct PerThreadDataHelper {
|
2019-12-17 15:55:09 +08:00
|
|
|
static inline uint32_t getLocalIdSizePerThread(
|
2017-12-21 07:45:38 +08:00
|
|
|
uint32_t simd,
|
2019-12-17 15:55:09 +08:00
|
|
|
uint32_t grfSize,
|
2017-12-21 07:45:38 +08:00
|
|
|
uint32_t numChannels) {
|
2019-12-17 15:55:09 +08:00
|
|
|
return getPerThreadSizeLocalIDs(simd, grfSize, numChannels);
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline size_t getPerThreadDataSizeTotal(
|
|
|
|
uint32_t simd,
|
2019-12-17 15:55:09 +08:00
|
|
|
uint32_t grfSize,
|
2017-12-21 07:45:38 +08:00
|
|
|
uint32_t numChannels,
|
|
|
|
size_t localWorkSize) {
|
2019-12-17 15:55:09 +08:00
|
|
|
return getThreadsPerWG(simd, localWorkSize) * getLocalIdSizePerThread(simd, grfSize, numChannels);
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static size_t sendPerThreadData(
|
|
|
|
LinearStream &indirectHeap,
|
|
|
|
uint32_t simd,
|
2019-12-17 15:55:09 +08:00
|
|
|
uint32_t grfSize,
|
2017-12-21 07:45:38 +08:00
|
|
|
uint32_t numChannels,
|
2020-11-04 17:34:42 +08:00
|
|
|
const std::array<uint16_t, 3> &localWorkSizes,
|
2018-08-08 18:49:36 +08:00
|
|
|
const std::array<uint8_t, 3> &workgroupWalkOrder,
|
|
|
|
bool hasKernelOnlyImages);
|
2017-12-21 07:45:38 +08:00
|
|
|
|
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>
2021-03-04 17:14:23 +08:00
|
|
|
static uint32_t getThreadPayloadSize(const KernelDescriptor &kernelDescriptor, uint32_t grfSize);
|
2017-12-21 07:45:38 +08:00
|
|
|
};
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|