We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd9c40a commit 58ef967Copy full SHA for 58ef967
source/adapters/opencl/context.cpp
@@ -126,7 +126,9 @@ urContextRelease(ur_context_handle_t hContext) {
126
CL_RETURN_ON_FAILURE(clGetContextInfo(clContext, CL_CONTEXT_REFERENCE_COUNT,
127
sizeof(size_t), &refCount, nullptr));
128
129
- if (refCount == 1) {
+ // ExtFuncPtrCache is destroyed in an atexit() callback, so it doesn't
130
+ // necessarily outlive the adapter (or all the contexts).
131
+ if (refCount == 1 && cl_ext::ExtFuncPtrCache) {
132
cl_ext::ExtFuncPtrCache->clearCache(clContext);
133
}
134
0 commit comments