is_simt_thread token support

Change-Id: I8cee6ff26229f0f492ba0d1e5e61d6e46e0c2486
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2020-10-13 13:14:51 +02:00
committed by sys_ocldev
parent a06369230c
commit 1926ef8319
17 changed files with 183 additions and 27 deletions

View File

@@ -17,6 +17,7 @@
#include "shared/source/helpers/compiler_options_parser.h"
#include "shared/source/helpers/debug_helpers.h"
#include "shared/source/helpers/hw_helper.h"
#include "shared/source/helpers/kernel_helpers.h"
#include "shared/source/helpers/string.h"
#include "shared/source/memory_manager/memory_manager.h"
#include "shared/source/memory_manager/unified_memory_manager.h"
@@ -339,10 +340,12 @@ void Program::allocateBlockPrivateSurfaces(uint32_t rootDeviceIndex) {
const KernelInfo *info = blockKernelManager->getBlockKernelInfo(i);
if (info->patchInfo.pAllocateStatelessPrivateSurface) {
size_t privateSize = info->patchInfo.pAllocateStatelessPrivateSurface->PerThreadPrivateMemorySize;
auto perThreadPrivateMemorySize = info->patchInfo.pAllocateStatelessPrivateSurface->PerThreadPrivateMemorySize;
if (perThreadPrivateMemorySize > 0 && blockKernelManager->getPrivateSurface(i) == nullptr) {
auto privateSize = static_cast<size_t>(KernelHelper::getPrivateSurfaceSize(perThreadPrivateMemorySize, getDevice().getDeviceInfo().computeUnitsUsedForScratch,
info->getMaxSimdSize(), info->patchInfo.pAllocateStatelessPrivateSurface->IsSimtThread));
if (privateSize > 0 && blockKernelManager->getPrivateSurface(i) == nullptr) {
privateSize *= getDevice().getDeviceInfo().computeUnitsUsedForScratch * info->getMaxSimdSize();
auto *privateSurface = this->executionEnvironment.memoryManager->allocateGraphicsMemoryWithProperties({rootDeviceIndex, privateSize, GraphicsAllocation::AllocationType::PRIVATE_SURFACE, getDevice().getDeviceBitfield()});
blockKernelManager->pushPrivateSurface(privateSurface, i);
}