NVidia推力装置_弦矢量
NVidia Thrust device_vector of strings
我开始使用作为CUDA 4.0工具包一部分的英伟达Thrust库,并希望在深入挖掘之前进行验证。我可以执行以下操作,并且在构建过程中没有问题:
thrust::host_vector <int> iVec;
thrust::device_vector <int> iVec2;
thrust::host_vector <std::string> sVec;
当我尝试以下操作时,我会得到一个编译错误:
thrust::device_vector <std::string> sVec2;
我想知道的是,我是否可以假设我可以在STL矢量中使用的任何数据类型都应该在推力矢量中可用,无论它是设备还是主机?或者这里有局限性,我不应该期望它起作用?
我得到的错误如下:
c: \program files\nvidia gpu计算工具包\cuda\v4.0\include\thrust\detail\device\cuda\\for_each.inl(93):错误C2027:使用未定义的类型"thrust::detail::STATIC_ASSERTION_FAILURE"1> 与1>[1> x=错误1> ]1> c:\program files\nvidia gpu计算工具包\cuda\v4.0\include\thrust\detail\device\dispatch\for_each.h(56):参见正在编译的函数模板实例化"RandomAccessIterator thrust::detail::device::cuda::for_each_n(RandomAccess Iterator,Size,UnaryFunction)"的参考1> 与1>[1> RandomAccessIterator=推力::detail::normal_iterator>,1> 大小=__w64 int,1> UnaryFunction=thrust::detail::device_destroy_functor1> ]1> c:\program files\nvidia gpu计算工具包\cuda\v4.0\include\thrust\detail\device\for_each.inl(43):请参阅正在编译的函数模板实例化"RandomAccessIterator thrust::detail::device::dispatch::for_each_n(RandomAccess Iterator,Size,UnaryFunction,thrust:::detail:::cuda_device_space_tag)"1> 与1>[1> RandomAccessIterator=推力::detail::normal_iterator>,1> OutputIterator=推力::detail::normal_iterator>,1> 大小=__w64 int,1> UnaryFunction=thrust::detail::device_destroy_functor1> ]1> c:\program files\nvidia gpu计算工具包\cuda\v4.0\include\thrust\detail\device\for_each.inl(54):请参阅正在编译的函数模板实例化'OutputIterator thrust::detail::device::for_each_n(OutputItator,Size,UnaryFunction)'的参考1> 与1>[1> OutputIterator=推力::detail::normal_iterator>,1> InputIterator=thrust::detail::normal_iterator>,1> UnaryFunction=推力::detail::device_destroy_functor,1> 大小=__w64 int1> ]1> c:\program files\nvidia gpu计算工具包\cuda\v4.0\include\thrust\detail\dispatch\for_each(72):请参阅正在编译的函数模板实例化"InputIterator thrust::detail::device::for_each"1> 与1>[1> InputIterator=thrust::detail::normal_iterator>,1> UnaryFunction=thrust::detail::device_destroy_functor1> ]1> c:\program files\nvidia gpu计算工具包\cuda\v4.0\include\thrust\detail\for_each.inl(51):请参阅正在编译的函数模板实例化"InputIterator thrust::detail::dispatch::for_each(InputIterater,InputIterato,UnaryFunction,thrust:::device_space_tag)"的参考1> 与1>[1> InputIterator=thrust::detail::normal_iterator>,1> UnaryFunction=thrust::detail::device_destroy_functor1> ]1> c:\program files\nvidia gpu计算工具包\cuda\v4.0\include\thrust\detail\for_each.inl(67):请参阅正在编译的函数模板实例化"InputIterator thrust::detail::for_each(InputIterater,InputIterato,UnaryFunction)"的参考1> 与1>[1> InputIterator=thrust::detail::normal_iterator>,1> UnaryFunction=thrust::detail::device_destroy_functor1> ]1> c:\program files\nvidia gpu计算工具包\cuda\v4.0\include\thrust\detail\dispatch\ddestroy.h(59):请参阅正在编译的函数模板实例化'void thrust::for_each>(InputIterator,InputIterater,UnaryFunction)'的参考1> 与1>[1> ForwardIterator=推力::detail::normal_iterator>,1> T=value_type,1> InputIterator=thrust::detail::normal_iterator>,1> UnaryFunction=thrust::detail::device_destroy_functor1> ]1> c:\program files\nvidia gpu计算工具包\cuda\v4.0\include\thrust\detail\destroy.h(42):请参阅正在编译的函数模板实例化'void thrust::detail::dispatch::destroy(ForwardIterator,ForwardItator,thrust:::detail:::false _type)'的参考1> 与1>[1> ForwardIterator=推力::detail::normal_iterator>1>]1> c:\program files\nvidia gpu计算工具包\cuda\v4.0\include\thrust\detail\vector_base.inl(442):请参阅正在编译的函数模板实例化"void thrust::detail::destroy>(ForwardIterator,ForwardItator)"的参考1> 与1>[1> 指针=推力::device_ptr,1> ForwardIterator=推力::detail::normal_iterator>1>]1> c:\program files\nvidia gpu计算工具包\cuda\v4.0\include\thrust\detail\vector_base.inl(440):编译类模板成员函数'thrust::detail::vector_bbase::~vector_base(void)'时1> 与1>[1> T=std::字符串,1> Alloc=推力::device_malloc_allocater1> ]1> c:\program files\nvidia gpu计算工具包\cuda\v4.0\include\thrust\device_vector.h(55):请参阅正在编译的类模板实例化'thrust::detail::vector_base'的参考1> 与1>[1> T=std::字符串,1> Alloc=推力::device_malloc_allocater1> ]1> c:\users\fsquared\mydata\didata\main.cpp(119):请参阅对正在编译的类模板实例化'thrust::device_vector'的引用1> 与1>[1> T=std::字符串1> ]==========生成:0成功,1失败,0最新,0跳过==========
我在这里使用MSCV 2010。
CUDA不支持设备代码中的标准C++容器类型,它基本上仅限于C++POD类型。您可以定义自己的类以在GPU上使用,但构造函数和成员函数必须定义为CUDA__device__
函数,并且设备代码中支持的语言功能仍有许多限制。
- 在 NVIDIA GEFORCE GTX 1050 上下载适用于 Windows 10 的 openCL 1.2
- glGetBufferSubData 和 glMapBufferRange 在 NVIDIA GTX960M 上GL_S
- OpenCL 在 NVIDIA 和 Intel GPU 上启动内核时CL_INVALID_COMMAND_QUEUE
- 使 C++ Pi 近似在 GPU Nvidia 970M CUDA 上的 Paralell 中运行
- 使用 NVIDIA GPU 在 Cygwin 中链接 OpenCL 库时遇到问题
- 我可以为nVIDIA GPU编写OpenCL-C++内核吗
- cudaMallocManaged with vector<complex<long double> > C++ - NVIDIA CUDA
- 在W10下为NVidia使用VS2019构建计算cpp-sdk的任何特殊步骤
- 如何找到 NVIDIA OpenGL 驱动程序的错误 ID 名称?
- 与NVIDIA链接的错误GCC版本
- Nvidia optimus NvOptimusEnablement
- 如何创建NVIDIA OPENCL项目
- 我可以以某种方式使我的矢量/数组动态更改装置数量吗?
- 使用 Nvidia NPP 调整图像大小时未记录的大小调整错误
- OpenMP卸载到Nvidia错误还原
- X11和NVIDIA驱动程序的奇怪EGL行为
- 包含 Nvidia 的 nvapi.h 导致编译错误
- 我应该将哪个 opengl 库与 nvidia 显卡一起使用
- Nvidia TX2上的Windows应用程序
- NVidia推力装置_弦矢量