From ef3a49cab25a2b5095b3b32c5e8023c138498455 Mon Sep 17 00:00:00 2001 From: Liangliang He Date: Sat, 10 Mar 2018 16:22:39 +0800 Subject: [PATCH] Enhance OpenCL error log message --- mace/core/runtime/opencl/opencl_runtime.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mace/core/runtime/opencl/opencl_runtime.cc b/mace/core/runtime/opencl/opencl_runtime.cc index ec297881..bf85e601 100644 --- a/mace/core/runtime/opencl/opencl_runtime.cc +++ b/mace/core/runtime/opencl/opencl_runtime.cc @@ -192,7 +192,12 @@ void OpenCLRuntime::BuildProgram(const std::string &program_name, } LOG(FATAL) << "Build program from " << (is_opencl_binary ? "binary: " : "source: ") - << built_program_key << " failed: " << ret; + << built_program_key << " failed: " + << (ret == CL_INVALID_PROGRAM ? "CL_INVALID_PROGRAM, possible " + "cause 1: the MACE library is built from SoC 1 but is " + "used on different SoC 2, possible cause 2: the MACE " + "buffer is corrupted make sure your code has no " + "out-of-range memory writing" : MakeString(ret)); } if (!is_opencl_binary) { -- GitLab