mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 09:03:14 +08:00
Updating files modified in 2018 only. Older files remain with old style copyright header Change-Id: Ic99f2e190ad74b4b7f2bd79dd7b9fa5fbe36ec92 Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
49 lines
1.3 KiB
C++
49 lines
1.3 KiB
C++
/*
|
|
* Copyright (C) 2017-2018 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include <array>
|
|
#include <cstdint>
|
|
#include <cstddef>
|
|
#include "runtime/command_queue/local_id_gen.h"
|
|
#include "patch_shared.h"
|
|
|
|
namespace OCLRT {
|
|
class LinearStream;
|
|
|
|
struct PerThreadDataHelper {
|
|
static inline size_t getLocalIdSizePerThread(
|
|
uint32_t simd,
|
|
uint32_t numChannels) {
|
|
return getPerThreadSizeLocalIDs(simd, numChannels);
|
|
}
|
|
|
|
static inline size_t getPerThreadDataSizeTotal(
|
|
uint32_t simd,
|
|
uint32_t numChannels,
|
|
size_t localWorkSize) {
|
|
return getThreadsPerWG(simd, localWorkSize) * getLocalIdSizePerThread(simd, numChannels);
|
|
}
|
|
|
|
static size_t sendPerThreadData(
|
|
LinearStream &indirectHeap,
|
|
uint32_t simd,
|
|
uint32_t numChannels,
|
|
const size_t localWorkSizes[3],
|
|
const std::array<uint8_t, 3> &workgroupWalkOrder,
|
|
bool hasKernelOnlyImages);
|
|
|
|
static inline uint32_t getNumLocalIdChannels(const iOpenCL::SPatchThreadPayload &threadPayload) {
|
|
return threadPayload.LocalIDXPresent +
|
|
threadPayload.LocalIDYPresent +
|
|
threadPayload.LocalIDZPresent;
|
|
}
|
|
|
|
static uint32_t getThreadPayloadSize(const iOpenCL::SPatchThreadPayload &threadPayload, uint32_t simd);
|
|
};
|
|
} // namespace OCLRT
|