From f652029f7e4fad46b9c444b6c53f45dabd98d22e Mon Sep 17 00:00:00 2001 From: Egor Churaev Date: Wed, 31 May 2023 11:48:09 +0300 Subject: [PATCH] [OpenCL] Improve diagnostic message Print error string if it is impossible to build kernel. --- src/runtime/opencl/opencl_module.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/runtime/opencl/opencl_module.cc b/src/runtime/opencl/opencl_module.cc index 45154ce2312c..5f2bc5db4959 100644 --- a/src/runtime/opencl/opencl_module.cc +++ b/src/runtime/opencl/opencl_module.cc @@ -252,7 +252,9 @@ cl_kernel OpenCLModuleNode::InstallKernel(cl::OpenCLWorkspace* w, cl::OpenCLThre log.resize(len); clGetProgramBuildInfo(programs_[func_name][device_id], dev, CL_PROGRAM_BUILD_LOG, len, &log[0], nullptr); - LOG(FATAL) << "OpenCL build error for device=" << dev << "\n" << log; + LOG(FATAL) << "OpenCL build error for device=" << dev + << "\nError: " << cl::CLGetErrorString(err) << "\n" + << log; } } // build kernel