Is it possible to get the size of allocated memory buffer by pointer?
All I found are cudaPointerGetAttributes function and cudaPointerAttributes structure, but latter has no field size or something useful to define the size.
Yes. cuMemGetAddressRange() from the Driver API allows you to retrieve base address and size for any device pointer from a CUDA allocation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With