mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-23 00:28:11 +00:00
Get rid of thread limit for bitsliced kernels
This commit is contained in:
parent
7b165a86a9
commit
872f82ab8d
@ -25957,17 +25957,6 @@ u32 hashconfig_forced_kernel_threads (hashcat_ctx_t *hashcat_ctx)
|
|||||||
|
|
||||||
u32 kernel_threads = 0;
|
u32 kernel_threads = 0;
|
||||||
|
|
||||||
// DES kernels needs to have a minimum thread count only
|
|
||||||
// because of the bitsliced kernel and the workgroup division done on it
|
|
||||||
|
|
||||||
if (hashconfig->hash_mode == 1500) kernel_threads = 64; // DES
|
|
||||||
if (hashconfig->hash_mode == 3000) kernel_threads = 64; // DES
|
|
||||||
if (hashconfig->hash_mode == 3100) kernel_threads = 64; // DES
|
|
||||||
if (hashconfig->hash_mode == 8500) kernel_threads = 64; // DES
|
|
||||||
if (hashconfig->hash_mode == 14000) kernel_threads = 64; // DES
|
|
||||||
if (hashconfig->hash_mode == 14100) kernel_threads = 64; // DES
|
|
||||||
if (hashconfig->hash_mode == 16000) kernel_threads = 64; // DES
|
|
||||||
|
|
||||||
// this should have a kernel hint attribute in the kernel files
|
// this should have a kernel hint attribute in the kernel files
|
||||||
// __attribute__((reqd_work_group_size(X, 1, 1)))
|
// __attribute__((reqd_work_group_size(X, 1, 1)))
|
||||||
|
|
||||||
@ -25991,7 +25980,8 @@ u32 hashconfig_forced_kernel_threads (hashcat_ctx_t *hashcat_ctx)
|
|||||||
|
|
||||||
u32 hashconfig_get_kernel_threads (hashcat_ctx_t *hashcat_ctx, const hc_device_param_t *device_param)
|
u32 hashconfig_get_kernel_threads (hashcat_ctx_t *hashcat_ctx, const hc_device_param_t *device_param)
|
||||||
{
|
{
|
||||||
const hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
const hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
||||||
|
const user_options_t *user_options = hashcat_ctx->user_options;
|
||||||
|
|
||||||
// a kernel can force a fixed value
|
// a kernel can force a fixed value
|
||||||
|
|
||||||
@ -25999,9 +25989,19 @@ u32 hashconfig_get_kernel_threads (hashcat_ctx_t *hashcat_ctx, const hc_device_p
|
|||||||
|
|
||||||
if (forced_kernel_threads) return forced_kernel_threads;
|
if (forced_kernel_threads) return forced_kernel_threads;
|
||||||
|
|
||||||
// for CPU we just do 1
|
// for CPU we just do 1 ...
|
||||||
|
|
||||||
if (device_param->device_type & CL_DEVICE_TYPE_CPU) return 1;
|
if (device_param->device_type & CL_DEVICE_TYPE_CPU)
|
||||||
|
{
|
||||||
|
// ... as long as it is not a bitsliced kernel, as they have a fixed 2nd dimension size of 32 in run_kernel
|
||||||
|
|
||||||
|
if ((hashconfig->opts_type & OPTS_TYPE_PT_BITSLICE) && (user_options->attack_mode == ATTACK_MODE_BF))
|
||||||
|
{
|
||||||
|
return 32;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
// this is an upper limit, a good start, since our strategy is to reduce thread counts only
|
// this is an upper limit, a good start, since our strategy is to reduce thread counts only
|
||||||
|
|
||||||
|
@ -3947,9 +3947,11 @@ static int get_kernel_wgs (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device
|
|||||||
|
|
||||||
if (CL_rc == -1) return -1;
|
if (CL_rc == -1) return -1;
|
||||||
|
|
||||||
if (compile_work_group_size[0] > 0)
|
const size_t cwgs_total = compile_work_group_size[0] * compile_work_group_size[1] * compile_work_group_size[2];
|
||||||
|
|
||||||
|
if (cwgs_total > 0)
|
||||||
{
|
{
|
||||||
kernel_threads = MIN (kernel_threads, (u32) compile_work_group_size[0]);
|
kernel_threads = MIN (kernel_threads, (u32) cwgs_total);
|
||||||
}
|
}
|
||||||
|
|
||||||
*result = kernel_threads;
|
*result = kernel_threads;
|
||||||
|
Loading…
Reference in New Issue
Block a user