Menu

How to mix cu and cpp file together

p ding
2017-08-10
2017-08-10
  • p ding

    p ding - 2017-08-10

    Dear ViennaCL group:
    I have a serial CFD code written with C++. I want to invoke the ViennaCL solver in my projects.
    But it seems i can not mix cpp and cu file together.
    Could you please give me some suggestions.
    Regards
    Your Sincerely
    Ding

     
  • Karl Rupp

    Karl Rupp - 2017-08-10

    Hi Ding,

    you need to make sure that all parts of your application that use CUDA code are compiled through nvcc and and in .cu. One possible way of doing this is to either rename your .cpp file(s), or to create a symbolic link filename.cu to the original source file filename.cpp. This is a disadvantage of the CUDA model that one has to work around.

    Best regards,
    Karli

     

Log in to post a comment.