The issue is that when you have a mistake in your #define generated code, the clBuildProgram returns (1) and clGetProgramBuildInfo gives absolutely no information about that mistake.
The code which would trigger this error:
The problem was that I did not have the right memory space chosen for Picture in GetPix function, after writing code without #defines, clBuildProgram returned right error with all the information, gathered by clGetProgramBuildInfo procedure. (BTW: clGetProgramBuildInfo returns only the source code when clBuildProgram returns 1)
IMHO issue is inside #defines, when a line with #define code has an error, then OpenCL Builder has issues finding the line with an error and it returns nothing.
Try not to use #defines for error information, then correct mistakes and the code will build perfectly with no mistakes in #defines
nVidia’s OpenCL compiler showing strange behavior on my Laptop having Core2Duo with nVidia Geforce 9600M GT and running Fedora 10. If .cl file content is modified slightly (even by adding a few spaces), the compiler fails to build the program (clBuildProgram return 1). Some other trivial modification again builds the program. Can anybody help?
yes i had this same error too=> clBuildProgram returns 1
and i was using one of the cl’s from the sdk example in my code. But i was not using that junk oclLoadProgSource function to load the file into a char buffer, i was using my own fileloader using fstream.
So the problem was it was opening the cl file using ios::in flag. This causes clBuildProgram return 1.
so those of you who are using your custom fstream file loaders can try this.
use ios::in|ios::binary flags, problem solved.