2012-05-04 48 views
1

我試圖執行一些示例代碼從推力快速入門指南。它粘貼在下面。什麼是殺我是,當我運行它時,我得到一個異常拋出「R6010 -abort()被稱爲)每當我打我find_ifnvidia cuda推力abort()呼籲find_if

我試過這個使用4.1和4.2運行時間我在Visual Studio 2010 Ultimate中使用最新的NSight發佈候選版本(2012年5月4日下載)構建了這個版本,我的圖形卡是NVidia NVS 3100m。新的VS項目(不使用推力)和它的作品沒關係。增加推力但給了我這個古怪。

任何建議表示讚賞。

MJ

thrust::device_vector<int> input(4); 

input[0] = 0; 
input[1] = 5; 
input[2] = 3; 
input[3] = 7; 

thrust::device_vector<int>::iterator iter; 

iter = thrust::find_if(input.begin(), input.end(), greater_than_four()); 
iter = thrust::find_if(input.begin(), input.end(), greater_than_ten()); 

EDIT1

另一個信息珍聞。我正深入挖掘並看到在cudaThreadSynchronize()期間發現錯誤。該消息是「launch_closure_by_value」。

回答

1

我想通了。 __host____device__標籤丟失。

struct greater_than_four 
{ 
__host__ __device__ 
    bool operator()(int x) 
    { 
     return x > 4; 
    } 
}; 
+0

你可以提供一些更多的細節。問題出在哪裏? – nouveau

+0

你看到第三行? 「__主機__ __設備__」。這就是缺少的。下劃線和文本之間不應有空格。 –