When programming OpenCL and using C++, when calling the function clCreateContext(….), I have the option of registering a callback function in the even something goes wrong. Is it safe to throw an exception in this callback? Being that OpenCL is a C API and doesn’t use exceptions, I wasn’t sure if there would be any problems with this approach of error handling.
When programming OpenCL and using C++, when calling the function clCreateContext(….), I have the
Share
You should not throw exceptions across interface/module boundaries, and this would count as one. What would probably happen is that the exception would be unhandled and your program would crash.