-1

我正在以初学者的身份从事 CUDA 工作,并试图执行预先编写的代码,编译时每次使用 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

在最后一行给出以下错误:

  1. “CUDPPHandle *”类型的参数与“CUDPPHandle”类型的参数不兼容
  2. 不存在从“CUDPPConfiguration”到“CUDPPHandle *”的合适转换函数
  3. 不存在合适的构造函数来将“int”转换为“CUDPPConfiguration”
  4. 函数调用中的参数太少

我正在使用“nvcc -arch sm_20”在 tesla C2075 上编译,请帮助....

4

1 回答 1

1

问题就在您发布的错误文本中:

函数调用中的参数太少

您的代码仅提供 5 个参数。从这里可以看出,cudppPlan 函数需要 6 个参数。看起来您缺少调用的第一个参数。

于 2014-03-07T10:27:22.680 回答