I have allocated a linear array in global GPU memory, and am trying to get the size of its allocation with cudaGetSymbolSize().
My code is below:
cudaMemcpyFromArray(devPtr, hostPtr, 0, 0, sizei, cudaMemcpyHostToDevice);
cudaError_t er1 = cudaGetSymbolSize(&sized, devPtr);
However this always returns the error cudaErrorInvalidSymbol.
I’m not sure how I am supposed to pass in the symbol, i’ve also tried using the address of &, and also sending it as a string. No luck!
Does anybody have an idea?