[Beignet] [PATCH] GBE: add check dumpASMFileName.empty()
Yang, Rong R
rong.r.yang at intel.com
Tue Sep 8 01:44:38 PDT 2015
LGTM, pushed, thanks.
> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Ruiling Song
> Sent: Sunday, September 6, 2015 15:12
> To: beignet at lists.freedesktop.org
> Cc: Song, Ruiling
> Subject: [Beignet] [PATCH] GBE: add check dumpASMFileName.empty()
>
> Signed-off-by: Ruiling Song <ruiling.song at intel.com>
> ---
> backend/src/backend/program.cpp | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/backend/src/backend/program.cpp
> b/backend/src/backend/program.cpp index d9e6416..e75e911 100644
> --- a/backend/src/backend/program.cpp
> +++ b/backend/src/backend/program.cpp
> @@ -847,11 +847,14 @@ namespace gbe {
> clangErrSize = *errSize;
> }
>
> - FILE *asmDumpStream = fopen(dumpASMFileName.c_str(), "w");
> - if (asmDumpStream)
> - fclose(asmDumpStream);
> - p = gbe_program_new_from_llvm(deviceID, NULL, out_module,
> llvm_ctx, dumpASMFileName.c_str(), stringSize,
> - err, errSize, optLevel);
> + if (!dumpASMFileName.empty()) {
> + FILE *asmDumpStream = fopen(dumpASMFileName.c_str(), "w");
> + if (asmDumpStream)
> + fclose(asmDumpStream);
> + }
> + p = gbe_program_new_from_llvm(deviceID, NULL, out_module,
> llvm_ctx,
> + dumpASMFileName.empty() ? NULL :
> dumpASMFileName.c_str(),
> + stringSize, err, errSize,
> + optLevel);
> if (err != NULL)
> *errSize += clangErrSize;
> if (OCL_OUTPUT_BUILD_LOG && options)
> --
> 2.3.1
>
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list