[profiling] API For profiling backend memory events (#80350)
Summary:
Adding new API call
```
mobile::getCurrentEdgeProfiler()->recordBackendMemoryEvent(
ptr, alloc_size, total_allocated, total_reserved, device);
```
As well as another macro to use for recording backend memory events. These memory events will be captured in the trace file when we create the profiler:
```
{
KinetoEdgeCPUProfiler profiler(
module,
trace_file_name,
false, // record input_shapes
true, // profile memory
true, // record callstack
false, // record flops
true); // record module hierarchy
module.forward(inputs);
}
```
Test Plan: Testing to do in the next diff
Differential Revision: D37116111
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80350
Approved by: https://github.com/kimishpatel