[Mesa-dev] [PATCH 2/2] clover: clCompileProgram CL_INVALID_COMPILER_OPTIONS
Francisco Jerez
currojerez at riseup.net
Mon Nov 10 09:04:54 PST 2014
EdB <edb+mesa at sigluy.net> writes:
> clCompileProgram should return CL_INVALID_COMPILER_OPTIONS
> instead of CL_INVALID_BUILD_OPTIONS
Looks good to me,
Reviewed-by: Francisco Jerez <currojerez at riseup.net>
> ---
> src/gallium/state_trackers/clover/api/program.cpp | 2 ++
> src/gallium/state_trackers/clover/llvm/invocation.cpp | 2 +-
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/state_trackers/clover/api/program.cpp b/src/gallium/state_trackers/clover/api/program.cpp
> index 3a6c054..60184ed 100644
> --- a/src/gallium/state_trackers/clover/api/program.cpp
> +++ b/src/gallium/state_trackers/clover/api/program.cpp
> @@ -182,6 +182,8 @@ clBuildProgram(cl_program d_prog, cl_uint num_devs,
> prog.build(devs, opts);
> return CL_SUCCESS;
> } catch (error &e) {
> + if (e.get() == CL_INVALID_COMPILER_OPTIONS)
> + return CL_INVALID_BUILD_OPTIONS;
> if (e.get() == CL_COMPILE_PROGRAM_FAILURE)
> return CL_BUILD_PROGRAM_FAILURE;
> return e.get();
> diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> index d29f5a6..30547d0 100644
> --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> @@ -177,7 +177,7 @@ namespace {
> opts_carray.data() + opts_carray.size(),
> Diags);
> if (!Success) {
> - throw error(CL_INVALID_BUILD_OPTIONS);
> + throw error(CL_INVALID_COMPILER_OPTIONS);
> }
> c.getFrontendOpts().ProgramAction = clang::frontend::EmitLLVMOnly;
> c.getHeaderSearchOpts().UseBuiltinIncludes = true;
> --
> 1.9.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141110/ae50a9fd/attachment.sig>
More information about the mesa-dev
mailing list