使用CUDPPHandle时出错

时间:2014-03-07 09:46:07

标签: cuda nvcc cudpp

我正在以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. 函数调用中的参数太少
  5. 我正在使用'nvcc -arch sm_20'在tesla C2075上编译 请帮助......

1 个答案:

答案 0 :(得分:1)

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

  

函数调用中的参数太少

您的代码仅提供5个参数。可以看出here,cudppPlan函数需要6个参数。看起来你错过了电话的第一个参数。