[Beignet] [PATCH] fix bin/cl-program-tester tests/cl/program/execute/attributes.cl regression.

Zhigang Gong zhigang.gong at linux.intel.com
Sun Sep 14 20:50:16 PDT 2014


LGTM, pushed. Thanks.

On Mon, Sep 15, 2014 at 06:33:12AM +0800, xionghu.luo at intel.com wrote:
> From: Luo Xionghu <xionghu.luo at intel.com>
> 
> work_group_size_hint should define another variable.
> 
> Signed-off-by: Luo Xionghu <xionghu.luo at intel.com>
> ---
>  backend/src/llvm/llvm_gen_backend.cpp |   13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp
> index b0e02ca..918af24 100644
> --- a/backend/src/llvm/llvm_gen_backend.cpp
> +++ b/backend/src/llvm/llvm_gen_backend.cpp
> @@ -1249,6 +1249,7 @@ namespace gbe
>      // Loop over the kernel metadatas to set the required work group size.
>      NamedMDNode *clKernelMetaDatas = TheModule->getNamedMetadata("opencl.kernels");
>      size_t reqd_wg_sz[3] = {0, 0, 0};
> +    size_t hint_wg_sz[3] = {0, 0, 0};
>      ir::FunctionArgument::InfoFromLLVM llvmInfo;
>      MDNode *node = NULL;
>      MDNode *addrSpaceNode = NULL;
> @@ -1320,18 +1321,18 @@ namespace gbe
>          ConstantInt *y = dyn_cast<ConstantInt>(attrNode->getOperand(2));
>          ConstantInt *z = dyn_cast<ConstantInt>(attrNode->getOperand(3));
>          GBE_ASSERT(x && y && z);
> -        reqd_wg_sz[0] = x->getZExtValue();
> -        reqd_wg_sz[1] = y->getZExtValue();
> -        reqd_wg_sz[2] = z->getZExtValue();
> +        hint_wg_sz[0] = x->getZExtValue();
> +        hint_wg_sz[1] = y->getZExtValue();
> +        hint_wg_sz[2] = z->getZExtValue();
>          functionAttributes += attrName->getString();
>          std::stringstream param;
>          char buffer[100];
>          param <<"(";
> -        param << reqd_wg_sz[0];
> +        param << hint_wg_sz[0];
>          param << ",";
> -        param << reqd_wg_sz[1];
> +        param << hint_wg_sz[1];
>          param << ",";
> -        param << reqd_wg_sz[2];
> +        param << hint_wg_sz[2];
>          param <<")";
>          param >> buffer;
>          functionAttributes += buffer;
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list