2012-12-22 41 views
-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; 
+0

爲什麼不通過嘗試編譯和運行來檢查代碼的有效性? – talonmies

回答

1

是的,你可以和它的作品Your previous question。此外,閱讀編譯器錯誤消息,我猜thrust::device_vector<type>::iteratorthrust::device_ptr<type>的typedef。

相關問題