Backport more ROCm based optimizations to HIP

This commit is contained in:
Jens Steube
2021-07-15 23:34:27 +02:00
parent 2e929e692e
commit 45e65dd05a
31 changed files with 57 additions and 56 deletions
+21 -16
View File
@@ -8339,18 +8339,6 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
device_param->has_mov64 = false;
device_param->has_prmt = false;
device_param->has_vadd = true;
device_param->has_vaddc = true;
device_param->has_vadd_co = true;
device_param->has_vaddc_co = true;
device_param->has_vsub = true;
device_param->has_vsubb = true;
device_param->has_vsub_co = true;
device_param->has_vsubb_co = true;
device_param->has_vadd3 = true;
device_param->has_vbfe = true;
device_param->has_vperm = true;
// device_available_mem
HIPcontext hip_context;
@@ -9528,7 +9516,27 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
if (backend_ctx->hip)
{
// TODO HIP
// TODO HIP?
// Maybe all devices supported by hip have these instructions guaranteed?
for (int backend_devices_cnt = 0; backend_devices_cnt < backend_ctx->backend_devices_cnt; backend_devices_cnt++)
{
hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_cnt];
if (device_param->is_hip == false) continue;
device_param->has_vadd = true;
device_param->has_vaddc = true;
device_param->has_vadd_co = true;
device_param->has_vaddc_co = true;
device_param->has_vsub = true;
device_param->has_vsubb = true;
device_param->has_vsub_co = true;
device_param->has_vsubb_co = true;
device_param->has_vadd3 = true;
device_param->has_vbfe = true;
device_param->has_vperm = true;
}
}
if (backend_ctx->ocl)
@@ -10495,9 +10503,6 @@ static bool load_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_p
//hc_asprintf (&hiprtc_options[3], "compute_%d%d", device_param->sm_major, device_param->sm_minor);
// TODO HIP
// no -offload-arch= aka --gpu-architecture because hiprtc gets native arch from hip_context
hiprtc_options[0] = "--gpu-max-threads-per-block=64";
hiprtc_options[1] = "";
hiprtc_options[2] = "";