From 6942d753cc8c18e09e4c65b4e1269a4d71111eb1 Mon Sep 17 00:00:00 2001 From: ysh329 Date: Wed, 12 Aug 2020 11:06:22 +0800 Subject: [PATCH] fix opencl valid api. test=develop (#4076) (#4096) --- lite/core/program.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lite/core/program.cc b/lite/core/program.cc index 9d2aedab0a..d2a8e17dd8 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) { -- GitLab