CUDA易挥发

时间:2014-03-19 04:40:34

标签: cuda

有人可以建议我在CUDA中释放一个易变的全局内存变量......

volatile unsigned *d_queue_L12;
err = cudaMalloc((void **)&d_queue_L12, CORES*MAX_12*Cache_Sets_L2*sizeof(volatile unsigned));
if (err != cudaSuccess)
{
    fprintf(stderr, "Failed to allocate space to L12 QUEUE vector (error code %s)!\n",     cudaGetErrorString(err));
    exit(EXIT_FAILURE);
}

err = cudaFree(d_queue_L12);
if (err != cudaSuccess)
{
    fprintf(stderr, "Failed to free L2 FLAG COUNT vector (error code %s)!\n", cudaGetErrorString(err));
    exit(EXIT_FAILURE);
}

给出错误: error:类型为“volatile unsigned int *”的参数与“void *”

类型的参数不兼容

1 个答案:

答案 0 :(得分:1)

这样的事情怎么样:

err = cudaFree((void *)d_queue_L12);