[Beignet] [PATCH 2/2] Add the serializeToBin and deserializeFromBin for kernel arg info.
Yang, Rong R
rong.r.yang at intel.com
Mon Jan 18 23:01:12 PST 2016
LGTM, pushed to master and Release_v1.1.
> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> junyan.he at inbox.com
> Sent: Monday, January 18, 2016 16:49
> To: beignet at lists.freedesktop.org
> Subject: [Beignet] [PATCH 2/2] Add the serializeToBin and deserializeFromBin
> for kernel arg info.
>
> From: Junyan He <junyan.he at linux.intel.com>
>
> Signed-off-by: Junyan He <junyan.he at linux.intel.com>
> ---
> backend/src/backend/program.cpp | 55
> +++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 55 insertions(+)
>
> diff --git a/backend/src/backend/program.cpp
> b/backend/src/backend/program.cpp index fd9e179..f886d03 100644
> --- a/backend/src/backend/program.cpp
> +++ b/backend/src/backend/program.cpp
> @@ -273,6 +273,24 @@ namespace gbe {
> OUT_UPDATE_SZ(arg.size);
> OUT_UPDATE_SZ(arg.align);
> OUT_UPDATE_SZ(arg.bti);
> +
> + OUT_UPDATE_SZ(arg.info.addrSpace);
> +
> + OUT_UPDATE_SZ(arg.info.typeName.size());
> + outs.write(arg.info.typeName.c_str(), arg.info.typeName.size());
> + ret_size += sizeof(char)*arg.info.typeName.size();
> +
> + OUT_UPDATE_SZ(arg.info.accessQual.size());
> + outs.write(arg.info.accessQual.c_str(), arg.info.accessQual.size());
> + ret_size += sizeof(char)*arg.info.accessQual.size();
> +
> + OUT_UPDATE_SZ(arg.info.typeQual.size());
> + outs.write(arg.info.typeQual.c_str(), arg.info.typeQual.size());
> + ret_size += sizeof(char)*arg.info.typeQual.size();
> +
> + OUT_UPDATE_SZ(arg.info.argName.size());
> + outs.write(arg.info.argName.c_str(), arg.info.argName.size());
> + ret_size += sizeof(char)*arg.info.argName.size();
> }
>
> OUT_UPDATE_SZ(patches.size());
> @@ -363,6 +381,43 @@ namespace gbe {
> IN_UPDATE_SZ(arg.size);
> IN_UPDATE_SZ(arg.align);
> IN_UPDATE_SZ(arg.bti);
> +
> + IN_UPDATE_SZ(arg.info.addrSpace);
> +
> + size_t len;
> + char* a_name = NULL;
> +
> + IN_UPDATE_SZ(len);
> + a_name = new char[len+1];
> + ins.read(a_name, len*sizeof(char));
> + total_size += sizeof(char)*len;
> + a_name[len] = 0;
> + arg.info.typeName = a_name;
> + delete[] a_name;
> +
> + IN_UPDATE_SZ(len);
> + a_name = new char[len+1];
> + ins.read(a_name, len*sizeof(char));
> + total_size += sizeof(char)*len;
> + a_name[len] = 0;
> + arg.info.accessQual = a_name;
> + delete[] a_name;
> +
> + IN_UPDATE_SZ(len);
> + a_name = new char[len+1];
> + ins.read(a_name, len*sizeof(char));
> + total_size += sizeof(char)*len;
> + a_name[len] = 0;
> + arg.info.typeQual = a_name;
> + delete[] a_name;
> +
> + IN_UPDATE_SZ(len);
> + a_name = new char[len+1];
> + ins.read(a_name, len*sizeof(char));
> + total_size += sizeof(char)*len;
> + a_name[len] = 0;
> + arg.info.argName = a_name;
> + delete[] a_name;
> }
>
> IN_UPDATE_SZ(patch_num);
> --
> 1.9.1
>
>
>
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list