From 9ed231c99c9728c1b5036636261ea642f39b9d02 Mon Sep 17 00:00:00 2001 From: Jukka Ojanen Date: Thu, 29 Jul 2021 00:07:10 +0300 Subject: [PATCH] Add comment to blocking OpenCL calls --- src/backend.c | 2 ++ src/hashes.c | 2 ++ src/selftest.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/backend.c b/src/backend.c index 69b6345c6..59458e5e8 100644 --- a/src/backend.c +++ b/src/backend.c @@ -4491,6 +4491,7 @@ int gidd_to_pw_t (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, c if (device_param->is_opencl == true) { + /* blocking */ if (hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_idx, CL_TRUE, gidd * sizeof (pw_idx_t), sizeof (pw_idx_t), &pw_idx, 0, NULL, NULL) == -1) return -1; } @@ -4530,6 +4531,7 @@ int gidd_to_pw_t (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, c { if (cnt > 0) { + /* blocking */ if (hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_comp_buf, CL_TRUE, off * sizeof (u32), cnt * sizeof (u32), pw->i, 0, NULL, NULL) == -1) return -1; } } diff --git a/src/hashes.c b/src/hashes.c index e1f8402c2..9145c9834 100644 --- a/src/hashes.c +++ b/src/hashes.c @@ -574,6 +574,7 @@ int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param) if (device_param->is_opencl == true) { + /* blocking */ if (hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_result, CL_TRUE, 0, sizeof (u32), &num_cracked, 0, NULL, NULL) == -1) return -1; } @@ -623,6 +624,7 @@ int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param) if (device_param->is_opencl == true) { + /* blocking */ rc = hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_plain_bufs, CL_TRUE, 0, num_cracked * sizeof (plain_t), cracked, 0, NULL, NULL); if (rc == -1) diff --git a/src/selftest.c b/src/selftest.c index d5fff9433..af3a94550 100644 --- a/src/selftest.c +++ b/src/selftest.c @@ -523,6 +523,7 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param if (device_param->is_opencl == true) { + /* blocking */ if (hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_TRUE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL) == -1) return -1; } @@ -600,6 +601,7 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param if (device_param->is_opencl == true) { + /* blocking */ if (hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_TRUE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL) == -1) return -1; }