PDA

View Full Version : What is error -5 : out of resource



Jay
05-06-2010, 06:00 PM
I have this kind of error while compiling the kernel

but I really don't find any syntex error in my code.

what shall be the problem?

error -5 : out of resource

david.garcia
05-07-2010, 03:19 PM
The problem you see is not due to a syntax error. It is happening because your kernel is consuming too many resources. What does that mean? Typically it could be local memory, but it could be other things like private memory (general-purpose registers), constants, etc.

If compilation failed, the best way to know what is the problem is looking into the program build log. Try doing something like this:



cl_char build_log;
size_t log_len;
cl_int errcode = clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG, 0, NULL, &log_len);

if(errcode) panic();

build_log = calloc(log_len + 1, sizeof(cl_char));

errcode = clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG, log_len, build_log, NULL);

if(errcode) panic();

printf("Build log: %s\n", build_log);

Jay
05-10-2010, 07:03 PM
Thanks!!!

I'll try this! have a good day! :)

Rui
05-20-2010, 06:48 AM
For example, imagine you are working with a graphics card with 512Mb of memory, and you're trying to pass to your kernel a cl_int array with size of 50000*10000. Making some calculations.. you're trying to pass it more than 1,86 gigabytes!