The attached kernel code has lot of structures, which must be defined on the kernel side. PFA the build log i got from kernel analyzer.
As far as the errors you reported, i have seen such errors when there is some hidden special symbol in the kernel file, Probably creating a fresh kernel file will help.
BuildLog.txt.zip 1.1 KB
I tried fixing these issues, but still I see build failure, here is my log,
I tried installing AMD kernel Analyzer on windows, I couldn't install it.
Here is the build log
err code: -44
ERROR: Failed to build executable
--- Build log ---
Following code was complied on CPU which has 0 compute units !
I don't know why I'm getting 0 compute units, earlier before this changes, I used to get 4 !!
Also I'm trying to capture the error log from the function,
err = clBuildProgram(program,0,NULL,NULL,NULL,NULL);
printf("err code: %d\n",err);
printf("ERROR: Failed to build executable \n ");
clGetProgramBuildInfo(program,deviceid,CL_PROGRAM_BUILD_LOG, 32048, buffer , &len);
buffer = '\0';
cout<<"--- Build log ---\n "<<buffer<<endl;
But I don't see any error msgs, but still my build fails, could you please check once ?
Also is there any better way in linux to debug Opencl kernel functions ? This is very messy.
Attaching the updated files herewith
raytrace.cl.zip 2.2 KB
There must be something odd with your host code. Maybe you can try to use an SDK example to load your kernel file? When I put your .cl file as a kernel for my programs, I see all the compile errors (the first is
line 11: error:
identifier "point" is undefined
Another idea would be to printf (or cout) program, in order to see if your program correctly loaded the .cl file into memory.
And finally there's a mismatch in the devices of your clBuildProgram and clGetProgramBuildInfo calls. I'm not sure if that matters, but I use
clBuildProgram(program, 1, &devices[devnumber], ...
clGetProgramBuildInfo (program, devices[devnumber], ...
Bingo !! it is working now. I could able to compile successfully and my output matches the CUDA version ..
Thanks himanshu and Bdot for your suggestions.