clover: clCompileProgram CL_INVALID_COMPILER_OPTIONS

clCompileProgram should return CL_INVALID_COMPILER_OPTIONS
instead of CL_INVALID_BUILD_OPTIONS

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
This commit is contained in:
EdB
2014-11-07 10:30:40 +01:00
committed by Tom Stellard
parent 29c7cf2b2b
commit 745b1f5503
2 changed files with 3 additions and 1 deletions

View File

@@ -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();

View File

@@ -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;