Move more stuff to status_ctx_t
This commit is contained in:
+40
-40
@@ -117,14 +117,14 @@ void hc_signal (BOOL WINAPI (callback) (DWORD))
|
||||
|
||||
void sigHandler_default (int sig)
|
||||
{
|
||||
myabort (data.opencl_ctx);
|
||||
myabort (data.status_ctx);
|
||||
|
||||
signal (sig, NULL);
|
||||
}
|
||||
|
||||
void sigHandler_benchmark (int sig)
|
||||
{
|
||||
myquit (data.opencl_ctx);
|
||||
myquit (data.status_ctx);
|
||||
|
||||
signal (sig, NULL);
|
||||
}
|
||||
@@ -140,74 +140,74 @@ void hc_signal (void (callback) (int))
|
||||
|
||||
#endif
|
||||
|
||||
void mycracked (opencl_ctx_t *opencl_ctx)
|
||||
void mycracked (status_ctx_t *status_ctx)
|
||||
{
|
||||
if (opencl_ctx->devices_status != STATUS_RUNNING) return;
|
||||
if (status_ctx->devices_status != STATUS_RUNNING) return;
|
||||
|
||||
opencl_ctx->devices_status = STATUS_CRACKED;
|
||||
status_ctx->devices_status = STATUS_CRACKED;
|
||||
|
||||
opencl_ctx->run_main_level1 = false;
|
||||
opencl_ctx->run_main_level2 = false;
|
||||
opencl_ctx->run_main_level3 = false;
|
||||
opencl_ctx->run_thread_level1 = false;
|
||||
opencl_ctx->run_thread_level2 = false;
|
||||
status_ctx->run_main_level1 = false;
|
||||
status_ctx->run_main_level2 = false;
|
||||
status_ctx->run_main_level3 = false;
|
||||
status_ctx->run_thread_level1 = false;
|
||||
status_ctx->run_thread_level2 = false;
|
||||
}
|
||||
|
||||
void myabort (opencl_ctx_t *opencl_ctx)
|
||||
void myabort (status_ctx_t *status_ctx)
|
||||
{
|
||||
if (opencl_ctx->devices_status != STATUS_RUNNING) return;
|
||||
if (status_ctx->devices_status != STATUS_RUNNING) return;
|
||||
|
||||
opencl_ctx->devices_status = STATUS_ABORTED;
|
||||
status_ctx->devices_status = STATUS_ABORTED;
|
||||
|
||||
opencl_ctx->run_main_level1 = false;
|
||||
opencl_ctx->run_main_level2 = false;
|
||||
opencl_ctx->run_main_level3 = false;
|
||||
opencl_ctx->run_thread_level1 = false;
|
||||
opencl_ctx->run_thread_level2 = false;
|
||||
status_ctx->run_main_level1 = false;
|
||||
status_ctx->run_main_level2 = false;
|
||||
status_ctx->run_main_level3 = false;
|
||||
status_ctx->run_thread_level1 = false;
|
||||
status_ctx->run_thread_level2 = false;
|
||||
}
|
||||
|
||||
void myquit (opencl_ctx_t *opencl_ctx)
|
||||
void myquit (status_ctx_t *status_ctx)
|
||||
{
|
||||
if (opencl_ctx->devices_status != STATUS_RUNNING) return;
|
||||
if (status_ctx->devices_status != STATUS_RUNNING) return;
|
||||
|
||||
opencl_ctx->devices_status = STATUS_QUIT;
|
||||
status_ctx->devices_status = STATUS_QUIT;
|
||||
|
||||
opencl_ctx->run_main_level1 = false;
|
||||
opencl_ctx->run_main_level2 = false;
|
||||
opencl_ctx->run_main_level3 = false;
|
||||
opencl_ctx->run_thread_level1 = false;
|
||||
opencl_ctx->run_thread_level2 = false;
|
||||
status_ctx->run_main_level1 = false;
|
||||
status_ctx->run_main_level2 = false;
|
||||
status_ctx->run_main_level3 = false;
|
||||
status_ctx->run_thread_level1 = false;
|
||||
status_ctx->run_thread_level2 = false;
|
||||
}
|
||||
|
||||
void bypass (opencl_ctx_t *opencl_ctx)
|
||||
void bypass (status_ctx_t *status_ctx)
|
||||
{
|
||||
if (opencl_ctx->devices_status != STATUS_RUNNING) return;
|
||||
if (status_ctx->devices_status != STATUS_RUNNING) return;
|
||||
|
||||
opencl_ctx->devices_status = STATUS_BYPASS;
|
||||
status_ctx->devices_status = STATUS_BYPASS;
|
||||
|
||||
opencl_ctx->run_main_level1 = true;
|
||||
opencl_ctx->run_main_level2 = true;
|
||||
opencl_ctx->run_main_level3 = true;
|
||||
opencl_ctx->run_thread_level1 = false;
|
||||
opencl_ctx->run_thread_level2 = false;
|
||||
status_ctx->run_main_level1 = true;
|
||||
status_ctx->run_main_level2 = true;
|
||||
status_ctx->run_main_level3 = true;
|
||||
status_ctx->run_thread_level1 = false;
|
||||
status_ctx->run_thread_level2 = false;
|
||||
|
||||
log_info ("Next dictionary / mask in queue selected, bypassing current one");
|
||||
}
|
||||
|
||||
void SuspendThreads (opencl_ctx_t *opencl_ctx)
|
||||
void SuspendThreads (status_ctx_t *status_ctx)
|
||||
{
|
||||
if (opencl_ctx->devices_status != STATUS_RUNNING) return;
|
||||
if (status_ctx->devices_status != STATUS_RUNNING) return;
|
||||
|
||||
hc_timer_set (&data.timer_paused);
|
||||
|
||||
opencl_ctx->devices_status = STATUS_PAUSED;
|
||||
status_ctx->devices_status = STATUS_PAUSED;
|
||||
|
||||
log_info ("Paused");
|
||||
}
|
||||
|
||||
void ResumeThreads (opencl_ctx_t *opencl_ctx)
|
||||
void ResumeThreads (status_ctx_t *status_ctx)
|
||||
{
|
||||
if (opencl_ctx->devices_status != STATUS_PAUSED) return;
|
||||
if (status_ctx->devices_status != STATUS_PAUSED) return;
|
||||
|
||||
double ms_paused;
|
||||
|
||||
@@ -215,7 +215,7 @@ void ResumeThreads (opencl_ctx_t *opencl_ctx)
|
||||
|
||||
data.ms_paused += ms_paused;
|
||||
|
||||
opencl_ctx->devices_status = STATUS_RUNNING;
|
||||
status_ctx->devices_status = STATUS_RUNNING;
|
||||
|
||||
log_info ("Resumed");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user