2014-03-07 46 views
-1

我工作的CUDA作爲一個初學者的時候,我試圖執行一個預先編寫的代碼編譯提供了錯誤CUDPPHandle的每次使用...例如錯誤使用CUDPPHandle

void HPGMST() 
{ 
    //Reinitialize the ranking arrays, must be orig but this also works 

    CUDA_SAFE_CALL(cudaMemcpy(d_vertex_split_rank, h_vertex_split_rank_test, sizeof(unsigned long long int)*no_of_vertices, cudaMemcpyHostToDevice)); 

    CUDA_SAFE_CALL(cudaMemcpy(d_edge_rank, h_edge_rank_test, sizeof(unsigned long long int)*no_of_edges, cudaMemcpyHostToDevice)); 





    //Make both grids needed for execution, no_of_vertices and no_of_edges length sizes 

    int num_of_blocks, num_of_threads_per_block; 

    SetGridThreadLen(no_of_edges, &num_of_blocks, &num_of_threads_per_block); 

    dim3 grid_edgelen(num_of_blocks, 1, 1); 

    dim3 threads_edgelen(num_of_threads_per_block, 1, 1); 

    SetGridThreadLen(no_of_vertices, &num_of_blocks, &num_of_threads_per_block); 

    dim3 grid_vertexlen(num_of_blocks, 1, 1); 

    dim3 threads_vertexlen(num_of_threads_per_block, 1, 1); 





    //Append the Weight and Outgoing vertex into a single array, 8-10 bits for weight and 20-22 bits for vertex ID 

    //Append in Parallel on the Device itself, call the append kernel 

    AppendKernel_1<<< grid_edgelen, threads_edgelen, 0>>>(d_segmented_min_scan_input, d_weight, d_edge, no_of_edges); 



    //Create the Flag needed for segmented min scan operation, similar operation will also be used at other places 

    ClearArray<<< grid_edgelen, threads_edgelen, 0>>>(d_edge_flag, no_of_edges); 



    //Mark the segments for the segmented min scan using scan 

    MakeFlag_3<<< grid_vertexlen, threads_vertexlen, 0>>>(d_edge_flag, d_vertex, no_of_vertices); 



    //Perfom the Segmented Min Scan on resulting array using d_edge_flag as segments 

    cudppPlan(&segmentedScanPlan_min, config_segmented_min, no_of_edges, 1, 0); //Make the segmented min scan plan 

給人的follwing錯誤在最後一行

  1. 類型的變量「CUDPPHandle *」是與類型的參數「CUDPPHandle」不相容
  2. 從「CUDPPConfiguration」到「CUDP沒有合適的轉換函數PHandle *」存在
  3. 沒有合適的構造存在,從轉換爲‘int’到‘CUDPPConfiguration’
  4. 在函數調用的參數太少

我使用‘NVCC -arch sm_20’彙編關於特斯拉C2075 好心幫....

回答

1

的問題是正確的,在您發佈的錯誤文本:

在函數調用

參數太少

您的代碼只提供5個參數。可以看出here,cudppPlan函數需要6個參數。看起來你錯過了調用的第一個參數。

+0

如果你看看這個[鏈接](http://cudpp.github.io/cudpp/1.1.1/group__public_interface.html#ga0d39e7c3e14963c7cc3df3b879362c25)cudppPlan有5個參數...我想這在版本上有所不同。你能幫我把它與以前的版本兼容 –

+0

代碼是用cudpp 1.1.1編寫的,但是現在我用的是cudpp 2.0 –