Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cuda 你能把推力::设备ptr传递给推力::元组吗?_Cuda_Thrust - Fatal编程技术网

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

的类型定义,为什么不尝试编译并运行代码来检查代码的有效性?