diff --git a/include/CL/opencl.hpp b/include/CL/opencl.hpp index 53f479de..b343a964 100644 --- a/include/CL/opencl.hpp +++ b/include/CL/opencl.hpp @@ -11539,7 +11539,10 @@ class CommandBufferKhr : public detail::Wrapper cl_int finalizeCommandBuffer() const { - return detail::errHandler(::clFinalizeCommandBufferKHR(object_), __FINALIZE_COMMAND_BUFFER_KHR_ERR); + if (pfn_clFinalizeCommandBufferKHR == nullptr) { + return detail::errHandler(CL_INVALID_OPERATION, __FINALIZE_COMMAND_BUFFER_KHR_ERR); + } + return detail::errHandler(pfn_clFinalizeCommandBufferKHR(object_), __FINALIZE_COMMAND_BUFFER_KHR_ERR); } cl_int enqueueCommandBuffer(vector &queues,