Skip to content

Commit f7b9732

Browse files
Rishipal Singh Bhatiagfxbot
Rishipal Singh Bhatia
authored andcommitted
The private memory variable was being by the module level
metadata. instead of the function metdata. This was creating incorrect result in the patch tokens. Fixing that with this change. Change-Id: Ie08c29a36a4aeda301c160ed553647e5f7ee0828
1 parent d7be88d commit f7b9732

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,10 +1403,13 @@ void COpenCLKernel::AllocatePayload()
14031403
// Set only if the private memory metadata actually exists and we don't use
14041404
// scratch space for private memory.
14051405
bool noScratchSpacePrivMem = !m_Context->getModuleMetaData()->compOpt.UseScratchSpacePrivateMemory;
1406-
if (noScratchSpacePrivMem && m_Context->getModuleMetaData()->privateMemoryPerWI)
1406+
1407+
auto funcMD = m_Context->getModuleMetaData()->FuncMD.find(entry);
1408+
if (noScratchSpacePrivMem && (funcMD != m_Context->getModuleMetaData()->FuncMD.end()) && funcMD->second.privateMemoryPerWI)
14071409
{
1408-
m_perWIPrivateMemSize = m_Context->getModuleMetaData()->privateMemoryPerWI;
1410+
m_perWIPrivateMemSize = funcMD->second.privateMemoryPerWI;
14091411
}
1412+
14101413

14111414
m_ConstantBufferLength = 0;
14121415
m_NOSBufferSize = 0;

0 commit comments

Comments
 (0)