summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdB <[email protected]>2014-11-07 10:30:40 +0100
committerTom Stellard <[email protected]>2014-12-02 11:05:03 -0500
commit745b1f550339b3adbf272a28b9d0c767a86ff2fb (patch)
treeb4dde0ad5c2d0d1327662481022e2afd3315bf72
parent29c7cf2b2ba850cf467167548d53383e1338fd5c (diff)
clover: clCompileProgram CL_INVALID_COMPILER_OPTIONS
clCompileProgram should return CL_INVALID_COMPILER_OPTIONS instead of CL_INVALID_BUILD_OPTIONS Reviewed-by: Francisco Jerez <[email protected]>
-rw-r--r--src/gallium/state_trackers/clover/api/program.cpp2
-rw-r--r--src/gallium/state_trackers/clover/llvm/invocation.cpp2
2 files changed, 3 insertions, 1 deletions
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;