提交 b0d1334b 编写于 作者: 刘琦

Merge branch 'fix_mt6771' into 'master'

Fix MT6771 OpenCL 2.0 breakage

See merge request !1056
......@@ -364,7 +364,8 @@ OpenCLRuntime::OpenCLRuntime(
#endif
}
if (err != CL_SUCCESS) {
LOG(ERROR) << "error: " << OpenCLErrorToString(err);
LOG(ERROR) << "Failed to create OpenCL Context: "
<< OpenCLErrorToString(err);
return;
}
......@@ -373,7 +374,8 @@ OpenCLRuntime::OpenCLRuntime(
properties,
&err);
if (err != CL_SUCCESS) {
LOG(ERROR) << "error: " << OpenCLErrorToString(err);
LOG(ERROR) << "Failed to create OpenCL CommandQueue: "
<< OpenCLErrorToString(err);
return;
}
......
......@@ -802,9 +802,20 @@ CL_API_ENTRY cl_command_queue clCreateCommandQueueWithProperties(
MACE_LATENCY_LOGGER(3, "clCreateCommandQueueWithProperties");
return func(context, device, properties, errcode_ret);
} else {
// Fix MediaTek MT6771 OpenCL driver breakage
VLOG(2) << "Fallback to clCreateCommandQueue";
if (properties[0] == CL_QUEUE_PROPERTIES) {
// When calling with OpenCL-CLHPP, the 2nd param is provided by caller.
#pragma GCC diagnostic push // disable warning both for clang and gcc
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
return clCreateCommandQueue(context, device, properties[1], errcode_ret);
#pragma GCC diagnostic pop
} else {
LOG(FATAL) << "Unknown calling parameters, check the code here";
if (errcode_ret != nullptr) *errcode_ret = CL_INVALID_PLATFORM;
return nullptr;
}
}
}
CL_API_ENTRY cl_int clRetainCommandQueue(cl_command_queue command_queue)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册