SWDEV-273943 - Enable runtimeApi.event dtest

Add device_id_ in hip::event to match cuda behaviour in
hipEventQuery() and hipEventRecord().
Enable hipEventElapsedTime test on AMD platform.
Workarround sporadic crash of hipEventIpc test due to
some bug of event ipc.
Add missing hipEventDestroy() in some event tests.
Fix some logic code errors.
Fix typo in comment.

Change-Id: I9ec74c475161b3e31df48d193449023e921f2924


[ROCm/hip commit: 38b0c952a6]
Ta zmiana jest zawarta w:
Tao Sang authored and Tao Sang committed 2021-03-16 17:12:08 -04:00
1 rodzic bde082af6e
złożenie 15519dd555
9 plików zmienionych
+69 -14

Żadne pliki nie pasują do Twojego wyszukiwania

+14 -3
Wyświetl plik
@@ -78,7 +78,7 @@ int main(int argc, char* argv[]) {
float eventMs = 1.0f;
// should fail
// should fail due to hipEventDisableTiming
HIPASSERT(hipSuccess != hipEventElapsedTime(&eventMs, start, stop));
float hostMs = HipTest::elapsed_time(hostStart, hostStop);
@@ -97,16 +97,27 @@ int main(int argc, char* argv[]) {
HIPCHECK(hipEventSynchronize(ipc_event));
HIPCHECK(hipEventDestroy(ipc_event));
#ifndef __HIP_PLATFORM_AMD__
HIPCHECK(hipEventDestroy(start));
HIPCHECK(hipEventDestroy(stop));
#endif
HIPCHECK(hipMemcpy(C_h, C_d, Nbytes, hipMemcpyDeviceToHost));
printf("check:\n");
#ifdef __HIP_PLATFORM_AMD__
// Due to implementation bug of hipEventInterprocess, as a workaround,
// we have to move hipEventDestroy here. Otherwise sporadic crash will
// happen in above hipMemcpy(). If hipEventInterprocess is officially
// implemented, we should revisit here and move these back to match cuda
// event behavior.
HIPCHECK(hipEventDestroy(start));
HIPCHECK(hipEventDestroy(stop));
#endif
HipTest::checkVectorADD(A_h, B_h, C_h, N, true);
passed();
}