[Beignet] [PATCH] Increase size for compile log output
Yang, Rong R
rong.r.yang at intel.com
Fri Apr 8 06:55:10 UTC 2016
LGTM, pushed, thanks.
> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Giuseppe Bilotta
> Sent: Friday, March 25, 2016 19:15
> To: beignet at lists.freedesktop.org
> Cc: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>
> Subject: [Beignet] [PATCH] Increase size for compile log output
>
> The space to hold the output log from the compiler is currently preallocated.
> The previous size (1000 chars) is too small when many warnings and/or errors
> are present.
>
> Enlarge the buffer to 1024*1024 chars, in order to allow up to 1024 errors,
> each taking 1024 bytes to report. This is still a rather arbitrary choice, but
> should hopefully fit a wider range of cases.
>
> (This fixes an issue reported on #opencl)
>
> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>
> ---
> src/cl_program.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/cl_program.c b/src/cl_program.c index fb8eea5..b4656ce
> 100644
> --- a/src/cl_program.c
> +++ b/src/cl_program.c
> @@ -120,6 +120,7 @@ cl_program_delete(cl_program p)
> cl_free(p);
> }
>
> +#define BUILD_LOG_MAX_SIZE (1024*1024U)
> LOCAL cl_program
> cl_program_new(cl_context ctx)
> {
> @@ -133,9 +134,9 @@ cl_program_new(cl_context ctx)
> p->magic = CL_MAGIC_PROGRAM_HEADER;
> p->ctx = ctx;
> p->cmrt_program = NULL;
> - p->build_log = calloc(1000, sizeof(char));
> + p->build_log = calloc(BUILD_LOG_MAX_SIZE, sizeof(char));
> if (p->build_log)
> - p->build_log_max_sz = 1000;
> + p->build_log_max_sz = BUILD_LOG_MAX_SIZE;
> /* The queue also belongs to its context */
> cl_context_add_ref(ctx);
>
> --
> 2.6.3.659.gfdd8f28
>
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list