mirror of
https://github.com/hashcat/hashcat.git
synced 2025-01-13 17:21:10 +00:00
Merge branch 'master' of https://github.com/hashcat/oclHashcat
This commit is contained in:
commit
6d37c123a5
@ -45,6 +45,7 @@
|
||||
#include <termios.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <mach-o/dyld.h>
|
||||
#include <mach/mach.h>
|
||||
#endif
|
||||
|
||||
typedef void *OCL_LIB;
|
||||
|
179
include/shared.h
179
include/shared.h
@ -43,7 +43,18 @@
|
||||
#define hc_thread_mutex_unlock(m) pthread_mutex_unlock (&m)
|
||||
#define hc_thread_mutex_init(m) pthread_mutex_init (&m, NULL)
|
||||
#define hc_thread_mutex_delete(m) pthread_mutex_destroy (&m)
|
||||
#endif
|
||||
|
||||
#ifdef OSX
|
||||
typedef struct cpu_set
|
||||
{
|
||||
uint32_t count;
|
||||
|
||||
} cpu_set_t;
|
||||
|
||||
static inline void CPU_ZERO (cpu_set_t *cs) { cs->count = 0; }
|
||||
static inline void CPU_SET (int num, cpu_set_t *cs) { cs->count |= (1 << num); }
|
||||
static inline int CPU_ISSET (int num, cpu_set_t *cs) { return (cs->count & (1 << num)); }
|
||||
#endif
|
||||
|
||||
/**
|
||||
@ -208,7 +219,7 @@ extern hc_thread_mutex_t mux_display;
|
||||
|
||||
#define KERNEL_ACCEL_OSX_1800 1
|
||||
#define KERNEL_ACCEL_OSX_2500 2
|
||||
#define KERNEL_ACCEL_OSX_5000 16
|
||||
#define KERNEL_ACCEL_OSX_5000 8
|
||||
#define KERNEL_ACCEL_OSX_6100 1
|
||||
#define KERNEL_ACCEL_OSX_6211 2
|
||||
#define KERNEL_ACCEL_OSX_6231 1
|
||||
@ -236,36 +247,6 @@ extern hc_thread_mutex_t mux_display;
|
||||
#define KERNEL_ACCEL_OSX_12500 1
|
||||
#define KERNEL_ACCEL_OSX_13000 1
|
||||
|
||||
#define KERNEL_ACCEL_1800 2
|
||||
#define KERNEL_ACCEL_2500 8
|
||||
#define KERNEL_ACCEL_5000 64
|
||||
#define KERNEL_ACCEL_6100 8
|
||||
#define KERNEL_ACCEL_6211 16
|
||||
#define KERNEL_ACCEL_6231 4
|
||||
#define KERNEL_ACCEL_6241 32
|
||||
#define KERNEL_ACCEL_6800 8
|
||||
#define KERNEL_ACCEL_7100 2
|
||||
#define KERNEL_ACCEL_7200 2
|
||||
#define KERNEL_ACCEL_7900 2
|
||||
#define KERNEL_ACCEL_8200 2
|
||||
#define KERNEL_ACCEL_8700 8
|
||||
#define KERNEL_ACCEL_9100 8
|
||||
#define KERNEL_ACCEL_9200 2
|
||||
#define KERNEL_ACCEL_9300 2
|
||||
#define KERNEL_ACCEL_9400 8
|
||||
#define KERNEL_ACCEL_9500 8
|
||||
#define KERNEL_ACCEL_9600 2
|
||||
#define KERNEL_ACCEL_10000 2
|
||||
#define KERNEL_ACCEL_10500 64
|
||||
#define KERNEL_ACCEL_11300 2
|
||||
#define KERNEL_ACCEL_11600 2
|
||||
#define KERNEL_ACCEL_11700 4
|
||||
#define KERNEL_ACCEL_11800 4
|
||||
#define KERNEL_ACCEL_12200 2
|
||||
#define KERNEL_ACCEL_12400 64
|
||||
#define KERNEL_ACCEL_12500 8
|
||||
#define KERNEL_ACCEL_13000 8
|
||||
|
||||
#define KERNEL_ACCEL_0 128
|
||||
#define KERNEL_ACCEL_10 128
|
||||
#define KERNEL_ACCEL_11 128
|
||||
@ -326,8 +307,10 @@ extern hc_thread_mutex_t mux_display;
|
||||
#define KERNEL_ACCEL_1740 64
|
||||
#define KERNEL_ACCEL_1750 32
|
||||
#define KERNEL_ACCEL_1760 32
|
||||
#define KERNEL_ACCEL_1800 2
|
||||
#define KERNEL_ACCEL_2100 8
|
||||
#define KERNEL_ACCEL_2400 64
|
||||
#define KERNEL_ACCEL_2500 8
|
||||
#define KERNEL_ACCEL_2410 64
|
||||
#define KERNEL_ACCEL_2600 64
|
||||
#define KERNEL_ACCEL_2611 64
|
||||
@ -346,6 +329,7 @@ extern hc_thread_mutex_t mux_display;
|
||||
#define KERNEL_ACCEL_4700 64
|
||||
#define KERNEL_ACCEL_4800 128
|
||||
#define KERNEL_ACCEL_4900 64
|
||||
#define KERNEL_ACCEL_5000 64
|
||||
#define KERNEL_ACCEL_5100 64
|
||||
#define KERNEL_ACCEL_5200 8
|
||||
#define KERNEL_ACCEL_5300 32
|
||||
@ -355,13 +339,17 @@ extern hc_thread_mutex_t mux_display;
|
||||
#define KERNEL_ACCEL_5700 64
|
||||
#define KERNEL_ACCEL_5800 8
|
||||
#define KERNEL_ACCEL_6000 64
|
||||
#define KERNEL_ACCEL_6100 8
|
||||
#define KERNEL_ACCEL_6211 16
|
||||
#define KERNEL_ACCEL_6212 8
|
||||
#define KERNEL_ACCEL_6213 8
|
||||
#define KERNEL_ACCEL_6221 4
|
||||
#define KERNEL_ACCEL_6222 4
|
||||
#define KERNEL_ACCEL_6223 4
|
||||
#define KERNEL_ACCEL_6231 4
|
||||
#define KERNEL_ACCEL_6232 4
|
||||
#define KERNEL_ACCEL_6233 4
|
||||
#define KERNEL_ACCEL_6241 32
|
||||
#define KERNEL_ACCEL_6242 16
|
||||
#define KERNEL_ACCEL_6243 16
|
||||
#define KERNEL_ACCEL_6300 8
|
||||
@ -369,22 +357,34 @@ extern hc_thread_mutex_t mux_display;
|
||||
#define KERNEL_ACCEL_6500 8
|
||||
#define KERNEL_ACCEL_6600 8
|
||||
#define KERNEL_ACCEL_6700 8
|
||||
#define KERNEL_ACCEL_6800 8
|
||||
#define KERNEL_ACCEL_6900 16
|
||||
#define KERNEL_ACCEL_7100 2
|
||||
#define KERNEL_ACCEL_7200 2
|
||||
#define KERNEL_ACCEL_7300 64
|
||||
#define KERNEL_ACCEL_7400 2
|
||||
#define KERNEL_ACCEL_7500 8
|
||||
#define KERNEL_ACCEL_7600 64
|
||||
#define KERNEL_ACCEL_7700 16
|
||||
#define KERNEL_ACCEL_7800 8
|
||||
#define KERNEL_ACCEL_7900 2
|
||||
#define KERNEL_ACCEL_8000 8
|
||||
#define KERNEL_ACCEL_8100 64
|
||||
#define KERNEL_ACCEL_8200 2
|
||||
#define KERNEL_ACCEL_8300 64
|
||||
#define KERNEL_ACCEL_8400 64
|
||||
#define KERNEL_ACCEL_8500 64
|
||||
#define KERNEL_ACCEL_8600 8
|
||||
#define KERNEL_ACCEL_8700 8
|
||||
#define KERNEL_ACCEL_8800 8
|
||||
#define KERNEL_ACCEL_8900 16
|
||||
#define KERNEL_ACCEL_9000 2
|
||||
#define KERNEL_ACCEL_9100 8
|
||||
#define KERNEL_ACCEL_9200 2
|
||||
#define KERNEL_ACCEL_9300 2
|
||||
#define KERNEL_ACCEL_9400 8
|
||||
#define KERNEL_ACCEL_9500 8
|
||||
#define KERNEL_ACCEL_9600 2
|
||||
#define KERNEL_ACCEL_9700 8
|
||||
#define KERNEL_ACCEL_9710 8
|
||||
#define KERNEL_ACCEL_9720 8
|
||||
@ -392,10 +392,12 @@ extern hc_thread_mutex_t mux_display;
|
||||
#define KERNEL_ACCEL_9810 8
|
||||
#define KERNEL_ACCEL_9820 8
|
||||
#define KERNEL_ACCEL_9900 64
|
||||
#define KERNEL_ACCEL_10000 2
|
||||
#define KERNEL_ACCEL_10100 128
|
||||
#define KERNEL_ACCEL_10200 64
|
||||
#define KERNEL_ACCEL_10300 8
|
||||
#define KERNEL_ACCEL_10400 8
|
||||
#define KERNEL_ACCEL_10500 64
|
||||
#define KERNEL_ACCEL_10410 8
|
||||
#define KERNEL_ACCEL_10420 8
|
||||
#define KERNEL_ACCEL_10600 64
|
||||
@ -405,16 +407,24 @@ extern hc_thread_mutex_t mux_display;
|
||||
#define KERNEL_ACCEL_11000 64
|
||||
#define KERNEL_ACCEL_11100 64
|
||||
#define KERNEL_ACCEL_11200 64
|
||||
#define KERNEL_ACCEL_11300 2
|
||||
#define KERNEL_ACCEL_11400 8
|
||||
#define KERNEL_ACCEL_11500 128
|
||||
#define KERNEL_ACCEL_11600 2
|
||||
#define KERNEL_ACCEL_11700 4
|
||||
#define KERNEL_ACCEL_11800 4
|
||||
#define KERNEL_ACCEL_11900 2
|
||||
#define KERNEL_ACCEL_12000 2
|
||||
#define KERNEL_ACCEL_12100 2
|
||||
#define KERNEL_ACCEL_12200 2
|
||||
#define KERNEL_ACCEL_12300 2
|
||||
#define KERNEL_ACCEL_12400 64
|
||||
#define KERNEL_ACCEL_12500 8
|
||||
#define KERNEL_ACCEL_12600 32
|
||||
#define KERNEL_ACCEL_12700 64
|
||||
#define KERNEL_ACCEL_12800 64
|
||||
#define KERNEL_ACCEL_12900 8
|
||||
#define KERNEL_ACCEL_13000 8
|
||||
|
||||
/**
|
||||
* device loops macro
|
||||
@ -575,7 +585,11 @@ extern hc_thread_mutex_t mux_display;
|
||||
#define KERNEL_LOOPS_190 128
|
||||
#define KERNEL_LOOPS_200 128
|
||||
#define KERNEL_LOOPS_300 64
|
||||
#define KERNEL_LOOPS_400 256
|
||||
#define KERNEL_LOOPS_500 256
|
||||
#define KERNEL_LOOPS_501 256
|
||||
#define KERNEL_LOOPS_900 256
|
||||
#define KERNEL_LOOPS_910 256
|
||||
#define KERNEL_LOOPS_1000 256
|
||||
#define KERNEL_LOOPS_1100 128
|
||||
#define KERNEL_LOOPS_1400 64
|
||||
@ -587,6 +601,8 @@ extern hc_thread_mutex_t mux_display;
|
||||
#define KERNEL_LOOPS_1441 64
|
||||
#define KERNEL_LOOPS_1450 32
|
||||
#define KERNEL_LOOPS_1460 32
|
||||
#define KERNEL_LOOPS_1500 256
|
||||
#define KERNEL_LOOPS_1600 256
|
||||
#define KERNEL_LOOPS_1700 32
|
||||
#define KERNEL_LOOPS_1710 32
|
||||
#define KERNEL_LOOPS_1711 32
|
||||
@ -597,13 +613,17 @@ extern hc_thread_mutex_t mux_display;
|
||||
#define KERNEL_LOOPS_1740 32
|
||||
#define KERNEL_LOOPS_1750 16
|
||||
#define KERNEL_LOOPS_1760 16
|
||||
#define KERNEL_LOOPS_1800 16
|
||||
#define KERNEL_LOOPS_2100 256
|
||||
#define KERNEL_LOOPS_2400 256
|
||||
#define KERNEL_LOOPS_2410 256
|
||||
#define KERNEL_LOOPS_2500 256
|
||||
#define KERNEL_LOOPS_2600 128
|
||||
#define KERNEL_LOOPS_2611 128
|
||||
#define KERNEL_LOOPS_2612 128
|
||||
#define KERNEL_LOOPS_2711 64
|
||||
#define KERNEL_LOOPS_2811 64
|
||||
#define KERNEL_LOOPS_3000 256
|
||||
#define KERNEL_LOOPS_3100 16
|
||||
#define KERNEL_LOOPS_3200 16
|
||||
#define KERNEL_LOOPS_3710 128
|
||||
@ -617,73 +637,24 @@ extern hc_thread_mutex_t mux_display;
|
||||
#define KERNEL_LOOPS_4900 128
|
||||
#define KERNEL_LOOPS_5000 64
|
||||
#define KERNEL_LOOPS_5100 256
|
||||
#define KERNEL_LOOPS_5200 256
|
||||
#define KERNEL_LOOPS_5300 32
|
||||
#define KERNEL_LOOPS_5400 32
|
||||
#define KERNEL_LOOPS_5500 128
|
||||
#define KERNEL_LOOPS_5600 64
|
||||
#define KERNEL_LOOPS_5700 64
|
||||
#define KERNEL_LOOPS_5800 256
|
||||
#define KERNEL_LOOPS_6000 64
|
||||
#define KERNEL_LOOPS_6100 64
|
||||
#define KERNEL_LOOPS_6231 200
|
||||
#define KERNEL_LOOPS_6232 200
|
||||
#define KERNEL_LOOPS_6233 200
|
||||
#define KERNEL_LOOPS_6900 64
|
||||
#define KERNEL_LOOPS_7300 64
|
||||
#define KERNEL_LOOPS_7500 16
|
||||
#define KERNEL_LOOPS_7600 128
|
||||
#define KERNEL_LOOPS_7700 128
|
||||
#define KERNEL_LOOPS_7800 64
|
||||
#define KERNEL_LOOPS_8000 64
|
||||
#define KERNEL_LOOPS_8100 128
|
||||
#define KERNEL_LOOPS_8200 200
|
||||
#define KERNEL_LOOPS_8300 64
|
||||
#define KERNEL_LOOPS_8400 64
|
||||
#define KERNEL_LOOPS_8500 16
|
||||
#define KERNEL_LOOPS_8600 16
|
||||
#define KERNEL_LOOPS_8700 16
|
||||
#define KERNEL_LOOPS_9700 200
|
||||
#define KERNEL_LOOPS_9710 200
|
||||
#define KERNEL_LOOPS_9720 200
|
||||
#define KERNEL_LOOPS_9800 200
|
||||
#define KERNEL_LOOPS_9820 200
|
||||
#define KERNEL_LOOPS_9810 200
|
||||
#define KERNEL_LOOPS_9900 256
|
||||
#define KERNEL_LOOPS_10100 512
|
||||
#define KERNEL_LOOPS_10200 64
|
||||
#define KERNEL_LOOPS_10400 256
|
||||
#define KERNEL_LOOPS_10410 256
|
||||
#define KERNEL_LOOPS_10420 256
|
||||
#define KERNEL_LOOPS_10600 64
|
||||
#define KERNEL_LOOPS_10700 64
|
||||
#define KERNEL_LOOPS_10800 32
|
||||
#define KERNEL_LOOPS_11000 256
|
||||
#define KERNEL_LOOPS_11100 128
|
||||
#define KERNEL_LOOPS_11200 128
|
||||
#define KERNEL_LOOPS_11300 256
|
||||
#define KERNEL_LOOPS_11400 128
|
||||
#define KERNEL_LOOPS_11500 256
|
||||
#define KERNEL_LOOPS_11700 64
|
||||
#define KERNEL_LOOPS_11800 64
|
||||
#define KERNEL_LOOPS_12600 32
|
||||
|
||||
#define KERNEL_LOOPS_400 256
|
||||
#define KERNEL_LOOPS_500 256
|
||||
#define KERNEL_LOOPS_501 256
|
||||
#define KERNEL_LOOPS_910 256
|
||||
#define KERNEL_LOOPS_1500 256
|
||||
#define KERNEL_LOOPS_1600 256
|
||||
#define KERNEL_LOOPS_1800 16
|
||||
#define KERNEL_LOOPS_2100 256
|
||||
#define KERNEL_LOOPS_2500 256
|
||||
#define KERNEL_LOOPS_3000 256
|
||||
#define KERNEL_LOOPS_5200 256
|
||||
#define KERNEL_LOOPS_5800 256
|
||||
#define KERNEL_LOOPS_6211 200
|
||||
#define KERNEL_LOOPS_6212 200
|
||||
#define KERNEL_LOOPS_6213 200
|
||||
#define KERNEL_LOOPS_6221 200
|
||||
#define KERNEL_LOOPS_6222 200
|
||||
#define KERNEL_LOOPS_6223 200
|
||||
#define KERNEL_LOOPS_6231 200
|
||||
#define KERNEL_LOOPS_6232 200
|
||||
#define KERNEL_LOOPS_6233 200
|
||||
#define KERNEL_LOOPS_6241 200
|
||||
#define KERNEL_LOOPS_6242 200
|
||||
#define KERNEL_LOOPS_6243 200
|
||||
@ -693,10 +664,24 @@ extern hc_thread_mutex_t mux_display;
|
||||
#define KERNEL_LOOPS_6600 200
|
||||
#define KERNEL_LOOPS_6700 256
|
||||
#define KERNEL_LOOPS_6800 200
|
||||
#define KERNEL_LOOPS_6900 64
|
||||
#define KERNEL_LOOPS_7100 256
|
||||
#define KERNEL_LOOPS_7200 200
|
||||
#define KERNEL_LOOPS_7300 64
|
||||
#define KERNEL_LOOPS_7400 200
|
||||
#define KERNEL_LOOPS_7500 16
|
||||
#define KERNEL_LOOPS_7600 128
|
||||
#define KERNEL_LOOPS_7700 128
|
||||
#define KERNEL_LOOPS_7800 64
|
||||
#define KERNEL_LOOPS_7900 256
|
||||
#define KERNEL_LOOPS_8000 64
|
||||
#define KERNEL_LOOPS_8100 128
|
||||
#define KERNEL_LOOPS_8200 200
|
||||
#define KERNEL_LOOPS_8300 64
|
||||
#define KERNEL_LOOPS_8400 64
|
||||
#define KERNEL_LOOPS_8500 16
|
||||
#define KERNEL_LOOPS_8600 16
|
||||
#define KERNEL_LOOPS_8700 16
|
||||
#define KERNEL_LOOPS_8800 256
|
||||
#define KERNEL_LOOPS_8900 1
|
||||
#define KERNEL_LOOPS_9000 16
|
||||
@ -706,11 +691,34 @@ extern hc_thread_mutex_t mux_display;
|
||||
#define KERNEL_LOOPS_9400 200
|
||||
#define KERNEL_LOOPS_9500 200
|
||||
#define KERNEL_LOOPS_9600 200
|
||||
#define KERNEL_LOOPS_9700 200
|
||||
#define KERNEL_LOOPS_9710 200
|
||||
#define KERNEL_LOOPS_9720 200
|
||||
#define KERNEL_LOOPS_9800 200
|
||||
#define KERNEL_LOOPS_9820 200
|
||||
#define KERNEL_LOOPS_9810 200
|
||||
#define KERNEL_LOOPS_9900 256
|
||||
#define KERNEL_LOOPS_10000 200
|
||||
#define KERNEL_LOOPS_10100 512
|
||||
#define KERNEL_LOOPS_10200 64
|
||||
#define KERNEL_LOOPS_10300 128
|
||||
#define KERNEL_LOOPS_10400 256
|
||||
#define KERNEL_LOOPS_10410 256
|
||||
#define KERNEL_LOOPS_10420 256
|
||||
#define KERNEL_LOOPS_10500 64
|
||||
#define KERNEL_LOOPS_10600 64
|
||||
#define KERNEL_LOOPS_10700 64
|
||||
#define KERNEL_LOOPS_10800 32
|
||||
#define KERNEL_LOOPS_10900 200
|
||||
#define KERNEL_LOOPS_11000 256
|
||||
#define KERNEL_LOOPS_11100 128
|
||||
#define KERNEL_LOOPS_11200 128
|
||||
#define KERNEL_LOOPS_11300 256
|
||||
#define KERNEL_LOOPS_11400 128
|
||||
#define KERNEL_LOOPS_11500 256
|
||||
#define KERNEL_LOOPS_11600 512
|
||||
#define KERNEL_LOOPS_11700 64
|
||||
#define KERNEL_LOOPS_11800 64
|
||||
#define KERNEL_LOOPS_11900 200
|
||||
#define KERNEL_LOOPS_12000 200
|
||||
#define KERNEL_LOOPS_12100 200
|
||||
@ -718,6 +726,7 @@ extern hc_thread_mutex_t mux_display;
|
||||
#define KERNEL_LOOPS_12300 256
|
||||
#define KERNEL_LOOPS_12400 256
|
||||
#define KERNEL_LOOPS_12500 256
|
||||
#define KERNEL_LOOPS_12600 32
|
||||
#define KERNEL_LOOPS_12700 10
|
||||
#define KERNEL_LOOPS_12800 100
|
||||
#define KERNEL_LOOPS_12900 64
|
||||
|
@ -390,11 +390,7 @@ const char *USAGE_BIG[] =
|
||||
" -c, --segment-size=NUM Size in MB to cache from the wordfile",
|
||||
" --bitmap-min=NUM Minimum number of bits allowed for bitmaps",
|
||||
" --bitmap-max=NUM Maximum number of bits allowed for bitmaps",
|
||||
#ifndef OSX
|
||||
" --cpu-affinity=STR Locks to CPU devices, separate with comma",
|
||||
#else
|
||||
" --cpu-affinity=STR Locks to CPU devices, separate with comma (disabled on OSX)",
|
||||
#endif
|
||||
" --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",
|
||||
@ -5196,9 +5192,7 @@ int main (int argc, char **argv)
|
||||
uint increment = INCREMENT;
|
||||
uint increment_min = INCREMENT_MIN;
|
||||
uint increment_max = INCREMENT_MAX;
|
||||
#ifndef OSX
|
||||
char *cpu_affinity = NULL;
|
||||
#endif
|
||||
OCL_PTR *ocl = NULL;
|
||||
char *opencl_devices = NULL;
|
||||
char *opencl_platforms = NULL;
|
||||
@ -5361,9 +5355,7 @@ int main (int argc, char **argv)
|
||||
{"markov-classic", no_argument, 0, IDX_MARKOV_CLASSIC},
|
||||
{"markov-threshold", required_argument, 0, IDX_MARKOV_THRESHOLD},
|
||||
{"markov-hcstat", required_argument, 0, IDX_MARKOV_HCSTAT},
|
||||
#ifndef OSX
|
||||
{"cpu-affinity", required_argument, 0, IDX_CPU_AFFINITY},
|
||||
#endif
|
||||
{"opencl-devices", required_argument, 0, IDX_OPENCL_DEVICES},
|
||||
{"opencl-platforms", required_argument, 0, IDX_OPENCL_PLATFORMS},
|
||||
{"opencl-device-types", required_argument, 0, IDX_OPENCL_DEVICE_TYPES},
|
||||
@ -5672,9 +5664,7 @@ int main (int argc, char **argv)
|
||||
case IDX_HEX_CHARSET: hex_charset = 1; break;
|
||||
case IDX_HEX_SALT: hex_salt = 1; break;
|
||||
case IDX_HEX_WORDLIST: hex_wordlist = 1; break;
|
||||
#ifndef OSX
|
||||
case IDX_CPU_AFFINITY: cpu_affinity = optarg; break;
|
||||
#endif
|
||||
case IDX_OPENCL_DEVICES: opencl_devices = optarg; break;
|
||||
case IDX_OPENCL_PLATFORMS: opencl_platforms = optarg; break;
|
||||
case IDX_OPENCL_DEVICE_TYPES:
|
||||
@ -6423,12 +6413,10 @@ int main (int argc, char **argv)
|
||||
* cpu affinity
|
||||
*/
|
||||
|
||||
#ifndef OSX
|
||||
if (cpu_affinity)
|
||||
{
|
||||
set_cpu_affinity (cpu_affinity);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (rp_gen_seed_chgd == 0)
|
||||
{
|
||||
@ -6543,9 +6531,7 @@ int main (int argc, char **argv)
|
||||
logfile_top_uint64 (limit);
|
||||
logfile_top_uint64 (skip);
|
||||
logfile_top_char (separator);
|
||||
#ifndef OSX
|
||||
logfile_top_string (cpu_affinity);
|
||||
#endif
|
||||
logfile_top_string (custom_charset_1);
|
||||
logfile_top_string (custom_charset_2);
|
||||
logfile_top_string (custom_charset_3);
|
||||
@ -13227,12 +13213,12 @@ int main (int argc, char **argv)
|
||||
*/
|
||||
|
||||
#ifdef HAVE_HWMON
|
||||
int *temp_retain_fanspeed_value = (int *) mycalloc (devices_cnt, sizeof (int));
|
||||
int *temp_retain_fanspeed_value = (int *) mycalloc (data.devices_cnt, sizeof (int));
|
||||
|
||||
#ifdef HAVE_ADL
|
||||
ADLOD6MemClockState *od_clock_mem_status = (ADLOD6MemClockState *) mycalloc (devices_cnt, sizeof (ADLOD6MemClockState));
|
||||
ADLOD6MemClockState *od_clock_mem_status = (ADLOD6MemClockState *) mycalloc (data.devices_cnt, sizeof (ADLOD6MemClockState));
|
||||
|
||||
int *od_power_control_status = (int *) mycalloc (devices_cnt, sizeof (int));
|
||||
int *od_power_control_status = (int *) mycalloc (data.devices_cnt, sizeof (int));
|
||||
#endif // ADL
|
||||
#endif
|
||||
|
||||
@ -13340,7 +13326,7 @@ int main (int argc, char **argv)
|
||||
|
||||
if (gpu_temp_disable == 0)
|
||||
{
|
||||
for (uint device_id = 0; device_id < devices_cnt; device_id++)
|
||||
for (uint device_id = 0; device_id < data.devices_cnt; device_id++)
|
||||
{
|
||||
hc_device_param_t *device_param = &data.devices_param[device_id];
|
||||
|
||||
@ -13379,7 +13365,7 @@ int main (int argc, char **argv)
|
||||
{
|
||||
hc_thread_mutex_lock (mux_adl);
|
||||
|
||||
for (uint device_id = 0; device_id < devices_cnt; device_id++)
|
||||
for (uint device_id = 0; device_id < data.devices_cnt; device_id++)
|
||||
{
|
||||
hc_device_param_t *device_param = &data.devices_param[device_id];
|
||||
|
||||
@ -13448,7 +13434,7 @@ int main (int argc, char **argv)
|
||||
|
||||
uint kernel_blocks_all = 0;
|
||||
|
||||
for (uint device_id = 0; device_id < devices_cnt; device_id++)
|
||||
for (uint device_id = 0; device_id < data.devices_cnt; device_id++)
|
||||
{
|
||||
/**
|
||||
* host buffer
|
||||
@ -13730,7 +13716,7 @@ int main (int argc, char **argv)
|
||||
|
||||
// we don't have sm_* on vendors not NV but it doesn't matter
|
||||
|
||||
snprintf (build_opts, sizeof (build_opts) - 1, "-I%s/ -DVENDOR_ID=%d -DCUDA_ARCH=%d -DVECT_SIZE=%u -DDEVICE_TYPE=%u", shared_dir, device_param->vendor_id, (device_param->sm_major * 100) + device_param->sm_minor, device_param->vector_width, (u32) device_param->device_type);
|
||||
snprintf (build_opts, sizeof (build_opts) - 1, "-I%s/ -DVENDOR_ID=%u -DCUDA_ARCH=%d -DVECT_SIZE=%u -DDEVICE_TYPE=%u", shared_dir, device_param->vendor_id, (device_param->sm_major * 100) + device_param->sm_minor, device_param->vector_width, (u32) device_param->device_type);
|
||||
|
||||
/**
|
||||
* main kernel
|
||||
@ -15422,7 +15408,7 @@ int main (int argc, char **argv)
|
||||
{
|
||||
hc_device_param_t *device_param = NULL;
|
||||
|
||||
for (uint device_id = 0; device_id < devices_cnt; device_id++)
|
||||
for (uint device_id = 0; device_id < data.devices_cnt; device_id++)
|
||||
{
|
||||
device_param = &data.devices_param[device_id];
|
||||
|
||||
@ -15661,7 +15647,7 @@ int main (int argc, char **argv)
|
||||
|
||||
// args
|
||||
|
||||
for (uint device_id = 0; device_id < devices_cnt; device_id++)
|
||||
for (uint device_id = 0; device_id < data.devices_cnt; device_id++)
|
||||
{
|
||||
hc_device_param_t *device_param = &data.devices_param[device_id];
|
||||
|
||||
@ -16170,7 +16156,7 @@ int main (int argc, char **argv)
|
||||
|
||||
data.bfs_cnt = sp_get_sum (0, css_cnt_r, root_css_buf);
|
||||
|
||||
for (uint device_id = 0; device_id < devices_cnt; device_id++)
|
||||
for (uint device_id = 0; device_id < data.devices_cnt; device_id++)
|
||||
{
|
||||
hc_device_param_t *device_param = &data.devices_param[device_id];
|
||||
|
||||
@ -16371,9 +16357,9 @@ int main (int argc, char **argv)
|
||||
* create cracker threads
|
||||
*/
|
||||
|
||||
hc_thread_t *c_threads = (hc_thread_t *) mycalloc (devices_cnt, sizeof (hc_thread_t));
|
||||
hc_thread_t *c_threads = (hc_thread_t *) mycalloc (data.devices_cnt, sizeof (hc_thread_t));
|
||||
|
||||
for (uint device_id = 0; device_id < devices_cnt; device_id++)
|
||||
for (uint device_id = 0; device_id < data.devices_cnt; device_id++)
|
||||
{
|
||||
hc_device_param_t *device_param = &devices_param[device_id];
|
||||
|
||||
@ -16389,7 +16375,7 @@ int main (int argc, char **argv)
|
||||
|
||||
// wait for crack threads to exit
|
||||
|
||||
hc_thread_wait (devices_cnt, c_threads);
|
||||
hc_thread_wait (data.devices_cnt, c_threads);
|
||||
|
||||
local_free (c_threads);
|
||||
|
||||
@ -16612,7 +16598,7 @@ int main (int argc, char **argv)
|
||||
if (quiet == 0) log_info ("");
|
||||
}
|
||||
|
||||
for (uint device_id = 0; device_id < devices_cnt; device_id++)
|
||||
for (uint device_id = 0; device_id < data.devices_cnt; device_id++)
|
||||
{
|
||||
hc_device_param_t *device_param = &data.devices_param[device_id];
|
||||
|
||||
|
32
src/shared.c
32
src/shared.c
@ -4235,11 +4235,35 @@ void truecrypt_crc32 (const char *filename, u8 keytab[64])
|
||||
myfree (buf);
|
||||
}
|
||||
|
||||
#ifdef OSX
|
||||
int pthread_setaffinity_np (pthread_t thread, size_t cpu_size, cpu_set_t *cpu_set)
|
||||
{
|
||||
int core;
|
||||
|
||||
for (core = 0; core < (8 * (int)cpu_size); core++)
|
||||
if (CPU_ISSET(core, cpu_set)) break;
|
||||
|
||||
thread_affinity_policy_data_t policy = { core };
|
||||
|
||||
const int rc = thread_policy_set (pthread_mach_thread_np (thread), THREAD_AFFINITY_POLICY, (thread_policy_t) &policy, 1);
|
||||
|
||||
if (data.quiet == 0)
|
||||
{
|
||||
if (rc != KERN_SUCCESS)
|
||||
{
|
||||
log_error ("ERROR: %s : %d", "thread_policy_set()", rc);
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
|
||||
void set_cpu_affinity (char *cpu_affinity)
|
||||
{
|
||||
#ifdef WIN
|
||||
DWORD_PTR aff_mask = 0;
|
||||
#elif LINUX
|
||||
#elif _POSIX
|
||||
cpu_set_t cpuset;
|
||||
CPU_ZERO (&cpuset);
|
||||
#endif
|
||||
@ -4258,7 +4282,7 @@ void set_cpu_affinity (char *cpu_affinity)
|
||||
{
|
||||
#ifdef WIN
|
||||
aff_mask = 0;
|
||||
#elif LINUX
|
||||
#elif _POSIX
|
||||
CPU_ZERO (&cpuset);
|
||||
#endif
|
||||
|
||||
@ -4274,7 +4298,7 @@ void set_cpu_affinity (char *cpu_affinity)
|
||||
|
||||
#ifdef WIN
|
||||
aff_mask |= 1 << (cpu_id - 1);
|
||||
#elif LINUX
|
||||
#elif _POSIX
|
||||
CPU_SET ((cpu_id - 1), &cpuset);
|
||||
#endif
|
||||
|
||||
@ -4286,7 +4310,7 @@ void set_cpu_affinity (char *cpu_affinity)
|
||||
#ifdef WIN
|
||||
SetProcessAffinityMask (GetCurrentProcess (), aff_mask);
|
||||
SetThreadAffinityMask (GetCurrentThread (), aff_mask);
|
||||
#elif LINUX
|
||||
#elif _POSIX
|
||||
pthread_t thread = pthread_self ();
|
||||
pthread_setaffinity_np (thread, sizeof (cpu_set_t), &cpuset);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user