[hip][cuda] Update event allocation and collection.
The existing system was not sufficient for graphs, as they can be run out of order and have different behavior for event recording.
This does not entirely solve the problem for re-use, if we ever want to simultaneously submit more than one graph at a time, but is much closer.
Just found another issue w.r.t. threading (we unfortunately do need a mutex), fix up soon.
@AWoloszyn, could you add in the description in a few words what the problem was and how you solved it? It will pick up that as a commit message when it gets merged.
BTW, it would be nice that in the future to use merge instead of rebase + force push--it's easier to see where the last review was up to and only check the newly added stuff. (I can still largely tell from the commit history but we don't have GitHub review mechansims showing the difff "since last review".) :D
We do, but force pushing breaks it. I think merging also breaks it though :P
ha, interesting. didn't know we have that! will try out next time :)