mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
Move shared local work size code to shared directory
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
135ec380fc
commit
96fef37834
64
shared/source/helpers/local_work_size.h
Normal file
64
shared/source/helpers/local_work_size.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/helpers/vec.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace NEO {
|
||||
struct WorkSizeInfo;
|
||||
|
||||
void computeWorkgroupSize1D(
|
||||
uint32_t maxWorkGroupSize,
|
||||
size_t workGroupSize[3],
|
||||
const size_t workItems[3],
|
||||
size_t simdSize);
|
||||
|
||||
void computeWorkgroupSizeND(
|
||||
WorkSizeInfo &wsInfo,
|
||||
size_t workGroupSize[3],
|
||||
const size_t workItems[3],
|
||||
const uint32_t workDim);
|
||||
|
||||
void computeWorkgroupSize2D(
|
||||
uint32_t maxWorkGroupSize,
|
||||
size_t workGroupSize[3],
|
||||
const size_t workItems[3],
|
||||
size_t simdSize);
|
||||
|
||||
void computeWorkgroupSizeSquared(
|
||||
uint32_t maxWorkGroupSize,
|
||||
size_t workGroupSize[3],
|
||||
const size_t workItems[3],
|
||||
size_t simdSize,
|
||||
const uint32_t workDim);
|
||||
|
||||
Vec3<size_t> computeWorkgroupsNumber(
|
||||
const Vec3<size_t> &gws,
|
||||
const Vec3<size_t> &lws);
|
||||
|
||||
Vec3<size_t> generateWorkgroupsNumber(
|
||||
const Vec3<size_t> &gws,
|
||||
const Vec3<size_t> &lws);
|
||||
|
||||
inline uint32_t calculateDispatchDim(const Vec3<size_t> &dispatchSize, const Vec3<size_t> &dispatchOffset) {
|
||||
return std::max(1U, std::max(dispatchSize.getSimplifiedDim(), dispatchOffset.getSimplifiedDim()));
|
||||
}
|
||||
|
||||
Vec3<size_t> canonizeWorkgroup(
|
||||
const Vec3<size_t> &workgroup);
|
||||
|
||||
void setSpecialWorkgroupSize(size_t workgroupSize[3]);
|
||||
|
||||
inline uint32_t computeDimensions(const size_t workItems[3]) {
|
||||
return (workItems[2] > 1) ? 3 : (workItems[1] > 1) ? 2
|
||||
: 1;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
Reference in New Issue
Block a user