Hi All,
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:
int devPtr;
…
cudaMalloc((void*)&devPtr, sizei);
cudaMemcpyFromArray(devPtr, hostPtr, 0, 0, sizei, cudaMemcpyHostToDevice);
size_t sized;
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?
Thank you.