1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-22 08:08:10 +00:00

Allow plugins to disable the multiplication of the kernel-accel value with the multiprocessor count of the compute device. Will be used later.

This commit is contained in:
Jens Steube 2021-04-13 11:26:17 +02:00
parent ee26805138
commit 9033975efd
2 changed files with 4 additions and 2 deletions

View File

@ -434,6 +434,7 @@ typedef enum opts_type
OPTS_TYPE_POTFILE_NOPASS = (1ULL << 47), // sometimes the password should not be printed to potfile
OPTS_TYPE_DYNAMIC_SHARED = (1ULL << 48), // use dynamic shared memory (note: needs special kernel changes)
OPTS_TYPE_SELF_TEST_DISABLE = (1ULL << 49), // some algos use JiT in combinations with a salt or create too much startup time
OPTS_TYPE_MP_MULTI_DISABLE = (1ULL << 50), // do not multiply the kernel-accel with the multiprocessor count per device to allow more fine-tuned workload settings
} opts_type_t;

View File

@ -7174,6 +7174,7 @@ void backend_ctx_devices_destroy (hashcat_ctx_t *hashcat_ctx)
void backend_ctx_devices_sync_tuning (hashcat_ctx_t *hashcat_ctx)
{
backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx;
hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
if (backend_ctx->enabled == false) return;
@ -7199,7 +7200,7 @@ void backend_ctx_devices_sync_tuning (hashcat_ctx_t *hashcat_ctx)
device_param_dst->kernel_loops = device_param_src->kernel_loops;
device_param_dst->kernel_threads = device_param_src->kernel_threads;
const u32 hardware_power = device_param_dst->device_processors * device_param_dst->kernel_threads;
const u32 hardware_power = ((hashconfig->opts_type & OPTS_TYPE_MP_MULTI_DISABLE) ? 1 : device_param_dst->device_processors) * device_param_dst->kernel_threads;
device_param_dst->hardware_power = hardware_power;
@ -10466,7 +10467,7 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx)
device_param->kernel_threads = kernel_threads;
device_param->hardware_power = device_processors * kernel_threads;
device_param->hardware_power = ((hashconfig->opts_type & OPTS_TYPE_MP_MULTI_DISABLE) ? 1 : device_processors) * kernel_threads;
u32 kernel_accel_min = device_param->kernel_accel_min;
u32 kernel_accel_max = device_param->kernel_accel_max;