diff --git a/mace/core/runtime/opencl/opencl_runtime.cc b/mace/core/runtime/opencl/opencl_runtime.cc index cd4fc9b7d5d30f43bdac59a22946660c87fde9d0..bcf264983fad70e8efae4eb5c7fb5a8e692d03d3 100644 --- a/mace/core/runtime/opencl/opencl_runtime.cc +++ b/mace/core/runtime/opencl/opencl_runtime.cc @@ -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; } diff --git a/mace/core/runtime/opencl/opencl_wrapper.cc b/mace/core/runtime/opencl/opencl_wrapper.cc index eab1907b92e262eb3034fb907453279a380fb0ad..a6f4135c49b04963b4682e257b56df79b72de036 100644 --- a/mace/core/runtime/opencl/opencl_wrapper.cc +++ b/mace/core/runtime/opencl/opencl_wrapper.cc @@ -802,8 +802,19 @@ CL_API_ENTRY cl_command_queue clCreateCommandQueueWithProperties( MACE_LATENCY_LOGGER(3, "clCreateCommandQueueWithProperties"); return func(context, device, properties, errcode_ret); } else { - if (errcode_ret != nullptr) *errcode_ret = CL_INVALID_PLATFORM; - return nullptr; + // 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; + } } }