runtimeApi/event/hipEventElapsedTime will report invalid resource error on cuda due to wrong calling sequence. The fix will arrange the calling in right sequence. Change-Id: I3db28a962888566ea135e3cbdefa68d373e2d369