2
我是新來的Thrust。我試圖從thrust::host_vector
複製到thrust::device_vector
,這兩個類型都是我已經實現的類型Sequence
。thrust :: device_vector error
但是我做了一個錯誤「無效的設備功能」。 我使用的是一塊GeForce GT 540
thrust::host_vector <Sequence> Ind_Tabel_V;
void Ind_Table_Filling()
{
//some Code
Sequence s;
// some code
Ind_Tabel_V.push_back(s);
try
{
thrust::device_vector<Sequence> d_vec=Ind_Tabel_V;
}
catch (thrust::system_error &e)
{
std::cerr << "Error accessing vector element: " << e.what() << std::endl;
}
}
誰能幫助請CUDA 4.0 VS2010?
代碼看起來沒問題。我認爲錯誤是在你的代碼中的其他地方。確保您在調用上述代碼之前檢查您所做的每個CUDA調用的返回。 – 2012-03-15 00:41:43
你能提供'class Sequence'的定義嗎? – harrism 2012-03-15 01:20:17