From 01a7adc12a86a516d848d286d8beb2fff6d01d36 Mon Sep 17 00:00:00 2001 From: philsmd Date: Sun, 6 Mar 2016 14:27:19 +0100 Subject: [PATCH] show build log whenever 'make DEBUG > 0' is set --- src/oclHashcat.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/oclHashcat.c b/src/oclHashcat.c index c3d4c1fc8..fcb23038a 100644 --- a/src/oclHashcat.c +++ b/src/oclHashcat.c @@ -13852,6 +13852,25 @@ int main (int argc, char **argv) int rc = hc_clBuildProgram (data.ocl, device_param->program, 1, &device_param->device, build_opts, NULL, NULL, false); + #ifdef DEBUG + size_t build_log_size = 0; + + hc_clGetProgramBuildInfo (data.ocl, device_param->program, device_param->device, CL_PROGRAM_BUILD_LOG, 0, NULL, &build_log_size); + + if (build_log_size > 1) + { + char *build_log = (char *) malloc (build_log_size + 1); + + memset (build_log, 0, build_log_size + 1); + + hc_clGetProgramBuildInfo (data.ocl, device_param->program, device_param->device, CL_PROGRAM_BUILD_LOG, build_log_size, build_log, NULL); + + puts (build_log); + + free (build_log); + } + #endif + if (rc != 0) { device_param->skipped = true; @@ -13907,6 +13926,25 @@ int main (int argc, char **argv) int rc = hc_clBuildProgram (data.ocl, device_param->program, 1, &device_param->device, build_opts_update, NULL, NULL, false); + #ifdef DEBUG + size_t build_log_size = 0; + + hc_clGetProgramBuildInfo (data.ocl, device_param->program, device_param->device, CL_PROGRAM_BUILD_LOG, 0, NULL, &build_log_size); + + if (build_log_size > 1) + { + char *build_log = (char *) malloc (build_log_size + 1); + + memset (build_log, 0, build_log_size + 1); + + hc_clGetProgramBuildInfo (data.ocl, device_param->program, device_param->device, CL_PROGRAM_BUILD_LOG, build_log_size, build_log, NULL); + + puts (build_log); + + free (build_log); + } + #endif + if (rc != 0) { device_param->skipped = true;