Skip to content

Commit 363ad5f

Browse files
[SYCL] Fix segmentation fault in program manager (#2057)
Signed-off-by: Dmitry Vodopyanov <[email protected]>
1 parent ee37fce commit 363ad5f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,11 @@ RT::PiProgram ProgramManager::createPIProgram(const RTDeviceBinaryImage &Img,
329329
? createSpirvProgram(Ctx, RawImg.BinaryStart, ImgSize)
330330
: createBinaryProgram(Ctx, RawImg.BinaryStart, ImgSize);
331331

332-
// associate the PI program with the image it was created for
333-
NativePrograms[Res] = &Img;
332+
{
333+
auto LockGuard = Ctx->getKernelProgramCache().acquireCachedPrograms();
334+
// associate the PI program with the image it was created for
335+
NativePrograms[Res] = &Img;
336+
}
334337

335338
if (DbgProgMgr > 1)
336339
std::cerr << "created program: " << Res

0 commit comments

Comments
 (0)