diff options
Diffstat (limited to 'src/core/CL/CLUtils.cpp')
-rw-r--r-- | src/core/CL/CLUtils.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/CL/CLUtils.cpp b/src/core/CL/CLUtils.cpp index 7e56a3ba18..289300b3a1 100644 --- a/src/core/CL/CLUtils.cpp +++ b/src/core/CL/CLUtils.cpp @@ -111,4 +111,14 @@ cl::Image2D create_image2d_from_buffer(const cl::Context &ctx, const cl::Buffer return cl::Image2D(cl_image); } + +void handle_cl_error(const std::string &function_name, cl_int error_code) +{ + if(error_code != CL_SUCCESS) + { + std::string error_message = function_name + " - Error code: " + std::to_string(error_code); + ARM_COMPUTE_ERROR(error_message.c_str()); + } +} + } // namespace arm_compute |