mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-08 22:08:02 +00:00
opencl: rename cgpu_info->kname to cgpu_info->kernelname.
This commit is contained in:
parent
4ea508850e
commit
87801c2578
2
api.c
2
api.c
@ -2698,7 +2698,7 @@ static void devdetails(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __m
|
||||
root = api_add_string(root, "Name", cgpu->drv->name, false);
|
||||
root = api_add_int(root, "ID", &(cgpu->device_id), false);
|
||||
root = api_add_string(root, "Driver", cgpu->drv->dname, false);
|
||||
root = api_add_const(root, "Kernel", cgpu->kname ? cgpu->kname : BLANK, false);
|
||||
root = api_add_const(root, "Kernel", cgpu->kernelname ? cgpu->kernelname : BLANK, false);
|
||||
root = api_add_const(root, "Model", cgpu->name ? cgpu->name : BLANK, false);
|
||||
root = api_add_const(root, "Device Path", cgpu->device_path ? cgpu->device_path : BLANK, false);
|
||||
|
||||
|
@ -203,15 +203,15 @@ char *set_kernel(char *arg)
|
||||
if (nextptr == NULL)
|
||||
return "Invalid parameters for set kernel";
|
||||
|
||||
gpus[device++].kname = strdup(nextptr);
|
||||
gpus[device++].kernelname = strdup(nextptr);
|
||||
|
||||
while ((nextptr = strtok(NULL, ",")) != NULL)
|
||||
gpus[device++].kname = strdup(nextptr);
|
||||
gpus[device++].kernelname = strdup(nextptr);
|
||||
|
||||
/* If only one kernel name provided, use same for all GPUs. */
|
||||
if (device == 1) {
|
||||
for (i = device; i < MAX_GPUDEVICES; i++)
|
||||
gpus[i].kname = strdup(gpus[0].kname);
|
||||
gpus[i].kernelname = strdup(gpus[0].kernelname);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@ -1280,8 +1280,8 @@ static bool opencl_thread_prepare(struct thr_info *thr)
|
||||
}
|
||||
if (!cgpu->name)
|
||||
cgpu->name = strdup(name);
|
||||
if (!cgpu->kname)
|
||||
cgpu->kname = strdup("ckolivas");
|
||||
if (!cgpu->kernelname)
|
||||
cgpu->kernelname = strdup("ckolivas");
|
||||
|
||||
applog(LOG_INFO, "initCl() finished. Found %s", name);
|
||||
cgtime(&now);
|
||||
|
2
miner.h
2
miner.h
@ -462,7 +462,7 @@ struct cgpu_info {
|
||||
|
||||
int64_t max_hashes;
|
||||
|
||||
char *kname; /* Human-readable kernel name. */
|
||||
char *kernelname; /* Human-readable kernel name. */
|
||||
bool mapped;
|
||||
int virtual_gpu;
|
||||
int virtual_adl;
|
||||
|
22
ocl.c
22
ocl.c
@ -413,11 +413,19 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
|
||||
char numbuf[16];
|
||||
char strbuf[255];
|
||||
|
||||
if (strcmp(cgpu->kname, "") == 0) {
|
||||
applog(LOG_INFO, "No kernel specified, selecting kernel ckolivas");
|
||||
strcpy(cgpu->kname, "ckolivas");
|
||||
if (strcmp(cgpu->kernelname, "") == 0) {
|
||||
applog(LOG_INFO, "No kernel specified, defaulting to ckolivas");
|
||||
strcpy(cgpu->kernelname, "ckolivas");
|
||||
}
|
||||
|
||||
sprintf(strbuf, "%s.cl", cgpu->kernelname);
|
||||
strcpy(filename, strbuf);
|
||||
strcpy(binaryfilename, cgpu->kernelname);
|
||||
|
||||
/* Kernel zuikkis only supports lookup-gap 2 */
|
||||
if (strcmp(cgpu->kernelname, "zuikkis") == 0)
|
||||
cgpu->lookup_gap = 2;
|
||||
|
||||
/* For some reason 2 vectors is still better even if the card says
|
||||
* otherwise, and many cards lie about their max so use 256 as max
|
||||
* unless explicitly set on the command line. Tahiti prefers 1 */
|
||||
@ -429,14 +437,6 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
|
||||
/* All available kernels only support vector 1 */
|
||||
cgpu->vwidth = 1;
|
||||
|
||||
sprintf(strbuf, "%s.cl", cgpu->kname);
|
||||
strcpy(filename, strbuf);
|
||||
strcpy(binaryfilename, cgpu->kname);
|
||||
|
||||
/* Kernel zuikkis only supports lookup-gap 2 */
|
||||
if (strcmp(cgpu->kname, "zuikkis") == 0)
|
||||
cgpu->lookup_gap = 2;
|
||||
|
||||
/* Vectors are hard-set to 1 above. */
|
||||
if (likely(cgpu->vwidth))
|
||||
clState->vwidth = cgpu->vwidth;
|
||||
|
Loading…
Reference in New Issue
Block a user