From 5f549b62e8ff9746199c922245c8c0ad2cbd67ae Mon Sep 17 00:00:00 2001
From: foreman
Date: Tue, 1 May 2018 19:01:10 -0400
Subject: [PATCH] P4 to Git Change 1548560 by skudchad@skudchad_rocm on
2018/05/01 18:53:54
SWDEV-145570 - [HIP] - Fix hipDeviceSynchronize.
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/hip/hip_device_runtime.cpp#8 edit
---
api/hip/hip_device_runtime.cpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/api/hip/hip_device_runtime.cpp b/api/hip/hip_device_runtime.cpp
index 77d90d2cb0..c7a4d4913d 100644
--- a/api/hip/hip_device_runtime.cpp
+++ b/api/hip/hip_device_runtime.cpp
@@ -375,6 +375,13 @@ hipError_t hipDeviceSetSharedMemConfig ( hipSharedMemConfig config ) {
}
hipError_t hipDeviceSynchronize ( void ) {
+ amd::HostQueue* queue = hip::getNullStream();
+
+ if (!queue) {
+ return hipErrorOutOfMemory;
+ }
+
+ queue->finish();
return hipSuccess;
}