STL,iostream的,新的,删除C / C ++的CUDA [英] STL, iostream, new, delete in C/C++ for CUDA

查看:249
本文介绍了STL,iostream的,新的,删除C / C ++的CUDA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用STL,iostream的,新的,删除C / C ++为CUDA?

Can I use STL,iostream,new, delete in C/C++ for CUDA?

推荐答案

如果您有费米级GPU(使计算能力> = 2.0),并使用CUDA 4.0或更高版本,那么这两个删除可用的编缉是在设备code使用。 STL容器和算法的iostream不支持。

If you have a Fermi class GPU (so compute capability >=2.0), and are using CUDA 4.0 or later, then both new and delete are avialable for use in device code. STL containers and algorithms and iostream are not supported.

如果你想使用STL像与CUDA运算,你可能有兴趣在推力模板库。它允许主机code键用的容器类型与GPU透明交互并实现了许多非常有用的数据并行原语,如排序,还原,并进行扫描。请注意,这仍然是一个主机端装置,推力及其容器不能自己的内核code内部使用。

If you want to use "STL like" operations with CUDA, you might be interested in the Thrust template library. It allows host code to transparently interact with the GPU using container types and implements a number of very useful data parallel primitives, like sorting, reduction, and scan. Note that this is still a host side apparatus, Thrust and its containers cannot be used inside your own kernel code.

这篇关于STL,iostream的,新的,删除C / C ++的CUDA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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