Hey there!
Relatively new to OpenCL (and pyOpenCL, since I use Python for all the non-parallelized computation I’m doing), but I’ve already had a lot of fun (and a fair bit of success!) using it to brute-force some research problems that haven’t yielded to traditional optimization algorithms so far.
I’ve recently run into a problem that leaves me a little perplexed, though; I’m running identical pyopencl and OpenCl script/kernel code on two separate boxes, a Macbook Pro and a Windows box. The Macbook has an ATI Radeon HD 6750M and the Windows box has an AMD Radeon HD 6670. I’ve run a number of pyopencl/OpenCL programs successfully on both laptop and desktop so far, but with my most recent coding attempt on the laptop I get the following error:
[i]pyopencl.RuntimeError: clBuildProgram failed: build program failure -
Build on <pyopencl.Device ‘ATI Radeon HD 6750M’ on ‘Apple’ at 0x1021b00>:
Undeclared function ‘_Z8__cl_powdd’ called by function ‘find_equil’[/i]
(where ‘find_equil’ is the name of my kernel)
On the desktop, the very same code runs perfectly (and is running as I write this on the laptop, in fact!), as best I can tell; certainly it compiles and runs, anyway.
From what I can tell (I think), this suggests the desktop’s AMD card has some function that I’m using whereas the laptop doesn’t; however, I’m not sure what function ‘_Z8__cl_powdd’ is, and googling for it doesn’t turn up much, no matter which underscores I leave/delete or portions of the function name I use as a partial search.
Judging by the name: I have no idea what Z8 refers to, but cl is probably just a tag dubbing this an OpenCL function; powdd seems to be the meat of the function’s name, and makes me think this is a mathematical power function (and I do use OpenCL’s built-in pow function at several points; see the code sample below, for example), and dd maybe designates it as of double type? I’m not sure what the extra d would be for, though, and I’ve already fastidiously cleansed my code of all doubles (converting them, instead, to floats), as I discovered early on that my desktop’s AMD card doesn’t support the double OpenCL extension.
Sorry for all the words! Could anyone help me in breaking down this error message?
I would be happy to post the code as well, but didn’t want to assume anyone would want to wade through it, especially as the compiler error message has no line reference, and as I’m not a programmer by trade, so I’m certain I’ve bungled proper coding convention in a number of places. Here’s an excerpt where I use the OpenCL pow function, though, in case that seems to be at the core of this problem:
float w1(float p, float A1, float K1)
{
float K_dwn = floor(K1);
float w_dwn = 1.0 - dec(K1);
float K_up = K_dwn + 1.0;
float w_up = 1.0 - w_dwn;
float w_tot = 0.0;
if(K_dwn >= 0.0)
{
float A_fac = 1.0 / (1.0 + pow(A1 - 1.0, 2.0 * K_dwn + 1.0) );
float p_fac = pow(A1 * p + 1.0 - A1, 2.0 * K_dwn + 1.0) + pow(A1 - 1.0, 2.0 * K_dwn + 1.0);
w_tot += w_dwn * A_fac * p_fac;
}
else