refactor: create helper for maxPtssIndex

Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
This commit is contained in:
Katarzyna Cencelewska
2024-04-29 11:22:46 +00:00
committed by Compute-Runtime-Automation
parent d3f28b92c9
commit e9f7df6ae6
19 changed files with 76 additions and 31 deletions

View File

@@ -130,8 +130,6 @@ size_t CommandQueueHw<gfxCoreFamily>::estimateStateBaseAddressCmdSize() {
return 0;
}
constexpr uint32_t maxPtssIndex = 15u;
template <GFXCORE_FAMILY gfxCoreFamily>
void CommandQueueHw<gfxCoreFamily>::handleScratchSpace(NEO::HeapContainer &sshHeaps,
NEO::ScratchSpaceController *scratchController,
@@ -143,8 +141,13 @@ void CommandQueueHw<gfxCoreFamily>::handleScratchSpace(NEO::HeapContainer &sshHe
scratchController->setRequiredScratchSpace(globalStatelessAllocation->getUnderlyingBuffer(), 0, perThreadScratchSpaceSlot0Size, perThreadScratchSpaceSlot1Size, csr->peekTaskCount(),
csr->getOsContext(), gsbaState, frontEndState);
}
NEO::Device *neoDevice = device->getNEODevice();
auto &gfxCoreHelper = neoDevice->getGfxCoreHelper();
auto &productHelper = neoDevice->getProductHelper();
if (sshHeaps.size() > 0) {
uint32_t offsetIndex = maxPtssIndex * csr->getOsContext().getEngineType() + 1u;
uint32_t offsetIndex = gfxCoreHelper.getMaxPtssIndex(productHelper) * csr->getOsContext().getEngineType() + 1u;
scratchController->programHeaps(sshHeaps, offsetIndex, perThreadScratchSpaceSlot0Size, perThreadScratchSpaceSlot1Size, csr->peekTaskCount(),
csr->getOsContext(), gsbaState, frontEndState);
}

View File

@@ -171,6 +171,7 @@ HWTEST2_F(CommandListTests, whenCommandListIsCreatedAndProgramExtendedPipeContro
using CommandListTestsReserveSize = Test<DeviceFixture>;
HWTEST2_F(CommandListTestsReserveSize, givenCommandListWhenGetReserveSshSizeThen4PagesReturned, IsAtLeastXeHpCore) {
L0::CommandListCoreFamily<gfxCoreFamily> commandList(1u);
commandList.initialize(device, NEO::EngineGroupType::compute, 0u);
EXPECT_EQ(commandList.getReserveSshSize(), 4 * MemoryConstants::pageSize);
}

View File

@@ -127,7 +127,8 @@ TEST_F(KernelInitTest, givenKernelToInitWhenItHasTooBigScratchSizeThenInvalidBin
uint32_t perHwThreadPrivateMemorySizeRequested = (static_cast<uint32_t>((globalSize + device->getNEODevice()->getDeviceInfo().computeUnitsUsedForScratch) / device->getNEODevice()->getDeviceInfo().computeUnitsUsedForScratch)) / 2;
auto &gfxCoreHelper = device->getGfxCoreHelper();
uint32_t maxScratchSize = gfxCoreHelper.getMaxScratchSize();
auto &productHelper = device->getProductHelper();
uint32_t maxScratchSize = gfxCoreHelper.getMaxScratchSize(productHelper);
std::unique_ptr<MockImmutableData> mockKernelImmData =
std::make_unique<MockImmutableData>(perHwThreadPrivateMemorySizeRequested, maxScratchSize + 1, 0x100);

View File

@@ -1149,7 +1149,7 @@ ze_result_t DebugSessionImp::readSbaRegisters(EuThread::ThreadId threadId, uint3
return ret;
}
auto scratchSpacePTSize = gfxCoreHelper.getRenderSurfaceStatePitch(renderSurfaceState.data());
auto scratchSpacePTSize = gfxCoreHelper.getRenderSurfaceStatePitch(renderSurfaceState.data(), connectedDevice->getProductHelper());
auto threadOffset = getPerThreadScratchOffset(scratchSpacePTSize, threadId);
auto gmmHelper = connectedDevice->getNEODevice()->getGmmHelper();
auto scratchAllocationBase = gmmHelper->decanonize(gfxCoreHelper.getRenderSurfaceStateBaseAddress(renderSurfaceState.data()));

View File

@@ -201,7 +201,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverHwTestXeHPAndLater, givenScrat
EXPECT_EQ(length.surfaceState.depth + 1u, scratchState->getDepth());
EXPECT_EQ(length.surfaceState.width + 1u, scratchState->getWidth());
EXPECT_EQ(length.surfaceState.height + 1u, scratchState->getHeight());
EXPECT_EQ(kernel.kernelInfo.kernelDescriptor.kernelAttributes.perThreadScratchSize[0], EncodeSurfaceState<FamilyType>::getPitchForScratchInBytes(scratchState));
auto &productHelper = pDevice->getProductHelper();
EXPECT_EQ(kernel.kernelInfo.kernelDescriptor.kernelAttributes.perThreadScratchSize[0], EncodeSurfaceState<FamilyType>::getPitchForScratchInBytes(scratchState, productHelper));
}
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverHwTestXeHPAndLater, givenScratchSpaceSurfaceStateEnabledWhenNewSshProvidedAndNoScratchAllocationExistThenNoDirtyBitSet) {

View File

@@ -951,7 +951,8 @@ TEST_F(KernelPrivateSurfaceTest, givenNonNullDataParameterStreamWhenGettingConst
TEST_F(KernelPrivateSurfaceTest, GivenKernelWhenScratchSizeIsGreaterThanMaxScratchSizeThenReturnInvalidKernel) {
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
uint32_t maxScratchSize = gfxCoreHelper.getMaxScratchSize();
auto &productHelper = pDevice->getProductHelper();
uint32_t maxScratchSize = gfxCoreHelper.getMaxScratchSize(productHelper);
auto pKernelInfo = std::make_unique<MockKernelInfo>();
pKernelInfo->kernelDescriptor.kernelAttributes.simdSize = 32;

View File

@@ -71,7 +71,9 @@ CommandContainer::ErrorCode CommandContainer::initialize(Device *device, Allocat
this->device = device;
this->reusableAllocationList = reusableAllocationList;
size_t usableSize = getMaxUsableSpace();
this->defaultSshSize = HeapSize::defaultHeapSize;
auto &gfxCoreHelper = device->getGfxCoreHelper();
auto &productHelper = device->getProductHelper();
this->defaultSshSize = gfxCoreHelper.getDefaultSshSize(productHelper);
if (this->stateBaseAddressTracking) {
this->defaultSshSize = defaultSshSize;
}
@@ -86,7 +88,6 @@ CommandContainer::ErrorCode CommandContainer::initialize(Device *device, Allocat
cmdBufferAllocations.push_back(cmdBufferAllocation);
auto &gfxCoreHelper = device->getGfxCoreHelper();
if (this->usingPrimaryBuffer) {
this->selectedBbCmdSize = gfxCoreHelper.getBatchBufferStartSize();
} else {

View File

@@ -720,12 +720,12 @@ bool EncodeSurfaceState<Family>::doBindingTablePrefetch() {
}
template <typename Family>
void EncodeSurfaceState<Family>::setPitchForScratch(R_SURFACE_STATE *surfaceState, uint32_t pitch) {
void EncodeSurfaceState<Family>::setPitchForScratch(R_SURFACE_STATE *surfaceState, uint32_t pitch, const ProductHelper &productHelper) {
surfaceState->setSurfacePitch(pitch);
}
template <typename Family>
uint32_t EncodeSurfaceState<Family>::getPitchForScratchInBytes(R_SURFACE_STATE *surfaceState) {
uint32_t EncodeSurfaceState<Family>::getPitchForScratchInBytes(R_SURFACE_STATE *surfaceState, const ProductHelper &productHelper) {
return surfaceState->getSurfacePitch();
}

View File

@@ -16,6 +16,7 @@ class GraphicsAllocation;
class IndirectHeap;
class LinearStream;
class ReleaseHelper;
class ProductHelper;
struct EncodeSurfaceStateArgs;
struct HardwareInfo;
struct PipeControlArgs;
@@ -68,8 +69,8 @@ struct EncodeSurfaceState {
static void setFlagsForMediaCompression(R_SURFACE_STATE *surfaceState, Gmm *gmm);
static void disableCompressionFlags(R_SURFACE_STATE *surfaceState);
static void appendParamsForImageFromBuffer(R_SURFACE_STATE *surfaceState);
static void setPitchForScratch(R_SURFACE_STATE *surfaceState, uint32_t pitch);
static uint32_t getPitchForScratchInBytes(R_SURFACE_STATE *surfaceState);
static void setPitchForScratch(R_SURFACE_STATE *surfaceState, uint32_t pitch, const ProductHelper &productHelper);
static uint32_t getPitchForScratchInBytes(R_SURFACE_STATE *surfaceState, const ProductHelper &productHelper);
};
} // namespace NEO

View File

@@ -153,9 +153,9 @@ class GfxCoreHelper {
virtual size_t getSamplerStateSize() const = 0;
virtual bool preferInternalBcsEngine() const = 0;
virtual bool isScratchSpaceSurfaceStateAccessible() const = 0;
virtual uint32_t getMaxScratchSize() const = 0;
virtual uint32_t getMaxScratchSize(const NEO::ProductHelper &productHelper) const = 0;
virtual uint64_t getRenderSurfaceStateBaseAddress(void *renderSurfaceState) const = 0;
virtual uint32_t getRenderSurfaceStatePitch(void *renderSurfaceState) const = 0;
virtual uint32_t getRenderSurfaceStatePitch(void *renderSurfaceState, const ProductHelper &productHelper) const = 0;
virtual size_t getMax3dImageWidthOrHeight() const = 0;
virtual uint64_t getMaxMemAllocSize() const = 0;
virtual uint64_t getPatIndex(CacheRegion cacheRegion, CachePolicy cachePolicy) const = 0;
@@ -194,6 +194,8 @@ class GfxCoreHelper {
bool requireInputWalkOrder,
uint32_t &requiredWalkOrder,
uint32_t simd) const = 0;
virtual uint32_t getMaxPtssIndex(const ProductHelper &productHelper) const = 0;
virtual uint32_t getDefaultSshSize(const ProductHelper &productHelper) const = 0;
virtual ~GfxCoreHelper() = default;
@@ -230,7 +232,7 @@ class GfxCoreHelperHw : public GfxCoreHelper {
return reinterpret_cast<typename GfxFamily::RENDER_SURFACE_STATE *>(renderSurfaceState)->getSurfaceBaseAddress();
}
uint32_t getRenderSurfaceStatePitch(void *renderSurfaceState) const override;
uint32_t getRenderSurfaceStatePitch(void *renderSurfaceState, const ProductHelper &productHelper) const override;
const AubMemDump::LrcaHelper &getCsTraits(aub_stream::EngineType engineType) const override;
@@ -385,7 +387,7 @@ class GfxCoreHelperHw : public GfxCoreHelper {
void adjustPreemptionSurfaceSize(size_t &csrSize, const RootDeviceEnvironment &rootDeviceEnvironment) const override;
bool isScratchSpaceSurfaceStateAccessible() const override;
uint32_t getMaxScratchSize() const override;
uint32_t getMaxScratchSize(const NEO::ProductHelper &productHelper) const override;
bool preferInternalBcsEngine() const override;
size_t getMax3dImageWidthOrHeight() const override;
uint64_t getMaxMemAllocSize() const override;
@@ -426,6 +428,8 @@ class GfxCoreHelperHw : public GfxCoreHelper {
bool requireInputWalkOrder,
uint32_t &requiredWalkOrder,
uint32_t simd) const override;
uint32_t getMaxPtssIndex(const ProductHelper &productHelper) const override;
uint32_t getDefaultSshSize(const ProductHelper &productHelper) const override;
~GfxCoreHelperHw() override = default;

View File

@@ -19,6 +19,7 @@
#include "shared/source/helpers/local_id_gen.h"
#include "shared/source/helpers/pipe_control_args.h"
#include "shared/source/helpers/timestamp_packet.h"
#include "shared/source/indirect_heap/indirect_heap.h"
#include "shared/source/memory_manager/allocation_properties.h"
#include "shared/source/memory_manager/graphics_allocation.h"
#include "shared/source/os_interface/os_interface.h"
@@ -113,7 +114,7 @@ void GfxCoreHelperHw<Family>::setRenderSurfaceStateForScratchResource(const Root
state.setHeight(length.surfaceState.height + 1);
state.setDepth(length.surfaceState.depth + 1);
if (pitch) {
EncodeSurfaceState<Family>::setPitchForScratch(&state, pitch);
EncodeSurfaceState<Family>::setPitchForScratch(&state, pitch, rootDeviceEnvironment.getProductHelper());
}
// The graphics allocation for Host Ptr surface will be created in makeResident call and GPU address is expected to be the same as CPU address
@@ -767,10 +768,10 @@ bool GfxCoreHelperHw<GfxFamily>::inOrderAtomicSignallingEnabled(const RootDevice
}
template <typename GfxFamily>
uint32_t GfxCoreHelperHw<GfxFamily>::getRenderSurfaceStatePitch(void *renderSurfaceState) const {
uint32_t GfxCoreHelperHw<GfxFamily>::getRenderSurfaceStatePitch(void *renderSurfaceState, const ProductHelper &productHelper) const {
using RENDER_SURFACE_STATE = typename GfxFamily::RENDER_SURFACE_STATE;
auto surfaceState = reinterpret_cast<RENDER_SURFACE_STATE *>(renderSurfaceState);
return EncodeSurfaceState<GfxFamily>::getPitchForScratchInBytes(surfaceState);
return EncodeSurfaceState<GfxFamily>::getPitchForScratchInBytes(surfaceState, productHelper);
}
template <typename GfxFamily>
@@ -788,6 +789,16 @@ bool GfxCoreHelperHw<GfxFamily>::isRuntimeLocalIdsGenerationRequired(uint32_t ac
simd);
}
template <typename GfxFamily>
uint32_t GfxCoreHelperHw<GfxFamily>::getMaxPtssIndex(const ProductHelper &productHelper) const {
return 15u;
}
template <typename GfxFamily>
uint32_t GfxCoreHelperHw<GfxFamily>::getDefaultSshSize(const ProductHelper &productHelper) const {
return HeapSize::defaultHeapSize;
}
template <typename GfxFamily>
void *LriHelper<GfxFamily>::program(LinearStream *cmdStream, uint32_t address, uint32_t value, bool remap, bool isBcs) {
auto lri = cmdStream->getSpaceForCmd<MI_LOAD_REGISTER_IMM>();

View File

@@ -146,7 +146,7 @@ bool GfxCoreHelperHw<GfxFamily>::isScratchSpaceSurfaceStateAccessible() const {
}
template <typename GfxFamily>
uint32_t GfxCoreHelperHw<GfxFamily>::getMaxScratchSize() const {
uint32_t GfxCoreHelperHw<GfxFamily>::getMaxScratchSize(const NEO::ProductHelper &productHelper) const {
return 2 * MemoryConstants::megaByte;
}

View File

@@ -180,7 +180,7 @@ bool GfxCoreHelperHw<GfxFamily>::isScratchSpaceSurfaceStateAccessible() const {
return true;
}
template <typename GfxFamily>
uint32_t GfxCoreHelperHw<GfxFamily>::getMaxScratchSize() const {
uint32_t GfxCoreHelperHw<GfxFamily>::getMaxScratchSize(const NEO::ProductHelper &productHelper) const {
return 256 * MemoryConstants::kiloByte;
}

View File

@@ -70,7 +70,8 @@ uint32_t KernelHelper::getMaxWorkGroupCount(const RootDeviceEnvironment &rootDev
KernelHelper::ErrorCode KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(KernelDescriptor::KernelAttributes attributes, Device *device) {
auto &gfxCoreHelper = device->getRootDeviceEnvironment().getHelper<NEO::GfxCoreHelper>();
uint32_t maxScratchSize = gfxCoreHelper.getMaxScratchSize();
auto &productHelper = device->getRootDeviceEnvironment().getHelper<NEO::ProductHelper>();
uint32_t maxScratchSize = gfxCoreHelper.getMaxScratchSize(productHelper);
if ((attributes.perThreadScratchSize[0] > maxScratchSize) || (attributes.perThreadScratchSize[1] > maxScratchSize)) {
return KernelHelper::ErrorCode::invalidKernel;
}

View File

@@ -232,6 +232,7 @@ class ProductHelper {
virtual bool supportReadOnlyAllocations() const = 0;
virtual bool isDeviceToHostCopySignalingFenceRequired() const = 0;
virtual size_t getMaxFillPaternSizeForCopyEngine() const = 0;
virtual bool isAvailableExtendedScratch() const = 0;
virtual ~ProductHelper() = default;

View File

@@ -878,4 +878,9 @@ template <PRODUCT_FAMILY gfxProduct>
size_t ProductHelperHw<gfxProduct>::getMaxFillPaternSizeForCopyEngine() const {
return 4 * sizeof(uint32_t);
}
template <PRODUCT_FAMILY gfxProduct>
bool ProductHelperHw<gfxProduct>::isAvailableExtendedScratch() const {
return false;
}
} // namespace NEO

View File

@@ -177,6 +177,7 @@ class ProductHelperHw : public ProductHelper {
const std::vector<uint32_t> getSupportedLocalDispatchSizes(const HardwareInfo &hwInfo) const override;
bool isDeviceToHostCopySignalingFenceRequired() const override;
size_t getMaxFillPaternSizeForCopyEngine() const override;
bool isAvailableExtendedScratch() const override;
~ProductHelperHw() override = default;

View File

@@ -467,7 +467,8 @@ HWTEST_F(GfxCoreHelperTest, givenCreatedSurfaceStateBufferWhenNoAllocationProvid
EXPECT_EQ(length.surfaceState.depth + 1u, state->getDepth());
EXPECT_EQ(length.surfaceState.width + 1u, state->getWidth());
EXPECT_EQ(length.surfaceState.height + 1u, state->getHeight());
EXPECT_EQ(pitch, EncodeSurfaceState<FamilyType>::getPitchForScratchInBytes(state));
const auto &productHelper = getHelper<ProductHelper>();
EXPECT_EQ(pitch, EncodeSurfaceState<FamilyType>::getPitchForScratchInBytes(state, productHelper));
addr += offset;
EXPECT_EQ(addr, state->getSurfaceBaseAddress());
EXPECT_EQ(type, state->getSurfaceType());
@@ -1293,9 +1294,10 @@ HWTEST_F(GfxCoreHelperTest, givenGetRenderSurfaceStatePitchCalledThenCorrectValu
RENDER_SURFACE_STATE renderSurfaceState;
uint32_t expectedPitch = 0x400;
EncodeSurfaceState<FamilyType>::setPitchForScratch(&renderSurfaceState, expectedPitch);
const auto &productHelper = getHelper<ProductHelper>();
EncodeSurfaceState<FamilyType>::setPitchForScratch(&renderSurfaceState, expectedPitch, productHelper);
const auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
EXPECT_EQ(expectedPitch, gfxCoreHelper.getRenderSurfaceStatePitch(&renderSurfaceState));
EXPECT_EQ(expectedPitch, gfxCoreHelper.getRenderSurfaceStatePitch(&renderSurfaceState, productHelper));
}
HWTEST_F(GfxCoreHelperTest, whenBlitterSupportIsDisabledThenDontExposeAnyBcsEngine) {
@@ -1765,3 +1767,9 @@ HWTEST_F(GfxCoreHelperTest, givenEncodeDispatchKernelWhenUsingGfxHelperThenSameD
EXPECT_EQ(encoderReturn, helperReturn);
EXPECT_EQ(requiredWalkOrder, helperRequiredWalkOrder);
}
HWTEST_F(GfxCoreHelperTest, whenCallGetMaxPtssIndexThenCorrectValue) {
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
const auto &productHelper = getHelper<ProductHelper>();
EXPECT_EQ(15u, gfxCoreHelper.getMaxPtssIndex(productHelper));
}

View File

@@ -148,7 +148,8 @@ TEST_F(KernelHelperTest, GivenScratchSizeGreaterThanGlobalSizeWhenCheckingIfTher
KernelDescriptor::KernelAttributes attributes = {};
attributes.perThreadScratchSize[0] = (static_cast<uint32_t>((globalSize + pDevice->getDeviceInfo().computeUnitsUsedForScratch) / pDevice->getDeviceInfo().computeUnitsUsedForScratch)) + 100;
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
if (attributes.perThreadScratchSize[0] > gfxCoreHelper.getMaxScratchSize()) {
auto &productHelper = pDevice->getProductHelper();
if (attributes.perThreadScratchSize[0] > gfxCoreHelper.getMaxScratchSize(productHelper)) {
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::invalidKernel);
} else {
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::outOfDeviceMemory);
@@ -160,7 +161,8 @@ TEST_F(KernelHelperTest, GivenScratchPrivateSizeGreaterThanGlobalSizeWhenCheckin
KernelDescriptor::KernelAttributes attributes = {};
attributes.perThreadScratchSize[1] = (static_cast<uint32_t>((globalSize + pDevice->getDeviceInfo().computeUnitsUsedForScratch) / pDevice->getDeviceInfo().computeUnitsUsedForScratch)) + 100;
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
if (attributes.perThreadScratchSize[1] > gfxCoreHelper.getMaxScratchSize()) {
auto &productHelper = pDevice->getProductHelper();
if (attributes.perThreadScratchSize[1] > gfxCoreHelper.getMaxScratchSize(productHelper)) {
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::invalidKernel);
} else {
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::outOfDeviceMemory);
@@ -173,7 +175,8 @@ TEST_F(KernelHelperTest, GivenScratchAndPrivateSizeLessThanGlobalSizeWhenCheckin
auto size = (static_cast<uint32_t>((globalSize + pDevice->getDeviceInfo().computeUnitsUsedForScratch) / pDevice->getDeviceInfo().computeUnitsUsedForScratch)) - 100;
attributes.perHwThreadPrivateMemorySize = size;
auto &gfxCoreHelper = pDevice->getRootDeviceEnvironment().getHelper<NEO::GfxCoreHelper>();
uint32_t maxScratchSize = gfxCoreHelper.getMaxScratchSize();
auto &productHelper = pDevice->getProductHelper();
uint32_t maxScratchSize = gfxCoreHelper.getMaxScratchSize(productHelper);
attributes.perThreadScratchSize[0] = (size > maxScratchSize) ? maxScratchSize : size;
attributes.perThreadScratchSize[1] = (size > maxScratchSize) ? maxScratchSize : size;
EXPECT_EQ(KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(attributes, pDevice), KernelHelper::ErrorCode::success);
@@ -182,7 +185,8 @@ TEST_F(KernelHelperTest, GivenScratchAndPrivateSizeLessThanGlobalSizeWhenCheckin
TEST_F(KernelHelperTest, GivenScratchSizeGreaterThanMaxScratchSizeWhenCheckingIfThereIsEnaughSpaceThenInvalidKernelIsReturned) {
KernelDescriptor::KernelAttributes attributes = {};
auto &gfxCoreHelper = pDevice->getRootDeviceEnvironment().getHelper<NEO::GfxCoreHelper>();
uint32_t maxScratchSize = gfxCoreHelper.getMaxScratchSize();
auto &productHelper = pDevice->getProductHelper();
uint32_t maxScratchSize = gfxCoreHelper.getMaxScratchSize(productHelper);
attributes.perHwThreadPrivateMemorySize = 0x10;
attributes.perThreadScratchSize[0] = maxScratchSize + 1;
attributes.perThreadScratchSize[1] = 0x10;
@@ -192,7 +196,8 @@ TEST_F(KernelHelperTest, GivenScratchSizeGreaterThanMaxScratchSizeWhenCheckingIf
TEST_F(KernelHelperTest, GivenScratchPrivateSizeGreaterThanMaxScratchSizeWhenCheckingIfThereIsEnaughSpaceThenInvalidKernelIsReturned) {
KernelDescriptor::KernelAttributes attributes = {};
auto &gfxCoreHelper = pDevice->getRootDeviceEnvironment().getHelper<NEO::GfxCoreHelper>();
uint32_t maxScratchSize = gfxCoreHelper.getMaxScratchSize();
auto &productHelper = pDevice->getProductHelper();
uint32_t maxScratchSize = gfxCoreHelper.getMaxScratchSize(productHelper);
attributes.perHwThreadPrivateMemorySize = 0x10;
attributes.perThreadScratchSize[0] = 0x10;
attributes.perThreadScratchSize[1] = maxScratchSize + 1;