how to use my existing .cpp code with cuda

后端 未结 3 411
情书的邮戳
情书的邮戳 2020-12-10 10:09

I hv code in c++ and wanted to use it along with cuda.Can anyone please help me? Should I provide my code?? Actually I tried doing so but I need some starting code to procee

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-10 10:37

    The following are both good places to start. CUDA by Example is a good tutorial that gets you up and running pretty fast. Programming Massively Parallel Processors includes more background, e.g. chapters on the history of GPU architecture, and generally more depth.

    CUDA by Example: An Introduction to General-Purpose GPU Programming

    Programming Massively Parallel Processors: A Hands-on Approach

    These both talk about CUDA 3.x so you'll want to look at the new features in CUDA 4.x at some point.

    Thrust is definitely worth a look if your problem maps onto it well (see comment above). It's an STL-like library of containers, iterators and algorithms that implements data-parallel algorithms on top of CUDA.

    Here are two tutorials on getting started with CUDA and Visual C++ 2010:

    http://www.ademiller.com/blogs/tech/2011/03/using-cuda-and-thrust-with-visual-studio-2010/

    http://blog.cuvilib.com/2011/02/24/how-to-run-cuda-in-visual-studio-2010/

    There's also a post on the NVIDIA forum:

    http://forums.nvidia.com/index.php?showtopic=184539

    Asking very general how do I get started on ... on Stack Overflow generally isn't the best approach. Typically the best reply you'll get is "go read a book or the manual". It's much better to ask specific questions here. Please don't create duplicate questions, it isn't helpful.

提交回复
热议问题