|
|
|
@ -5116,7 +5116,7 @@ uint setup_opencl_platforms_filter (char *opencl_platforms)
|
|
|
|
|
{
|
|
|
|
|
int platform = atoi (next);
|
|
|
|
|
|
|
|
|
|
if (platform < 1 || platform > 31)
|
|
|
|
|
if (platform < 1 || platform > 32)
|
|
|
|
|
{
|
|
|
|
|
log_error ("ERROR: invalid OpenCL platform %u specified", platform);
|
|
|
|
|
|
|
|
|
@ -5137,73 +5137,77 @@ uint setup_opencl_platforms_filter (char *opencl_platforms)
|
|
|
|
|
return opencl_platforms_filter;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cl_device_type setup_device_types_filter (char *opencl_device_types)
|
|
|
|
|
u32 setup_devices_filter (char *opencl_devices)
|
|
|
|
|
{
|
|
|
|
|
cl_device_type device_types_filter = 0;
|
|
|
|
|
u32 devices_filter = 0;
|
|
|
|
|
|
|
|
|
|
if (opencl_device_types)
|
|
|
|
|
if (opencl_devices)
|
|
|
|
|
{
|
|
|
|
|
char *device_types = strdup (opencl_device_types);
|
|
|
|
|
char *devices = strdup (opencl_devices);
|
|
|
|
|
|
|
|
|
|
char *next = strtok (device_types, ",");
|
|
|
|
|
char *next = strtok (devices, ",");
|
|
|
|
|
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
int device_type = atoi (next);
|
|
|
|
|
int device_id = atoi (next);
|
|
|
|
|
|
|
|
|
|
if (device_type < 1 || device_type > 3)
|
|
|
|
|
if (device_id < 1 || device_id > 32)
|
|
|
|
|
{
|
|
|
|
|
log_error ("ERROR: invalid device_type %u specified", device_type);
|
|
|
|
|
log_error ("ERROR: invalid device_id %u specified", device_id);
|
|
|
|
|
|
|
|
|
|
exit (-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
device_types_filter |= 1 << device_type;
|
|
|
|
|
devices_filter |= 1 << (device_id - 1);
|
|
|
|
|
|
|
|
|
|
} while ((next = strtok (NULL, ",")) != NULL);
|
|
|
|
|
|
|
|
|
|
free (device_types);
|
|
|
|
|
free (devices);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Do not use CPU by default, this often reduces GPU performance because
|
|
|
|
|
// the CPU is to busy to handle GPU synchronization
|
|
|
|
|
|
|
|
|
|
device_types_filter = CL_DEVICE_TYPE_ALL & ~CL_DEVICE_TYPE_CPU;
|
|
|
|
|
devices_filter = -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return device_types_filter;
|
|
|
|
|
return devices_filter;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint devices_to_devicemask (char *opencl_devices)
|
|
|
|
|
cl_device_type setup_device_types_filter (char *opencl_device_types)
|
|
|
|
|
{
|
|
|
|
|
uint opencl_devicemask = 0;
|
|
|
|
|
cl_device_type device_types_filter = 0;
|
|
|
|
|
|
|
|
|
|
if (opencl_devices)
|
|
|
|
|
if (opencl_device_types)
|
|
|
|
|
{
|
|
|
|
|
char *devices = strdup (opencl_devices);
|
|
|
|
|
char *device_types = strdup (opencl_device_types);
|
|
|
|
|
|
|
|
|
|
char *next = strtok (devices, ",");
|
|
|
|
|
char *next = strtok (device_types, ",");
|
|
|
|
|
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
uint device_id = atoi (next);
|
|
|
|
|
int device_type = atoi (next);
|
|
|
|
|
|
|
|
|
|
if (device_id < 1 || device_id > 8)
|
|
|
|
|
if (device_type < 1 || device_type > 3)
|
|
|
|
|
{
|
|
|
|
|
log_error ("ERROR: invalid device_id %u specified", device_id);
|
|
|
|
|
log_error ("ERROR: invalid device_type %u specified", device_type);
|
|
|
|
|
|
|
|
|
|
exit (-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
opencl_devicemask |= 1 << (device_id - 1);
|
|
|
|
|
device_types_filter |= 1 << device_type;
|
|
|
|
|
|
|
|
|
|
} while ((next = strtok (NULL, ",")) != NULL);
|
|
|
|
|
|
|
|
|
|
free (devices);
|
|
|
|
|
free (device_types);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Do not use CPU by default, this often reduces GPU performance because
|
|
|
|
|
// the CPU is to busy to handle GPU synchronization
|
|
|
|
|
|
|
|
|
|
return opencl_devicemask;
|
|
|
|
|
device_types_filter = CL_DEVICE_TYPE_ALL & ~CL_DEVICE_TYPE_CPU;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return device_types_filter;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
u32 get_random_num (const u32 min, const u32 max)
|
|
|
|
@ -8859,6 +8863,8 @@ u64 get_lowest_words_done ()
|
|
|
|
|
{
|
|
|
|
|
hc_device_param_t *device_param = &data.devices_param[device_id];
|
|
|
|
|
|
|
|
|
|
if (device_param->skipped) continue;
|
|
|
|
|
|
|
|
|
|
const u64 words_done = device_param->words_done;
|
|
|
|
|
|
|
|
|
|
if (words_done < words_cur) words_cur = words_done;
|
|
|
|
|