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:
parent
8b50b60484
commit
8baf705f6a
@ -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;
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user