diff --git a/lite/core/program.cc b/lite/core/program.cc index 9d2aedab0a108b59be551ce7a52667f7a90b90d4..d2a8e17dd82bd0b66876953e04ea504250246278 100644 --- a/lite/core/program.cc +++ b/lite/core/program.cc @@ -161,7 +161,9 @@ RuntimeProgram::RuntimeProgram( int block_idx) : exec_scope_(exec_scope) { #ifdef LITE_WITH_OPENCL - bool opencl_valid = CLRuntime::Global()->OpenCLAvaliableForDevice(); + bool opencl_valid = paddle::lite::CLWrapper::Global()->OpenclLibFound() && + paddle::lite::CLWrapper::Global()->DlsymSuccess() && + CLRuntime::Global()->OpenCLAvaliableForDevice(); using OpenCLContext = Context; std::unique_ptr unique_opencl_ctx(new KernelContext()); if (opencl_valid) {