From 15100059fa448cb1b5c64e5d3d17bb596c2f1e14 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Fri, 11 Nov 2016 14:51:30 +0100 Subject: [PATCH] Fix Intel OpenCL runtime version check --- src/opencl.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/opencl.c b/src/opencl.c index a907b4131..2741ba23c 100644 --- a/src/opencl.c +++ b/src/opencl.c @@ -2709,24 +2709,15 @@ int opencl_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime) { bool intel_warn = false; - int v0 = 0; - int v1 = 0; - int v2 = 0; - int v3 = 0; + float opencl_version = 0; + int opencl_build = 0; - int res = sscanf (device_param->driver_version, "%d.%d.%d.%d", &v0, &v1, &v2, &v3); + int res = sscanf (device_param->device_version, "OpenCL %f (Build %d)", &opencl_version, &opencl_build); - if (res == 4) + if (res == 2) { - int version = 0; - - version += v0 * 1000 * 1000 * 1000; - version += v1 * 1000 * 1000; - version += v2 * 1000; - version += v3; - // Intel OpenCL runtime 16.1.1 - if (version < 1002000025) intel_warn = true; + if (opencl_build < 25) intel_warn = true; } if (intel_warn == true)