如何使用我现有的.cpp代码与cuda [英] how to use my existing .cpp code with cuda

查看:254
本文介绍了如何使用我现有的.cpp代码与cuda的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在c ++中的hv代码,并希望使用它与cuda.Can任何人都可以帮助我吗?我应该提供我的代码?实际上,我试着这样做,但我需要一些开始代码继续我的代码。我知道如何做简单的方形程序(使用cuda和c ++)的windows(visual studio)。它足够做我的程序的东西吗? / p>

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 proceed for my code.I know how to do simple square program (using cuda and c++)for windows(visual studio) .Is it sufficient to do the things for my program?

推荐答案

以下都是开始的好地方。 CUDA by Example是一个很好的教程,让你快速运行。大规模并行处理器的编程包括更多的背景,例如。章节关于GPU架构的历史,一般更深入。

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通过示例:通用GPU编程简介

大规模并行处理器编程:实践方法

这两个都谈到CUDA 3.x因此您需要在某个时候查看CUDA 4.x中的新功能。

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 绝对值得一看,如果你的问题映射到它很好(见上面的评论)。它是一个类似STL的容器,迭代器和算法库,它在CUDA之上实现了数据并行算法。

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.

这里有两个关于CUDA和Visual C ++入门的教程2010:

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/

NVIDIA论坛上还有一篇文章:

There's also a post on the NVIDIA forum:

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

提出非常一般我如何开始...在Stack Overflow一般不是最好的方法。通常,你会得到的最好的答复是去读一本书或手册。最好在这里提出具体问题。请不要创建重复的问题,这是没有帮助的。

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.

这篇关于如何使用我现有的.cpp代码与cuda的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆