Do I need to free constant memory assigned using cudaMemcpyToSymbol?
cuda
Solution
No, you don't. According to NVIDIA cuda library:
cudaFree (void *devPtr) Frees the memory space pointed to by devPtr, which must have been returned by a previous call to cudaMalloc() or cudaMallocPitch() [...]
Problem
I am pretty sure the answer is no, but I just wanted to make sure as I don't want memory leaks. I am using the following code ``` __constant__ void* VERTEX_NO_CONSTANT_PARAMETER; HANDLE_ERROR( cudaMemcpyToSymbol( VERTEX_NO_CONSTANT_PARAMETER, &vertexNo, sizeof( int ) ) ); HANDLE_ERROR( cudaFree( VERTEX_NO_CONSTANT_PARAMETER ) ); ``` It does not throw any errors at me which is putting doubt in my mind (I was hoping that cudaFree would error). Thank you! Kevin