[Beignet] [PATCH] runtime: handle PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE

Yang, Rong R rong.r.yang at intel.com
Wed Apr 27 03:32:37 UTC 2016


Pushed, thanks.

> -----Original Message-----
> From: Pan, Xiuli
> Sent: Tuesday, April 26, 2016 14:43
> To: Song, Ruiling <ruiling.song at intel.com>; 'beignet at lists.freedesktop.org'
> <beignet at lists.freedesktop.org>
> Cc: Yang, Rong R <rong.r.yang at intel.com>
> Subject: RE: [Beignet] [PATCH] runtime: handle
> PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE
> 
> Ping to push!
> 
> -----Original Message-----
> From: Pan, Xiuli
> Sent: Wednesday, April 6, 2016 3:15 PM
> To: Ruiling Song <ruiling.song at intel.com>; beignet at lists.freedesktop.org
> Cc: Song, Ruiling <ruiling.song at intel.com>
> Subject: RE: [Beignet] [PATCH] runtime: handle
> PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE
> 
> LGTM!
> This is more considerate than my version.
> 
> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Ruiling Song
> Sent: Wednesday, April 6, 2016 2:29 PM
> To: beignet at lists.freedesktop.org
> Cc: Song, Ruiling <ruiling.song at intel.com>
> Subject: [Beignet] [PATCH] runtime: handle
> PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE
> 
> Signed-off-by: Ruiling Song <ruiling.song at intel.com>
> ---
>  src/cl_api.c     | 5 +++++
>  src/cl_program.c | 5 +++++
>  src/cl_program.h | 2 ++
>  3 files changed, 12 insertions(+)
> 
> diff --git a/src/cl_api.c b/src/cl_api.c index 131a84c..161ee46 100644
> --- a/src/cl_api.c
> +++ b/src/cl_api.c
> @@ -1456,6 +1456,11 @@ clGetProgramBuildInfo(cl_program             program,
>    }else if (param_name == CL_PROGRAM_BINARY_TYPE){
> 
>      FILL_GETINFO_RET (cl_uint, 1, &program->binary_type, CL_SUCCESS);
> +  } else if (param_name ==
> CL_PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE) {
> +    size_t global_size = 0;
> +    if (program->is_built)
> +      global_size = cl_program_get_global_variable_size(program);
> +    FILL_GETINFO_RET (size_t, 1, &global_size, CL_SUCCESS);
>    } else {
>      return CL_INVALID_VALUE;
>    }
> diff --git a/src/cl_program.c b/src/cl_program.c index ffdb2a1..7ef4af5
> 100644
> --- a/src/cl_program.c
> +++ b/src/cl_program.c
> @@ -230,6 +230,11 @@ static cl_int get_program_global_data(cl_program
> prog) {  #endif
>    return CL_SUCCESS;
>  }
> +
> +LOCAL size_t cl_program_get_global_variable_size(cl_program prog) {
> +  return interp_program_get_global_constant_size(prog->opaque);
> +}
> +
>  LOCAL cl_program
>  cl_program_create_from_binary(cl_context             ctx,
>                                cl_uint                num_devices,
> diff --git a/src/cl_program.h b/src/cl_program.h index 083d66a..8312530
> 100644
> --- a/src/cl_program.h
> +++ b/src/cl_program.h
> @@ -143,5 +143,7 @@ cl_program_get_kernel_names(cl_program p,
>                              size_t size,
>                              char *names,
>                              size_t *size_ret);
> +extern size_t
> +cl_program_get_global_variable_size(cl_program p);
>  #endif /* __CL_PROGRAM_H__ */
> 
> --
> 2.4.1
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list