SWDEV-294591 - Fix hipEventIpc failure on NV

make hipIpcOpenEventHandle has the same behavour of cudaIpcOpenEventHandle.
Add Api usages.

Change-Id: I4248b2cebd3de156f9d5d427e1797da22fb964eb
Этот коммит содержится в:
Tao Sang
2021-07-26 14:05:57 -04:00
коммит произвёл Tao Sang
родитель 5d6ed58dcb
Коммит c053d60282
2 изменённых файлов: 55 добавлений и 5 удалений
+8 -5
Просмотреть файл
@@ -24,7 +24,7 @@ THE SOFTWARE.
// forces synchronization : set
/* HIT_START
* BUILD: %t %s ../../test_common.cpp EXCLUDE_HIP_PLATFORM nvidia
* BUILD: %t %s ../../test_common.cpp
* TEST: %t --iterations 10
* HIT_END
*/
@@ -87,16 +87,19 @@ int main(int argc, char* argv[]) {
printf("\n");
}
hipIpcEventHandle_t ipc_handle;
HIPCHECK(hipIpcGetEventHandle(&ipc_handle, start));
hipEvent_t ipc_event;
HIPCHECK(hipIpcOpenEventHandle(&ipc_event, ipc_handle));
auto ret = hipIpcOpenEventHandle(&ipc_event, ipc_handle);
HIPCHECK(hipEventSynchronize(ipc_event));
if (ret == hipErrorInvalidContext) {
// tests/src/ipc/hipMultiProcIpcEvent.cpp is the right sample in different process.
printf("hipIpcOpenEventHandle() should be called in a different process\n");
} else if (ret == hipSuccess) {
// To be removed
}
HIPCHECK(hipEventDestroy(ipc_event));
HIPCHECK(hipEventDestroy(start));
HIPCHECK(hipEventDestroy(stop));