From 93277542243ec842fc79503bc06850094e691075 Mon Sep 17 00:00:00 2001 From: ysh329 Date: Thu, 9 Jul 2020 20:25:10 +0800 Subject: [PATCH] [cherry-pick][OPENCL] Fix opencl create cmd with prop, fix int16 model for fc opencl kernel. (#3918) * [OPENCL] Fix opencl fc int16 model bug caused by fc kernel (#3900) * fix opencl fc kernel caused int16 model weight abnormal. test=develop --- lite/backends/opencl/cl_wrapper.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lite/backends/opencl/cl_wrapper.cc b/lite/backends/opencl/cl_wrapper.cc index 93e176f9ed..f16baca860 100644 --- a/lite/backends/opencl/cl_wrapper.cc +++ b/lite/backends/opencl/cl_wrapper.cc @@ -104,7 +104,9 @@ void CLWrapper::InitFunctions() { PADDLE_DLSYM(clEnqueueMapBuffer); PADDLE_DLSYM(clEnqueueMapImage); PADDLE_DLSYM(clCreateCommandQueue); - PADDLE_DLSYM(clCreateCommandQueueWithProperties); + // note(ysh329): consider compatibility for cl_driver_version 1.10 + // using clCreateCommandQueue instead. + // PADDLE_DLSYM(clCreateCommandQueueWithProperties); PADDLE_DLSYM(clReleaseCommandQueue); PADDLE_DLSYM(clCreateProgramWithBinary); PADDLE_DLSYM(clRetainContext); @@ -437,9 +439,14 @@ CL_API_ENTRY cl_command_queue CL_API_CALL clCreateCommandQueueWithProperties( cl_device_id device, const cl_queue_properties *properties, cl_int *errcode_ret) CL_API_SUFFIX__VERSION_2_0 { - return paddle::lite::CLWrapper::Global() - ->clCreateCommandQueueWithProperties()( - context, device, properties, errcode_ret); + // note(ysh329): consider compatibility for cl_driver_version 1.10 + // using clCreateCommandQueue instead. + // return paddle::lite::CLWrapper::Global() + // ->clCreateCommandQueueWithProperties()( + // context, device, properties, errcode_ret); + // + return paddle::lite::CLWrapper::Global()->clCreateCommandQueue()( + context, device, 0, errcode_ret); } CL_API_ENTRY cl_int CL_API_CALL clReleaseCommandQueue( -- GitLab