2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2023-01-16 23:30:27 +08:00
|
|
|
* Copyright (C) 2018-2023 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
|
2023-06-30 22:17:13 +08:00
|
|
|
#include "shared/source/helpers/gfx_core_helper.h"
|
2020-10-07 21:09:42 +08:00
|
|
|
#include "shared/source/helpers/local_id_gen.h"
|
2020-02-23 05:50:57 +08:00
|
|
|
|
2019-02-27 18:39:32 +08:00
|
|
|
#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 {
|
|
|
|
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,
|
2023-06-30 22:17:13 +08:00
|
|
|
size_t localWorkSize,
|
|
|
|
bool isHwLocalIdGeneration,
|
|
|
|
const GfxCoreHelper &gfxCoreHelper) {
|
2023-09-13 14:04:36 +08:00
|
|
|
return gfxCoreHelper.calculateNumThreadsPerThreadGroup(simd, static_cast<uint32_t>(localWorkSize), grfSize, isHwLocalIdGeneration) * getPerThreadSizeLocalIDs(simd, grfSize, numChannels);
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
2022-10-21 22:16:43 +08:00
|
|
|
}; // namespace PerThreadDataHelper
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|