From 8af2365e6e27b87a2a565f21a8b28c38f2faa6f4 Mon Sep 17 00:00:00 2001 From: ckolivas Date: Fri, 10 Feb 2012 10:23:06 +1100 Subject: [PATCH] Allow different kernels to be used by different devices and fix the logic fail of overcorrecting on last commit with !strstr. --- ocl.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ocl.c b/ocl.c index a456b0c4..17aa882f 100644 --- a/ocl.c +++ b/ocl.c @@ -356,20 +356,22 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize) * have otherwise created. The filename is: * name + kernelname +/i bitalign + v + vectors + w + work_size + sizeof(long) + .bin */ + enum cl_kernel this_kernel; char binaryfilename[255]; - char numbuf[10]; char filename[16]; + char numbuf[10]; if (chosen_kernel == KL_NONE) { - if (!strstr(name, "Tahiti")) - chosen_kernel = KL_DIAKGCN; + if (strstr(name, "Tahiti")) + this_kernel = KL_DIAKGCN; else if (!clState->hasBitAlign) - chosen_kernel = KL_POCLBM; + this_kernel = KL_POCLBM; else - chosen_kernel = KL_PHATK; - } + this_kernel = KL_PHATK; + } else + this_kernel = chosen_kernel; - switch (chosen_kernel) { + switch (this_kernel) { case KL_DIAKGCN: strcpy(filename, DIAKGCN_KERNNAME".cl"); strcpy(binaryfilename, DIAKGCN_KERNNAME);