clvk
clvk copied to clipboard
Crash with global objects that use OpenCL functions in their destructors
Hi,
From my understanding the clvk global state is initialized on first demand, and it's destruction happens by registering a function to atexit
.
The problem arises where you have other libraries that have global objects that use OpenCL functions (eg clReleaseProgram in clblast) in their destructors. By then, all the atexit entries have been processed and the clvk state is already destroyed, leading to a segmentation fault.
The code in PR #530 fixes the issue for me