From 05634fe7278cef3a43d21b714724228a242a5e6b Mon Sep 17 00:00:00 2001 From: jsteube Date: Thu, 27 Oct 2016 00:51:26 +0200 Subject: [PATCH] Do not run any caching rounds in autotune in DEBUG mode if -n and -u are specified --- src/autotune.c | 14 ++++++++++++-- src/opencl.c | 22 +++++++++++----------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/autotune.c b/src/autotune.c index e77978d8e..782952f96 100644 --- a/src/autotune.c +++ b/src/autotune.c @@ -8,6 +8,7 @@ #include "event.h" #include "opencl.h" #include "status.h" +#include "terminal.h" #include "autotune.h" static double try_run (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 kernel_accel, const u32 kernel_loops) @@ -52,12 +53,19 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param u32 kernel_accel = kernel_accel_min; u32 kernel_loops = kernel_loops_min; - // in this case the user specified a fixed -u and -n on the commandline + // in this case the user specified a fixed -n and -u on the commandline // no way to tune anything // but we need to run a few caching rounds - if ((kernel_loops_min == kernel_loops_max) && (kernel_accel_min == kernel_accel_max)) + if ((kernel_accel_min == kernel_accel_max) && (kernel_loops_min == kernel_loops_max)) { + #if defined (DEBUG) + + // don't do any autotune in debug mode in this case + // we're propably during kernel development + + #else + if (hashconfig->hash_mode != 2000) { try_run (hashcat_ctx, device_param, kernel_accel, kernel_loops); @@ -66,6 +74,8 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param try_run (hashcat_ctx, device_param, kernel_accel, kernel_loops); } + #endif + device_param->kernel_accel = kernel_accel; device_param->kernel_loops = kernel_loops; diff --git a/src/opencl.c b/src/opencl.c index e557fa758..3c38f54ed 100644 --- a/src/opencl.c +++ b/src/opencl.c @@ -3458,7 +3458,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) if (cached == 0) { #if defined (DEBUG) - if (user_options->quiet == false) event_log_warning (hashcat_ctx, "Device #%u: Kernel %s not found in cache! Building may take a while...", device_id + 1, filename_from_filepath (cached_file)); + if (user_options->quiet == false) event_log_warning (hashcat_ctx, "* Device #%u: Kernel %s not found in cache! Building may take a while...", device_id + 1, filename_from_filepath (cached_file)); #endif const int rc_read_kernel = read_kernel_binary (hashcat_ctx, source_file, 1, kernel_lengths, kernel_sources); @@ -3500,7 +3500,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) { device_param->skipped = true; - event_log_error (hashcat_ctx, "Device #%u: Kernel %s build failure. Proceeding without this device.", device_id + 1, source_file); + event_log_error (hashcat_ctx, "* Device #%u: Kernel %s build failure. Proceeding without this device.", device_id + 1, source_file); continue; } @@ -3526,7 +3526,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) else { #if defined (DEBUG) - event_log_warning (hashcat_ctx, "Device #%u: Kernel %s (%ld bytes)", device_id + 1, cached_file, cst.st_size); + event_log_warning (hashcat_ctx, "* Device #%u: Kernel %s (%ld bytes)", device_id + 1, cached_file, cst.st_size); #endif const int rc_read_kernel = read_kernel_binary (hashcat_ctx, cached_file, 1, kernel_lengths, kernel_sources); @@ -3545,7 +3545,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) else { #if defined (DEBUG) - event_log_warning (hashcat_ctx, "Device #%u: Kernel %s (%ld bytes)", device_id + 1, source_file, sst.st_size); + event_log_warning (hashcat_ctx, "* Device #%u: Kernel %s (%ld bytes)", device_id + 1, source_file, sst.st_size); #endif const int rc_read_kernel = read_kernel_binary (hashcat_ctx, source_file, 1, kernel_lengths, kernel_sources); @@ -3602,7 +3602,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) { device_param->skipped = true; - event_log_error (hashcat_ctx, "Device #%u: Kernel %s build failure. Proceeding without this device.", device_id + 1, source_file); + event_log_error (hashcat_ctx, "* Device #%u: Kernel %s build failure. Proceeding without this device.", device_id + 1, source_file); continue; } @@ -3664,7 +3664,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) if (cached == 0) { #if defined (DEBUG) - if (user_options->quiet == false) event_log_warning (hashcat_ctx, "Device #%u: Kernel %s not found in cache! Building may take a while...", device_id + 1, filename_from_filepath (cached_file)); + if (user_options->quiet == false) event_log_warning (hashcat_ctx, "* Device #%u: Kernel %s not found in cache! Building may take a while...", device_id + 1, filename_from_filepath (cached_file)); #endif const int rc_read_kernel = read_kernel_binary (hashcat_ctx, source_file, 1, kernel_lengths, kernel_sources); @@ -3706,7 +3706,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) { device_param->skipped = true; - event_log_error (hashcat_ctx, "Device #%u: Kernel %s build failure. Proceeding without this device.", device_id + 1, source_file); + event_log_error (hashcat_ctx, "* Device #%u: Kernel %s build failure. Proceeding without this device.", device_id + 1, source_file); continue; } @@ -3730,7 +3730,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) else { #if defined (DEBUG) - event_log_warning (hashcat_ctx, "Device #%u: Kernel %s (%ld bytes)", device_id + 1, cached_file, cst.st_size); + event_log_warning (hashcat_ctx, "* Device #%u: Kernel %s (%ld bytes)", device_id + 1, cached_file, cst.st_size); #endif const int rc_read_kernel = read_kernel_binary (hashcat_ctx, cached_file, 1, kernel_lengths, kernel_sources); @@ -3806,7 +3806,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) if (cached == 0) { #if defined (DEBUG) - if (user_options->quiet == false) event_log_warning (hashcat_ctx, "Device #%u: Kernel %s not found in cache! Building may take a while...", device_id + 1, filename_from_filepath (cached_file)); + if (user_options->quiet == false) event_log_warning (hashcat_ctx, "* Device #%u: Kernel %s not found in cache! Building may take a while...", device_id + 1, filename_from_filepath (cached_file)); #endif const int rc_read_kernel = read_kernel_binary (hashcat_ctx, source_file, 1, kernel_lengths, kernel_sources); @@ -3848,7 +3848,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) { device_param->skipped = true; - event_log_error (hashcat_ctx, "Device #%u: Kernel %s build failure. Proceed without this device.", device_id + 1, source_file); + event_log_error (hashcat_ctx, "* Device #%u: Kernel %s build failure. Proceed without this device.", device_id + 1, source_file); continue; } @@ -3872,7 +3872,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) else { #if defined (DEBUG) - if (user_options->quiet == false) event_log_warning (hashcat_ctx, "Device #%u: Kernel %s (%ld bytes)", device_id + 1, cached_file, cst.st_size); + if (user_options->quiet == false) event_log_warning (hashcat_ctx, "* Device #%u: Kernel %s (%ld bytes)", device_id + 1, cached_file, cst.st_size); #endif const int rc_read_kernel = read_kernel_binary (hashcat_ctx, cached_file, 1, kernel_lengths, kernel_sources);