Skip to content

Commit e5e48a0

Browse files
authored
fix missing names for cloned kernels (#255)
1 parent 1bb1a91 commit e5e48a0

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

intercept/src/dispatch.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7210,6 +7210,11 @@ CL_API_ENTRY cl_kernel CL_API_CALL CLIRN(clCloneKernel) (
72107210
CHECK_ERROR( errcode_ret[0] );
72117211
CALL_LOGGING_EXIT( errcode_ret[0], "returned %p", retVal );
72127212

7213+
if( retVal != NULL )
7214+
{
7215+
pIntercept->addKernelInfo( retVal, source_kernel );
7216+
}
7217+
72137218
return retVal;
72147219
}
72157220

intercept/src/intercept.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6532,6 +6532,17 @@ void CLIntercept::addKernelInfo(
65326532
}
65336533
}
65346534

6535+
///////////////////////////////////////////////////////////////////////////////
6536+
//
6537+
void CLIntercept::addKernelInfo(
6538+
const cl_kernel kernel,
6539+
const cl_kernel source_kernel )
6540+
{
6541+
std::lock_guard<std::mutex> lock(m_Mutex);
6542+
6543+
m_KernelInfoMap[ kernel ] = m_KernelInfoMap.at( source_kernel );
6544+
}
6545+
65356546
///////////////////////////////////////////////////////////////////////////////
65366547
//
65376548
void CLIntercept::checkRemoveKernelInfo( cl_kernel kernel )

intercept/src/intercept.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,9 @@ class CLIntercept
449449
const cl_kernel* kernels,
450450
const cl_program program,
451451
cl_uint numKernels );
452+
void addKernelInfo(
453+
const cl_kernel kernel,
454+
const cl_kernel source_kernel );
452455
void checkRemoveKernelInfo(
453456
const cl_kernel kernel );
454457

0 commit comments

Comments
 (0)