Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/opencl_autotune.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ static void autotune_run_extra(struct fmt_main *self, unsigned int rounds,
if (options.flags & FLG_SHOW_CHK)
return;

// FIXME add optional test-same-sizes
if (self_test_running) {
local_work_size = 7;
global_work_size = 49;
if (cpu(device_info[gpu_id]))
local_work_size = get_platform_vendor_id(platform_id) == DEV_INTEL ? 8 : 1;
else
local_work_size = get_device_max_lws(gpu_id);
global_work_size = local_work_size;
}

ocl_autotune_running = 1;
Expand Down
19 changes: 9 additions & 10 deletions src/opencl_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1099,22 +1099,21 @@ void opencl_get_user_preferences(const char *format)

void opencl_get_sane_lws_gws_values()
{
if (self_test_running) {
local_work_size = 7;
global_work_size = 49;
}

if (!local_work_size) {
if (!local_work_size || self_test_running) {
if (cpu(device_info[gpu_id]))
local_work_size =
get_platform_vendor_id(platform_id) == DEV_INTEL ?
8 : 1;
get_platform_vendor_id(platform_id) == DEV_INTEL ? 8 : 1;
else if (self_test_running)
local_work_size = get_device_max_lws(gpu_id);
else
local_work_size = 64;
local_work_size = 2 * get_device_warp_size(gpu_id);
}

if (!global_work_size)
global_work_size = 768;
if (self_test_running)
global_work_size = local_work_size;
else if (!global_work_size)
global_work_size = 12 * local_work_size;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it'd sometimes affect more than just self-test. Could be worth mentioning in the commit message?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what this code affects (not shared autotune afaik) so wouldn't know what to write. Anyway I don't think it's worth mentioning, looks like some default start value or worst case fallback.

}

char* get_device_name_(int sequential_id)
Expand Down
1 change: 1 addition & 0 deletions src/opencl_ethereum_presale_fmt_plug.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ static size_t get_task_max_work_group_size()

s = autotune_get_task_max_work_group_size(FALSE, 0, crypt_kernel);
s = MIN(s, autotune_get_task_max_work_group_size(FALSE, 0, split_kernel));
s = MIN(s, autotune_get_task_max_work_group_size(FALSE, 0, decrypt_kernel));
return s;
}

Expand Down
7 changes: 6 additions & 1 deletion src/opencl_gpg_fmt_plug.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,12 @@ static const char *warn[] = {
/* ------- Helper functions ------- */
static size_t get_task_max_work_group_size()
{
return autotune_get_task_max_work_group_size(FALSE, 0, crypt_kernel);
size_t s;

s = autotune_get_task_max_work_group_size(FALSE, 0, crypt_kernel);
s = MIN(s, autotune_get_task_max_work_group_size(FALSE, 0, crypt_kernel_sha256));
s = MIN(s, autotune_get_task_max_work_group_size(FALSE, 0, crypt_kernel_sha512));
return s;
}

static void release_clobj(void);
Expand Down