Skip to content

fix the device performance timing checks for clReleaseContext #412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions intercept/src/dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,9 +625,9 @@ CL_API_ENTRY cl_int CL_API_CALL CLIRN(clReleaseContext)(
{
GET_ENQUEUE_COUNTER();

cl_uint ref_count =
pIntercept->config().CallLogging ?
pIntercept->getRefCount( context ) : 0;
// Note: we use the ref count to for device performance timing checks,
// so get it unconditionally.
cl_uint ref_count = pIntercept->getRefCount( context );
CALL_LOGGING_ENTER( "[ ref count = %d ] context = %p",
ref_count,
context );
Expand All @@ -639,7 +639,8 @@ CL_API_ENTRY cl_int CL_API_CALL CLIRN(clReleaseContext)(
HOST_PERFORMANCE_TIMING_END();
CHECK_ERROR( retVal );
ADD_OBJECT_RELEASE( context );
CALL_LOGGING_EXIT( retVal, "[ ref count = %d ]", --ref_count );
--ref_count;
CALL_LOGGING_EXIT( retVal, "[ ref count = %d ]", ref_count );
DEVICE_PERFORMANCE_TIMING_CHECK_CONDITIONAL( ref_count == 0 );
FLUSH_CHROME_TRACE_BUFFERING_CONDITIONAL( ref_count == 0 );

Expand Down