0
votes

Could anyone please suggest me a way to free a volatile global memory variable in 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);
}

gives an error: error: argument of type "volatile unsigned int *" is incompatible with parameter of type "void *"

1
What host compiler is this, and what are you hoping to achieve by using volatile in this context?talonmies

1 Answers

1
votes

How about something like this:

err = cudaFree((void *)d_queue_L12);