SWDEV-272088 - Fix runtimeApi/event/hipEventElapsedTime issue
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
This commit is contained in:
@@ -61,14 +61,14 @@ void NegativeTests(){
|
|||||||
hipEvent_t start;
|
hipEvent_t start;
|
||||||
HIPCHECK(hipEventCreate(&start));
|
HIPCHECK(hipEventCreate(&start));
|
||||||
|
|
||||||
|
HIPCHECK(hipEventRecord(start, nullptr));
|
||||||
|
HIPCHECK(hipEventSynchronize(start));
|
||||||
|
|
||||||
// create event on dev=1
|
// create event on dev=1
|
||||||
HIPCHECK(hipSetDevice(1));
|
HIPCHECK(hipSetDevice(1));
|
||||||
hipEvent_t stop;
|
hipEvent_t stop;
|
||||||
HIPCHECK(hipEventCreate(&stop));
|
HIPCHECK(hipEventCreate(&stop));
|
||||||
|
|
||||||
HIPCHECK(hipEventRecord(start, nullptr));
|
|
||||||
HIPCHECK(hipEventSynchronize(start));
|
|
||||||
|
|
||||||
HIPCHECK(hipEventRecord(stop, nullptr));
|
HIPCHECK(hipEventRecord(stop, nullptr));
|
||||||
HIPCHECK(hipEventSynchronize(stop));
|
HIPCHECK(hipEventSynchronize(stop));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user