1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-24 15:38:11 +00:00

Do not run any caching rounds in autotune in DEBUG mode if -n and -u are specified

This commit is contained in:
jsteube 2016-10-27 00:51:26 +02:00
parent 39eed94703
commit 05634fe727
2 changed files with 23 additions and 13 deletions

View File

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

View File

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