Created hashconfig_kernel_thread_force()

pull/518/head
jsteube 8 years ago
parent f1cf902c35
commit 47f027d249

@ -1539,6 +1539,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co
int hashconfig_init (hashconfig_t *hashconfig, const user_options_t *user_options);
void hashconfig_destroy (hashconfig_t *hashconfig);
u32 hashconfig_kernel_thread_force (const hashconfig_t *hashconfig, const hc_device_param_t *device_param);
uint hashconfig_general_pw_min (hashconfig_t *hashconfig);
uint hashconfig_general_pw_max (hashconfig_t *hashconfig);
void hashconfig_general_defaults (hashconfig_t *hashconfig, hashes_t *hashes, const user_options_t *user_options);

@ -19919,6 +19919,39 @@ void hashconfig_destroy (hashconfig_t *hashconfig)
myfree (hashconfig);
}
u32 hashconfig_kernel_thread_force (const hashconfig_t *hashconfig, const hc_device_param_t *device_param)
{
u32 kernel_threads = MIN (KERNEL_THREADS_MAX, device_param->device_maxworkgroup_size);
if (hashconfig->hash_mode == 8900) kernel_threads = 64; // Scrypt
if (hashconfig->hash_mode == 9300) kernel_threads = 64; // Scrypt
if (device_param->device_type & CL_DEVICE_TYPE_CPU)
{
kernel_threads = KERNEL_THREADS_MAX_CPU;
}
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 == 3200) kernel_threads = 8; // Blowfish
if (hashconfig->hash_mode == 7500) kernel_threads = 64; // RC4
if (hashconfig->hash_mode == 8500) kernel_threads = 64; // DES
if (hashconfig->hash_mode == 9000) kernel_threads = 8; // Blowfish
if (hashconfig->hash_mode == 9700) kernel_threads = 64; // RC4
if (hashconfig->hash_mode == 9710) kernel_threads = 64; // RC4
if (hashconfig->hash_mode == 9800) kernel_threads = 64; // RC4
if (hashconfig->hash_mode == 9810) kernel_threads = 64; // RC4
if (hashconfig->hash_mode == 10400) kernel_threads = 64; // RC4
if (hashconfig->hash_mode == 10410) kernel_threads = 64; // RC4
if (hashconfig->hash_mode == 10500) kernel_threads = 64; // RC4
if (hashconfig->hash_mode == 13100) kernel_threads = 64; // RC4
if (hashconfig->hash_mode == 14000) kernel_threads = 64; // DES
if (hashconfig->hash_mode == 14100) kernel_threads = 64; // DES
return kernel_threads;
}
uint hashconfig_general_pw_min (hashconfig_t *hashconfig)
{
uint pw_min = PW_MIN;

@ -2641,33 +2641,7 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconf
* there needs to be some upper limit, otherwise there's too much overhead
*/
uint kernel_threads = MIN (KERNEL_THREADS_MAX, device_param->device_maxworkgroup_size);
if (hashconfig->hash_mode == 8900) kernel_threads = 64; // Scrypt
if (hashconfig->hash_mode == 9300) kernel_threads = 64; // Scrypt
if (device_param->device_type & CL_DEVICE_TYPE_CPU)
{
kernel_threads = KERNEL_THREADS_MAX_CPU;
}
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 == 3200) kernel_threads = 8; // Blowfish
if (hashconfig->hash_mode == 7500) kernel_threads = 64; // RC4
if (hashconfig->hash_mode == 8500) kernel_threads = 64; // DES
if (hashconfig->hash_mode == 9000) kernel_threads = 8; // Blowfish
if (hashconfig->hash_mode == 9700) kernel_threads = 64; // RC4
if (hashconfig->hash_mode == 9710) kernel_threads = 64; // RC4
if (hashconfig->hash_mode == 9800) kernel_threads = 64; // RC4
if (hashconfig->hash_mode == 9810) kernel_threads = 64; // RC4
if (hashconfig->hash_mode == 10400) kernel_threads = 64; // RC4
if (hashconfig->hash_mode == 10410) kernel_threads = 64; // RC4
if (hashconfig->hash_mode == 10500) kernel_threads = 64; // RC4
if (hashconfig->hash_mode == 13100) kernel_threads = 64; // RC4
if (hashconfig->hash_mode == 14000) kernel_threads = 64; // DES
if (hashconfig->hash_mode == 14100) kernel_threads = 64; // DES
u32 kernel_threads = hashconfig_kernel_thread_force (hashconfig, device_param);
device_param->kernel_threads = kernel_threads;

Loading…
Cancel
Save