That would get me the currently used memory, but that is not what I need: I need the peak memory requirement up to a specific point.
In the snippet above no CUDA memory is used when I print the peak requirement.