1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-07-25 16:08:39 +00:00

Preparation for distinguish between OpenCL device types at runtime (mostly for HMS)

This commit is contained in:
jsteube 2016-01-04 20:12:34 +01:00
parent 8b50b60484
commit 8baf705f6a
2 changed files with 98 additions and 92 deletions

View File

@ -879,6 +879,7 @@ struct __hc_device_param
char *driver_version;
cl_device_id device;
cl_device_type device_type;
cl_kernel kernel1;
cl_kernel kernel12;

View File

@ -12722,6 +12722,12 @@ int main (int argc, char **argv)
device_param->device = device;
cl_device_type device_type = 0;
hc_clGetDeviceInfo (device, CL_DEVICE_TYPE, sizeof (device_type), &device_type, NULL);
device_param->device_type = device_type;
cl_uint max_compute_units = 0;
hc_clGetDeviceInfo (device, CL_DEVICE_MAX_COMPUTE_UNITS, sizeof (max_compute_units), &max_compute_units, NULL);
@ -12758,6 +12764,15 @@ int main (int argc, char **argv)
device_param->driver_version = mystrdup (tmp);
if (device_type == CL_DEVICE_TYPE_CPU)
{
cl_uint gpu_processor_cores = 1;
device_param->gpu_processor_cores = gpu_processor_cores;
}
if (device_type == CL_DEVICE_TYPE_GPU)
{
if (vendor_id == VENDOR_ID_AMD)
{
cl_uint gpu_processor_cores = 0;
@ -12799,25 +12814,14 @@ int main (int argc, char **argv)
device_param->sm_minor = sm_minor;
device_param->sm_major = sm_major;
}
if (vendor_id == VENDOR_ID_POCL)
{
cl_uint gpu_processor_cores = 1;
device_param->gpu_processor_cores = gpu_processor_cores;
}
if (vendor_id == VENDOR_ID_UNKNOWN)
{
cl_uint gpu_processor_cores = 1;
device_param->gpu_processor_cores = gpu_processor_cores;
}
/**
* common driver check
*/
if (device_type == CL_DEVICE_TYPE_GPU)
{
if (vendor_id == VENDOR_ID_NV)
{
if (device_param->kernel_exec_timeout != 0)
@ -12875,6 +12879,7 @@ int main (int argc, char **argv)
}
}
}
}
/*
* Temporary fix: