[Beignet] [PATCH 1/4 opencl 1.2] Add the -cl-kernel-arg-info into the clang build options

Zhigang Gong zhigang.gong at linux.intel.com
Tue Jun 10 02:12:14 PDT 2014


On Mon, Jun 09, 2014 at 02:38:46PM +0800, junyan.he at inbox.com wrote:
> From: Junyan He <junyan.he at linux.intel.com>
> 
> We always add -cl-kernel-arg-info to the options. This option just generate
> the arg information for the backend, no other side effect and does not have
> performance issue.  So we just always add it here.
> 
> Signed-off-by: Junyan He <junyan.he at linux.intel.com>
> ---
>  backend/src/CMakeLists.txt      | 2 +-
>  backend/src/backend/program.cpp | 7 ++++++-
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/backend/src/CMakeLists.txt b/backend/src/CMakeLists.txt
> index 528595f..927c087 100644
> --- a/backend/src/CMakeLists.txt
> +++ b/backend/src/CMakeLists.txt
> @@ -45,7 +45,7 @@ set (pch_object ${ocl_blob_file}.pch)
>  set (local_pch_object ${ocl_blob_file}.local.pch)
>  # generate pch object
>  if (LLVM_VERSION_NODOT VERSION_GREATER 32)
> -    set (clang_cmd -cc1 -x cl -triple spir -ffp-contract=off)
> +    set (clang_cmd -cc1 -x cl -triple spir -ffp-contract=off -cl-kernel-arg-info)
>  else (LLVM_VERSION_NODOT VERSION_GREATER 32)
>      if (LLVM_VERSION_NODOT VERSION_GREATER 31)
>          set (clang_cmd -cc1 -x cl -triple nvptx -ffp-contract=off)
> diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp
> index 121e237..925f908 100644
> --- a/backend/src/backend/program.cpp
> +++ b/backend/src/backend/program.cpp
> @@ -751,7 +751,12 @@ namespace gbe {
>  
>         So we just disable the PCH validation of Clang and do the judgement by ourself. */
>  
> -    if(options) {
> +    /* We always add -cl-kernel-arg-info to the options. This option just generate the arg
> +       information for the backend, no other side effect and does not have performance issue. */
> +    if (!options || !strstr(const_cast<char *>(options), "-cl-kernel-arg-info"))
> +      clOpt += "-cl-kernel-arg-info";
We need to add an extra space after the default option, need to change it to"-cl-kernel-arg-info ",
as we will add other user options right after it.

I will change it and no need for new version. The whole patchset LGTM, I will push latter, thanks.

> +
> +    if (options) {
>        char *p;
>        /* FIXME: Though we can disable the pch valid check, and load pch successfully,
>           but these language opts and pre-defined macro will still generate the diag msg
> -- 
> 1.8.3.2
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list