Skip to content

Commit

Permalink
CGPU API for device kernel name
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-jr committed Mar 19, 2012
1 parent f05a319 commit eca9965
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions driver-cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@ static void cpu_detect()
cgpu->api = &cpu_api;
cgpu->deven = DEV_ENABLED;
cgpu->threads = 1;
cgpu->kname = algo_names[opt_algo];
add_cgpu(cgpu);
}
}
Expand Down
17 changes: 17 additions & 0 deletions driver-opencl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,23 @@ static bool opencl_thread_prepare(struct thr_info *thr)
}
if (name && !cgpu->name)
cgpu->name = strdup(name);
if (!cgpu->kname)
{
switch (clStates[i]->chosen_kernel) {
case KL_DIABLO:
cgpu->kname = "diablo";
break;
case KL_DIAKGCN:
cgpu->kname = "diakgcn";
break;
case KL_PHATK:
cgpu->kname = "phatk";
break;
case KL_POCLBM:
cgpu->kname = "poclbm";
default:
}
}
applog(LOG_INFO, "initCl() finished. Found %s", name);
gettimeofday(&now, NULL);
get_datestamp(cgpu->init, &now);
Expand Down
1 change: 1 addition & 0 deletions miner.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ struct cgpu_info {
int virtual_gpu;
int intensity;
bool dynamic;
char *kname;
#ifdef HAVE_OPENCL
cl_uint vwidth;
size_t work_size;
Expand Down

0 comments on commit eca9965

Please sign in to comment.