cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

lpeng2
Journeyman III

opencl linking error

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!

0 Likes
1 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.

View solution in original post

0 Likes
2 Replies
marty1885
Adept II

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?

0 Likes

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.

0 Likes