From 8c6907a3d7f39899cb418d166e774e87e4750772 Mon Sep 17 00:00:00 2001 From: jsteube Date: Fri, 23 Sep 2016 22:56:27 +0200 Subject: [PATCH] Move force_jit_compilation initialization to opencl_session_begin() as it depends on hash_mode --- src/hashcat.c | 19 ------------------- src/opencl.c | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/hashcat.c b/src/hashcat.c index dbddc3cfe..35edfa633 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -411,25 +411,6 @@ static int outer_loop (user_options_t *user_options, user_options_extra_t *user_ if (user_options->custom_charset_3) mp_setup_usr (mp_sys, mp_usr, user_options->custom_charset_3, 2, hashconfig, user_options); if (user_options->custom_charset_4) mp_setup_usr (mp_sys, mp_usr, user_options->custom_charset_4, 3, hashconfig, user_options); - /** - * Some algorithm, like descrypt, can benefit from JIT compilation - */ - - opencl_ctx->force_jit_compilation = -1; - - if (hashconfig->hash_mode == 8900) - { - opencl_ctx->force_jit_compilation = 8900; - } - else if (hashconfig->hash_mode == 9300) - { - opencl_ctx->force_jit_compilation = 8900; - } - else if (hashconfig->hash_mode == 1500 && user_options->attack_mode == ATTACK_MODE_BF && hashes->salts_cnt == 1) - { - opencl_ctx->force_jit_compilation = 1500; - } - /** * load rules */ diff --git a/src/opencl.c b/src/opencl.c index 2e6fb34d1..04905254b 100644 --- a/src/opencl.c +++ b/src/opencl.c @@ -2415,6 +2415,25 @@ void opencl_ctx_devices_destroy (opencl_ctx_t *opencl_ctx) int opencl_session_begin (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const hashes_t *hashes, const session_ctx_t *session_ctx, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const folder_config_t *folder_config, const bitmap_ctx_t *bitmap_ctx, const tuning_db_t *tuning_db) { + /** + * Some algorithm, like descrypt, can benefit from JIT compilation + */ + + opencl_ctx->force_jit_compilation = -1; + + if (hashconfig->hash_mode == 8900) + { + opencl_ctx->force_jit_compilation = 8900; + } + else if (hashconfig->hash_mode == 9300) + { + opencl_ctx->force_jit_compilation = 8900; + } + else if (hashconfig->hash_mode == 1500 && user_options->attack_mode == ATTACK_MODE_BF && hashes->salts_cnt == 1) + { + opencl_ctx->force_jit_compilation = 1500; + } + for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) { cl_int CL_err = CL_SUCCESS;