mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
feature: bindless global allocator with scratch
- allocate SSH in cmdContainer when scratch allocation used with private heaps - scratch SurfaceStates are addressed relative to SurfaceStateBaseAddress and have to be placed on SSH - remove not used SCRATCH_SSH heap type from bindelssHeapHelper Related-To: NEO-7063 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
856e9f00f3
commit
bcba74f839
@@ -110,6 +110,13 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
|
||||
NEO::IndirectHeap *ssh = nullptr;
|
||||
NEO::IndirectHeap *dsh = nullptr;
|
||||
|
||||
commandListPerThreadScratchSize = std::max<uint32_t>(commandListPerThreadScratchSize, kernelDescriptor.kernelAttributes.perThreadScratchSize[0]);
|
||||
commandListPerThreadPrivateScratchSize = std::max<uint32_t>(commandListPerThreadPrivateScratchSize, kernelDescriptor.kernelAttributes.perThreadScratchSize[1]);
|
||||
|
||||
if ((this->cmdListHeapAddressModel == NEO::HeapAddressModel::PrivateHeaps) && (commandListPerThreadScratchSize != 0 || commandListPerThreadPrivateScratchSize != 0)) {
|
||||
commandContainer.prepareBindfulSsh();
|
||||
}
|
||||
|
||||
if ((this->immediateCmdListHeapSharing || this->stateBaseAddressTracking) &&
|
||||
(this->cmdListHeapAddressModel == NEO::HeapAddressModel::PrivateHeaps)) {
|
||||
auto kernelInfo = kernelImmutableData->getKernelInfo();
|
||||
@@ -139,8 +146,6 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
|
||||
ssh = sshReserveArgs.indirectHeapReservation;
|
||||
dsh = dshReserveArgs.indirectHeapReservation;
|
||||
}
|
||||
commandListPerThreadScratchSize = std::max<uint32_t>(commandListPerThreadScratchSize, kernelDescriptor.kernelAttributes.perThreadScratchSize[0]);
|
||||
commandListPerThreadPrivateScratchSize = std::max<uint32_t>(commandListPerThreadPrivateScratchSize, kernelDescriptor.kernelAttributes.perThreadScratchSize[1]);
|
||||
|
||||
auto kernelPreemptionMode = obtainKernelPreemptionMode(kernel);
|
||||
|
||||
|
||||
@@ -148,10 +148,7 @@ void CommandQueueHw<gfxCoreFamily>::handleScratchSpace(NEO::HeapContainer &sshHe
|
||||
scratchController->programHeaps(sshHeaps, offsetIndex, perThreadScratchSpaceSize, perThreadPrivateScratchSize, csr->peekTaskCount(),
|
||||
csr->getOsContext(), gsbaState, frontEndState);
|
||||
}
|
||||
if (NEO::ApiSpecificConfig::getGlobalBindlessHeapConfiguration()) {
|
||||
scratchController->programBindlessSurfaceStateForScratch(device->getNEODevice()->getBindlessHeapsHelper(), perThreadScratchSpaceSize, perThreadPrivateScratchSize, csr->peekTaskCount(),
|
||||
csr->getOsContext(), gsbaState, frontEndState, csr);
|
||||
}
|
||||
|
||||
auto scratchAllocation = scratchController->getScratchSpaceAllocation();
|
||||
if (scratchAllocation != nullptr) {
|
||||
csr->makeResident(*scratchAllocation);
|
||||
|
||||
Reference in New Issue
Block a user