Cuda 你能把推力::设备ptr传递给推力::元组吗?
以下代码是否有效:Cuda 你能把推力::设备ptr传递给推力::元组吗?,cuda,thrust,Cuda,Thrust,以下代码是否有效: typedef thrust::device_ptr<int> IntIterator; typedef thrust::device_ptr<float> FloatIterator; typedef thrust::tuple<IntIterator,FloatIterator> IteratorTuple; typedef thrust::zip_iterator<IteratorTuple> myZipIterator;
typedef thrust::device_ptr<int> IntIterator;
typedef thrust::device_ptr<float> FloatIterator;
typedef thrust::tuple<IntIterator,FloatIterator> IteratorTuple;
typedef thrust::zip_iterator<IteratorTuple> myZipIterator;
typedef推力::装置\u ptr定时器;
typedef推力::设备\u ptr浮点迭代器;
typedef推力::元组迭代器元组;
typedef推力::zip_迭代器myZipIterator;
我知道下面是正确的,但在上述情况下,我们使用的是指针:
typedef thrust::device_vector<float>::iterator FloatIterator;
typedef thrust::tuple<FloatIterator, FloatIterator, FloatIterator> FloatIteratorTuple;
typedef thrust::zip_iterator<FloatIteratorTuple> Float3Iterator;
typedef推力::设备向量::迭代器浮点迭代器;
typedef推力::元组floatIterator元组;
typedef推力::zip_迭代器Float3Iterator;
是的,你可以,而且它可以工作。此外,在阅读编译器错误消息时,我猜asch::device\u vector::iterator
是asch::device\u ptr
的类型定义,为什么不尝试编译并运行代码来检查代码的有效性?