-2
是下面的代碼有效:您可以將thrust :: device_ptr傳遞給thrust :: tuple嗎?
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_vector<float>::iterator FloatIterator;
typedef thrust::tuple<FloatIterator, FloatIterator, FloatIterator> FloatIteratorTuple;
typedef thrust::zip_iterator<FloatIteratorTuple> Float3Iterator;
爲什麼不通過嘗試編譯和運行來檢查代碼的有效性? – talonmies