Hi Charles, On 05/26/2015 06:01 PM, Charles Determan wrote: > Thank for all of your responses. If I may trouble you for one further > related question, are there any examples of compiling a CUDA backend > program? > > For example, a cpp file > > main.cpp > #define VIENNA_WITH_CUDA // if I read the docs correctly > #include "viennacl/vector.hpp" > > // my awesome gpu code > > > How would I compile this program? I can see the examples in the docs > about using cmake but what about a single file. I am trying to > understand the cmake files (not very familiar myself) but I can't seem > to sort out where nvcc comes in to play with these headers as opposed to > normal, brute-force CUDA whereby nvcc would be used on the .cu file and > then linked to the main program with g++.
The following minimum example should work: $> nvcc main.cu -I/path/to/viennacl Note that it is essential to use the file ending .cu so that NVCC transforms all the CUDA code correctly. For simplicity I recommend working with main.cpp as usual and only create a symbolic link main.cu pointing to main.cpp. Best regards, Karli ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ ViennaCL-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/viennacl-devel
