Allow and support vector-width 16, which is current maximum for

OpenCL. Closes #226.
This commit is contained in:
magnum
2016-02-18 08:51:45 +01:00
parent 998605ef89
commit a5be8a75ed
62 changed files with 1202 additions and 104 deletions
+1
View File
@@ -1,6 +1,7 @@
##
## Authors.....: Jens Steube <jens.steube@gmail.com>
## Gabriele Gristina <matrix@hashcat.net>
## magnum <john.magnum@hushmail.com>
##
## License.....: MIT
##
+4 -3
View File
@@ -1,6 +1,7 @@
/**
* Authors.....: Jens Steube <jens.steube@gmail.com>
* Gabriele Gristina <matrix@hashcat.net>
* magnum <john.magnum@hushmail.com>
*
* License.....: MIT
*/
@@ -394,7 +395,7 @@ const char *USAGE_BIG[] =
" --opencl-platforms=STR OpenCL platforms to use, separate with comma",
" -d, --opencl-devices=STR OpenCL devices to use, separate with comma",
" --opencl-device-types=STR OpenCL device-types to use, separate with comma, see references below",
" --opencl-vector-width=NUM OpenCL vector-width (either 1, 2, 4 or 8), overrides value from device query",
" --opencl-vector-width=NUM OpenCL vector-width (either 1, 2, 4, 8 or 16), overrides value from device query",
" -w, --workload-profile=NUM Enable a specific workload profile, see references below",
" -n, --kernel-accel=NUM Workload tuning, increase the outer-loop step size",
" -u, --kernel-loops=NUM Workload tuning, increase the inner-loop step size",
@@ -6306,7 +6307,7 @@ int main (int argc, char **argv)
return (-1);
}
if ((opencl_vector_width != 0) && (opencl_vector_width != 1) && (opencl_vector_width != 2) && (opencl_vector_width != 4) && (opencl_vector_width != 8))
if (opencl_vector_width_chgd && (!is_power_of_2(opencl_vector_width) || opencl_vector_width > 16))
{
log_error ("ERROR: opencl-vector-width %i not allowed", opencl_vector_width);
@@ -12803,7 +12804,7 @@ int main (int argc, char **argv)
vector_width = opencl_vector_width;
}
if (vector_width > 8) vector_width = 8;
if (vector_width > 16) vector_width = 16;
device_param->vector_width = vector_width;
+6
View File
@@ -1,6 +1,7 @@
/**
* Authors.....: Jens Steube <jens.steube@gmail.com>
* Gabriele Gristina <matrix@hashcat.net>
* magnum <john.magnum@hushmail.com>
*
* License.....: MIT
*/
@@ -16,6 +17,11 @@
* basic bit handling
*/
u32 is_power_of_2(u32 v)
{
return (v && !(v & (v - 1)));
}
u32 rotl32 (const u32 a, const u32 n)
{
return ((a << n) | (a >> (32 - n)));