【问题标题】:CUDA volatile freeCUDA 无挥发性
【发布时间】:2014-03-19 04:40:33
【问题描述】:

谁能给我建议一种在 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);
}

给出一个错误: 错误:“volatile unsigned int *”类型的参数与“void *”类型的参数不兼容

【问题讨论】:

  • 这是什么主机编译器,您希望在这种情况下使用 volatile 实现什么目标?

标签: cuda


【解决方案1】:

这样的事情怎么样:

err = cudaFree((void *)d_queue_L12);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-03-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-26
    相关资源
    最近更新 更多