Files
compute-runtime/shared/source/helpers/per_thread_data.h
Cencelewska, Katarzyna 61f701aba5 fix: Unify logic calculating threads per work group part 3
Related-To: NEO-8087
Signed-off-by: Cencelewska, Katarzyna <katarzyna.cencelewska@intel.com>
2023-07-04 15:27:44 +02:00

30 lines
808 B
C++

/*
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/helpers/gfx_core_helper.h"
#include "shared/source/helpers/local_id_gen.h"
#include <cstddef>
#include <cstdint>
namespace NEO {
class LinearStream;
struct PerThreadDataHelper {
static inline size_t getPerThreadDataSizeTotal(
uint32_t simd,
uint32_t grfSize,
uint32_t numChannels,
size_t localWorkSize,
bool isHwLocalIdGeneration,
const GfxCoreHelper &gfxCoreHelper) {
return gfxCoreHelper.calculateNumThreadsPerThreadGroup(simd, static_cast<uint32_t>(localWorkSize), grfSize, isHwLocalIdGeneration) * getPerThreadSizeLocalIDs(simd, grfSize, numChannels);
}
}; // namespace PerThreadDataHelper
} // namespace NEO