cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

nyanthiss
Adept I

kernel compilation fail

Hi,

I have this configuration:

Dev: Tahiti Pro
OS: RHEL 6.3
APP SDK: 2.7
Catalyst 8.982
OpenCL 1.2 AMD-APP (938.2)

And i've found that this kernel


kernel void
test2 (global float *in, global float *out)
{
  int x = get_global_id(0);
  int xx = get_local_id(0);
  local float a[32*32];
  local float b[32*32*8];
  float4 input = vload4(x, in);
  b = length(input);
  float4 res = sin(input);
  a = length(res);
  vstore4(res, x, out);
}

fails to compile with the message:

calclCompile failedError: Creating kernel test2 failed!

Now, if i change the locals to:


  local float a[32*32*4];
  local float b[32*32*4];

Then it works, which suggests the build fails b/c local mem limit of 32kb.

Two questions:

Thanks

0 Likes
4 Replies

While the device has 64KB, only half of it is available to a single kernel.

Thanks.

What about the unhelpful error message ? can you reproduce it ?

0 Likes

OK,

i found the answer myself. With fglrx 9.00 it seems the message is now much better:

Error in kernel:
Error:E012:Insufficient Local Resources!  
0 Likes
yurtesen
Miniboss

Yes, you can get build log  CL_PROGRAM_BUILD_LOG , it often has exciting information even if the kernel compiles, for example register spilling etc.

http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/clGetProgramBuildInfo.html

Also you can replace the error code with a more meaningful text. There is a list of error codes in CL/cl.h,  You could perhaps copy the getOpenCLErrorCodeStr function from SDKCommon.cpp from the SDK.

0 Likes