Files
compute-runtime/opencl/source/helpers/per_thread_data.h
Krystian Chmielewski 41f3bd00ff 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-09 17:09:13 +01:00

49 lines
1.2 KiB
C++

/*
* Copyright (C) 2017-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/helpers/local_id_gen.h"
#include "shared/source/kernel/kernel_descriptor.h"
#include "patch_shared.h"
#include <array>
#include <cstddef>
#include <cstdint>
namespace NEO {
class LinearStream;
struct PerThreadDataHelper {
static inline uint32_t getLocalIdSizePerThread(
uint32_t simd,
uint32_t grfSize,
uint32_t numChannels) {
return getPerThreadSizeLocalIDs(simd, grfSize, numChannels);
}
static inline size_t getPerThreadDataSizeTotal(
uint32_t simd,
uint32_t grfSize,
uint32_t numChannels,
size_t localWorkSize) {
return getThreadsPerWG(simd, localWorkSize) * getLocalIdSizePerThread(simd, grfSize, numChannels);
}
static size_t sendPerThreadData(
LinearStream &indirectHeap,
uint32_t simd,
uint32_t grfSize,
uint32_t numChannels,
const std::array<uint16_t, 3> &localWorkSizes,
const std::array<uint8_t, 3> &workgroupWalkOrder,
bool hasKernelOnlyImages);
static uint32_t getThreadPayloadSize(const KernelDescriptor &kernelDescriptor, uint32_t grfSize);
};
} // namespace NEO