if (res3 != 0) return (res3);
- const int res4 = t1->workload_profile
- - t2->workload_profile;
-
- if (res4 != 0) return (res4);
-
return 0;
}
tuning_db->alias_cnt++;
}
- else if (token_cnt == 7)
+ else if (token_cnt == 6)
{
if ((token_ptr[1][0] != '0') &&
(token_ptr[1][0] != '1') &&
if ((token_ptr[3][0] != '1') &&
(token_ptr[3][0] != '2') &&
- (token_ptr[3][0] != '3') &&
- (token_ptr[3][0] != '*'))
- {
- log_info ("WARNING: Tuning-db: Invalid workload_profile '%c' in Line '%u'", token_ptr[3][0], line_num);
-
- continue;
- }
-
- if ((token_ptr[4][0] != '1') &&
- (token_ptr[4][0] != '2') &&
- (token_ptr[4][0] != '4') &&
- (token_ptr[4][0] != '8') &&
- (token_ptr[4][0] != 'N'))
+ (token_ptr[3][0] != '4') &&
+ (token_ptr[3][0] != '8') &&
+ (token_ptr[3][0] != 'N'))
{
- log_info ("WARNING: Tuning-db: Invalid vector_width '%c' in Line '%u'", token_ptr[4][0], line_num);
+ log_info ("WARNING: Tuning-db: Invalid vector_width '%c' in Line '%u'", token_ptr[3][0], line_num);
continue;
}
int attack_mode = -1;
int hash_type = -1;
- int workload_profile = -1;
int vector_width = -1;
int kernel_accel = -1;
int kernel_loops = -1;
if (token_ptr[1][0] != '*') attack_mode = atoi (token_ptr[1]);
if (token_ptr[2][0] != '*') hash_type = atoi (token_ptr[2]);
- if (token_ptr[3][0] != '*') workload_profile = atoi (token_ptr[3]);
- if (token_ptr[4][0] != 'N') vector_width = atoi (token_ptr[4]);
+ if (token_ptr[3][0] != 'N') vector_width = atoi (token_ptr[3]);
- kernel_accel = atoi (token_ptr[5]);
+ kernel_accel = atoi (token_ptr[4]);
if ((kernel_accel < 1) || (kernel_accel > 1024))
{
continue;
}
- kernel_loops = atoi (token_ptr[6]);
+ kernel_loops = atoi (token_ptr[5]);
if ((kernel_loops < 1) || (kernel_loops > 1024))
{
entry->device_name = mystrdup (device_name);
entry->attack_mode = attack_mode;
entry->hash_type = hash_type;
- entry->workload_profile = workload_profile;
entry->vector_width = vector_width;
entry->kernel_accel = kernel_accel;
entry->kernel_loops = kernel_loops;
return tuning_db;
}
-tuning_db_entry_t *tuning_db_search (tuning_db_t *tuning_db, char *device_name, int attack_mode, int hash_type, int workload_profile)
+tuning_db_entry_t *tuning_db_search (tuning_db_t *tuning_db, char *device_name, int attack_mode, int hash_type)
{
static tuning_db_entry_t s;
// bsearch is not ideal but fast enough
- s.device_name = device_name_nospace;
- s.attack_mode = attack_mode;
- s.hash_type = hash_type;
- s.workload_profile = workload_profile;
+ s.device_name = device_name_nospace;
+ s.attack_mode = attack_mode;
+ s.hash_type = hash_type;
tuning_db_entry_t *entry = NULL;
- // this will produce all 2^4 combinations required
+ // this will produce all 2^3 combinations required
- for (i = 0; i < 16; i++)
+ for (i = 0; i < 8; i++)
{
- s.device_name = (i & 1) ? "*" : device_name_nospace;
- s.attack_mode = (i & 2) ? -1 : attack_mode;
- s.hash_type = (i & 4) ? -1 : hash_type;
- s.workload_profile = (i & 8) ? -1 : workload_profile;
+ s.device_name = (i & 1) ? "*" : device_name_nospace;
+ s.attack_mode = (i & 2) ? -1 : attack_mode;
+ s.hash_type = (i & 4) ? -1 : hash_type;
entry = bsearch (&s, tuning_db->entry_buf, tuning_db->entry_cnt, sizeof (tuning_db_entry_t), sort_by_tuning_db_entry);