My single opencl c program file is getting large and I am trying to split it into smaller files. I can successfully compile and even link some of them into library individually using "-create-library" option. But when trying to link the compiled programs according to opencl 1.2 specifications on clLinkProgram I always get error code -17, which simply means failed to link, no further information can be obtained. This happens whenever the number of programs to be linked is greater than 1.
Would anybody please tell me what I am missing?
Thanks!
Solved! Go to Solution.
Hi marty1885,
Thanks for replying.
It turns out that I made a mistake. I placed a set of constants in one of the header files and this header file was included in multiple function and kernel definition program files. this caused duplicated definitions of the constants.
But the linker would not point out that the duplication of data was the cause of the failure.
Did you pass the correct number of source code you have to clCreateProgramWithSource?
Also. Its very difficult to debug without spinets of your code. Can you provide them?
Hi marty1885,
Thanks for replying.
It turns out that I made a mistake. I placed a set of constants in one of the header files and this header file was included in multiple function and kernel definition program files. this caused duplicated definitions of the constants.
But the linker would not point out that the duplication of data was the cause of the failure.