Invalid device symbol when copying to CUDA constant memory

后端 未结 1 1721
轮回少年
轮回少年 2021-01-19 05:33

I have several files for an app in image processing. As the number of rows and colums for an image does not change while doing some image processing algorithm I was trying t

1条回答
  •  轮回少年
    2021-01-19 06:37

    If your symbol is declared like this:

    __constant__ int c_rows;
    

    then the correct call to cudaMemcpyToSymbol is just

    int rows = 5;
    cudaMemcpyToSymbol(c_rows, &rows, sizeof(int)));
    

    0 讨论(0)
提交回复
热议问题