[gegl] improving error logs



commit 09e3c61c6cad7f34057e7479f35b43bd080ce0aa
Author: Victor Oliveira <victormatheus gmail com>
Date:   Thu Feb 23 12:56:23 2012 -0200

    improving error logs

 gegl/opencl/gegl-cl-init.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/gegl/opencl/gegl-cl-init.c b/gegl/opencl/gegl-cl-init.c
index da665b5..10ca78d 100644
--- a/gegl/opencl/gegl-cl-init.c
+++ b/gegl/opencl/gegl-cl-init.c
@@ -300,12 +300,21 @@ gegl_cl_compile_and_build (const char *program_source, const char *kernel_name[]
       errcode = gegl_clBuildProgram(cl_data->program, 0, NULL, NULL, NULL, NULL);
       if (errcode != CL_SUCCESS)
         {
-          char buffer[2000];
+          char *msg;
+          size_t s;
           CL_SAFE_CALL( errcode = gegl_clGetProgramBuildInfo(cl_data->program,
                                                              gegl_cl_get_device(),
                                                              CL_PROGRAM_BUILD_LOG,
-                                                             sizeof(buffer), buffer, NULL) );
-          g_warning("OpenCL Build Error:%s\n%s", gegl_cl_errstring(errcode), buffer);
+                                                             0, NULL, &s) );
+
+          msg = g_malloc (s);
+          CL_SAFE_CALL( errcode = gegl_clGetProgramBuildInfo(cl_data->program,
+                                                             gegl_cl_get_device(),
+                                                             CL_PROGRAM_BUILD_LOG,
+                                                             s, msg, NULL) );
+          g_printf("[OpenCL] Build Error:%s\n%s", gegl_cl_errstring(errcode), msg);
+          g_free (msg);
+
           return NULL;
         }
       else



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]