clover: clCompileProgram CL_INVALID_COMPILER_OPTIONS
authorEdB <edb+mesa@sigluy.net>
Fri, 7 Nov 2014 09:30:40 +0000 (10:30 +0100)
committerTom Stellard <thomas.stellard@amd.com>
Tue, 2 Dec 2014 16:05:03 +0000 (11:05 -0500)
clCompileProgram should return CL_INVALID_COMPILER_OPTIONS
instead of CL_INVALID_BUILD_OPTIONS

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/gallium/state_trackers/clover/api/program.cpp
src/gallium/state_trackers/clover/llvm/invocation.cpp

index 3a6c05461537f8dd47794c60fe766e3f5d04852f..60184ed10b86b7f6c9847b10a809c51604191a49 100644 (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();
index e9538224bf6730d276aefac4499f8d4624a9b8d3..cda447d565dc22e4dbd2f29b8d6de16c42c0da02 100644 (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;