CGPU API for device kernel name
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
diff --git a/driver-cpu.c b/driver-cpu.c
index 69c112e..c6d0df7 100644
--- a/driver-cpu.c
+++ b/driver-cpu.c
@@ -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);
}
}
diff --git a/driver-opencl.c b/driver-opencl.c
index 95139c3..0cecc66 100644
--- a/driver-opencl.c
+++ b/driver-opencl.c
@@ -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);
diff --git a/miner.h b/miner.h
index 071ad0b..25343e7 100644
--- a/miner.h
+++ b/miner.h
@@ -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;