From 745b1f550339b3adbf272a28b9d0c767a86ff2fb Mon Sep 17 00:00:00 2001 From: EdB Date: Fri, 7 Nov 2014 10:30:40 +0100 Subject: [PATCH] clover: clCompileProgram CL_INVALID_COMPILER_OPTIONS clCompileProgram should return CL_INVALID_COMPILER_OPTIONS instead of CL_INVALID_BUILD_OPTIONS Reviewed-by: Francisco Jerez --- 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 3a6c0546153..60184ed10b8 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 e9538224bf6..cda447d565d 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; -- 2.30.2