performance: get reference from getBindlessInfo

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2024-09-03 11:43:38 +00:00
committed by Compute-Runtime-Automation
parent f8920fe3b4
commit 7adfa344c0
5 changed files with 14 additions and 14 deletions

View File

@@ -143,7 +143,7 @@ ze_result_t KernelImmutableData::initialize(NEO::KernelInfo *kernelInfo, Device
if (!neoDevice->getMemoryManager()->allocateBindlessSlot(globalConstBuffer)) {
return ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY;
}
auto ssInHeap = globalConstBuffer->getBindlessInfo();
auto &ssInHeap = globalConstBuffer->getBindlessInfo();
patchImplicitArgBindlessOffsetAndSetSurfaceState(crossThreadDataArrayRef, surfaceStateHeapArrayRef,
globalConstBuffer, kernelDescriptor->payloadMappings.implicitArgs.globalConstantsSurfaceAddress,
@@ -166,7 +166,7 @@ ze_result_t KernelImmutableData::initialize(NEO::KernelInfo *kernelInfo, Device
if (!neoDevice->getMemoryManager()->allocateBindlessSlot(globalVarBuffer)) {
return ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY;
}
auto ssInHeap = globalVarBuffer->getBindlessInfo();
auto &ssInHeap = globalVarBuffer->getBindlessInfo();
patchImplicitArgBindlessOffsetAndSetSurfaceState(crossThreadDataArrayRef, surfaceStateHeapArrayRef,
globalVarBuffer, kernelDescriptor->payloadMappings.implicitArgs.globalVariablesSurfaceAddress,
@@ -1221,7 +1221,7 @@ uint32_t KernelImp::getSurfaceStateHeapDataSize() const {
void *KernelImp::patchBindlessSurfaceState(NEO::GraphicsAllocation *alloc, uint32_t bindless) {
auto &gfxCoreHelper = this->module->getDevice()->getGfxCoreHelper();
auto ssInHeap = alloc->getBindlessInfo();
auto &ssInHeap = alloc->getBindlessInfo();
auto patchLocation = ptrOffset(getCrossThreadData(), bindless);
auto patchValue = gfxCoreHelper.getBindlessSurfaceExtendedMessageDescriptorValue(static_cast<uint32_t>(ssInHeap.surfaceStateOffset));

View File

@@ -2838,7 +2838,7 @@ HWTEST2_F(SetKernelArg, givenImageAndBindlessKernelWhenSetArgImageThenCopySurfac
ret = kernel->setArgImage(3, sizeof(imageHW.get()), &handle);
EXPECT_EQ(ZE_RESULT_SUCCESS, ret);
auto expectedSsInHeap = imageHW->getAllocation()->getBindlessInfo();
auto &expectedSsInHeap = imageHW->getAllocation()->getBindlessInfo();
EXPECT_EQ(imageHW->passedSurfaceStateHeap, expectedSsInHeap.ssPtr);
EXPECT_EQ(imageHW->passedSurfaceStateOffset, 0u);
EXPECT_TRUE(kernel->isBindlessOffsetSet[3]);
@@ -2900,7 +2900,7 @@ HWTEST2_F(SetKernelArg, givenBindlessKernelAndNoAvailableSpaceOnSshWhenSetArgIma
ret = kernel->setArgImage(3, sizeof(imageHW.get()), &handle);
EXPECT_EQ(ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY, ret);
auto bindlessInfo = imageHW->getAllocation()->getBindlessInfo();
auto &bindlessInfo = imageHW->getAllocation()->getBindlessInfo();
EXPECT_EQ(nullptr, bindlessInfo.ssPtr);
EXPECT_EQ(nullptr, bindlessInfo.heapAllocation);
}
@@ -2929,7 +2929,7 @@ HWTEST2_F(SetKernelArg, givenImageAndBindlessKernelWhenSetArgImageThenCopyImplic
auto &gfxCoreHelper = neoDevice->getGfxCoreHelper();
auto surfaceStateSize = gfxCoreHelper.getRenderSurfaceStateSize();
auto expectedSsInHeap = imageHW->getAllocation()->getBindlessInfo();
auto &expectedSsInHeap = imageHW->getAllocation()->getBindlessInfo();
EXPECT_EQ(imageHW->passedImplicitArgsSurfaceStateHeap, ptrOffset(expectedSsInHeap.ssPtr, surfaceStateSize));
EXPECT_EQ(imageHW->passedImplicitArgsSurfaceStateOffset, 0u);
EXPECT_TRUE(kernel->isBindlessOffsetSet[3]);
@@ -2960,7 +2960,7 @@ HWTEST2_F(SetKernelArg, givenImageBindlessKernelAndGlobalBindlessHelperWhenSetAr
auto &gfxCoreHelper = neoDevice->getGfxCoreHelper();
auto surfaceStateSize = gfxCoreHelper.getRenderSurfaceStateSize();
auto expectedSsInHeap = imageHW->getAllocation()->getBindlessInfo();
auto &expectedSsInHeap = imageHW->getAllocation()->getBindlessInfo();
EXPECT_EQ(imageHW->passedRedescribedSurfaceStateHeap, ptrOffset(expectedSsInHeap.ssPtr, surfaceStateSize * NEO::BindlessImageSlot::redescribedImage));
EXPECT_EQ(imageHW->passedRedescribedSurfaceStateOffset, 0u);
EXPECT_TRUE(kernel->isBindlessOffsetSet[3]);
@@ -3166,7 +3166,7 @@ HWTEST2_F(SetKernelArg, givenBindlessKernelAndNoAvailableSpaceOnSshWhenSetArgRed
ret = kernel->setArgRedescribedImage(3, handle);
EXPECT_EQ(ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY, ret);
auto bindlessInfo = imageHW->getAllocation()->getBindlessInfo();
auto &bindlessInfo = imageHW->getAllocation()->getBindlessInfo();
EXPECT_EQ(nullptr, bindlessInfo.ssPtr);
EXPECT_EQ(nullptr, bindlessInfo.heapAllocation);
}