mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 05:24:02 +08:00
Make bindless heaps resident right after heap allocation. Motivation is that SYCL bindless image can be passed as a value argument or through memory. Therefore, we're not able to make its bindless heap resident during kernel initialization or setting kernel arguments. This fixes SYCL bindless image read_write_*D.cpp tests on DG2. Related-To: NEO-7063 Signed-off-by: Wenju He <wenju.he@intel.com>
54 lines
1.8 KiB
C++
54 lines
1.8 KiB
C++
/*
|
|
* Copyright (C) 2021-2024 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "shared/source/helpers/bindless_heaps_helper.h"
|
|
|
|
using namespace NEO;
|
|
|
|
class MockBindlesHeapsHelper : public BindlessHeapsHelper {
|
|
public:
|
|
using BaseClass = BindlessHeapsHelper;
|
|
MockBindlesHeapsHelper(Device *rootDevice, bool isMultiOsContextCapable) : BindlessHeapsHelper(rootDevice, isMultiOsContextCapable) {
|
|
globalSsh = surfaceStateHeaps[BindlesHeapType::globalSsh].get();
|
|
specialSsh = surfaceStateHeaps[BindlesHeapType::specialSsh].get();
|
|
scratchSsh = surfaceStateHeaps[BindlesHeapType::specialSsh].get();
|
|
globalDsh = surfaceStateHeaps[BindlesHeapType::specialSsh].get();
|
|
}
|
|
|
|
SurfaceStateInHeapInfo allocateSSInHeap(size_t ssSize, GraphicsAllocation *surfaceAllocation, BindlesHeapType heapType) override {
|
|
if (failAllocateSS) {
|
|
return SurfaceStateInHeapInfo{};
|
|
}
|
|
return BaseClass::allocateSSInHeap(ssSize, surfaceAllocation, heapType);
|
|
}
|
|
|
|
using BindlesHeapType = BindlessHeapsHelper::BindlesHeapType;
|
|
using BaseClass::allocateFromReusePool;
|
|
using BaseClass::allocatePoolIndex;
|
|
using BaseClass::borderColorStates;
|
|
using BaseClass::globalBindlessDsh;
|
|
using BaseClass::growHeap;
|
|
using BaseClass::isMultiOsContextCapable;
|
|
using BaseClass::memManager;
|
|
using BaseClass::releasePoolIndex;
|
|
using BaseClass::reuseSlotCountThreshold;
|
|
using BaseClass::rootDeviceIndex;
|
|
using BaseClass::ssHeapsAllocations;
|
|
using BaseClass::stateCacheDirtyForContext;
|
|
using BaseClass::surfaceStateHeaps;
|
|
using BaseClass::surfaceStateInHeapVectorReuse;
|
|
using BaseClass::surfaceStateSize;
|
|
|
|
IndirectHeap *specialSsh;
|
|
IndirectHeap *globalSsh;
|
|
IndirectHeap *scratchSsh;
|
|
IndirectHeap *globalDsh;
|
|
bool failAllocateSS = false;
|
|
};
|