I have my global function call in a for loop.I also have many cudaMemcpy s and cudaMemcpyToSymbol s in the same for loop.
the kernel works really fine for the first iteration but gives a segmentation fault in the second iteration.
My doubt is that when cudaMemcpyToSymbol is used for 2nd time, it uses extra memory but does not overwrite into the same location creating an overflow leading to the segmentation fault.
i tried cudaFree but it doesnt work for constant memory.
can someone suggest a way to free the constant memory??
thanks in advance