spirv_new: print build log in get_program_with_il (#2274)

Print the build log when building the program in `get_program_with_il`
fails, to make it easier to investigate spirv_new test failures.

Factor out a global helper function `OutputBuildLog` for printing the
build log for a single device.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt
2025-02-18 18:13:01 +01:00
committed by GitHub
parent ea934a7648
commit 46dcf18a18
3 changed files with 42 additions and 28 deletions

View File

@@ -172,7 +172,12 @@ int get_program_with_il(clProgramWrapper &prog, const cl_device_id deviceID,
}
err = clBuildProgram(prog, 1, &deviceID, NULL, NULL, NULL);
SPIRV_CHECK_ERROR(err, "Failed to build program");
if (err != CL_SUCCESS)
{
cl_int outputErr = OutputBuildLog(prog, deviceID);
SPIRV_CHECK_ERROR(outputErr, "OutputBuildLog failed");
return err;
}
return err;
}