未验证 提交 6942d753 编写于 作者: Y ysh329 提交者: GitHub

fix opencl valid api. test=develop (#4076) (#4096)

上级 6920cc99
...@@ -161,7 +161,9 @@ RuntimeProgram::RuntimeProgram( ...@@ -161,7 +161,9 @@ RuntimeProgram::RuntimeProgram(
int block_idx) int block_idx)
: exec_scope_(exec_scope) { : exec_scope_(exec_scope) {
#ifdef LITE_WITH_OPENCL #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<TargetType::kOpenCL>; using OpenCLContext = Context<TargetType::kOpenCL>;
std::unique_ptr<KernelContext> unique_opencl_ctx(new KernelContext()); std::unique_ptr<KernelContext> unique_opencl_ctx(new KernelContext());
if (opencl_valid) { if (opencl_valid) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册