From 469ffecc71fba2a238117e99dbdf0af5e6f2edc9 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Wed, 31 Jan 2018 10:48:17 +0530 Subject: [PATCH] hipStreamAddCallback.cpp: Replace unistd sleep with sleep_for Change-Id: I7a5d40a1acd8be76a0f175bcfa731ad89fb88d81 [ROCm/clr commit: 3aab52d7ccc37146a82642b03d0395c387bc2aa8] --- .../tests/src/runtimeApi/stream/hipStreamAddCallback.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/projects/clr/hipamd/tests/src/runtimeApi/stream/hipStreamAddCallback.cpp b/projects/clr/hipamd/tests/src/runtimeApi/stream/hipStreamAddCallback.cpp index 0f9f32a253..02912e14c6 100644 --- a/projects/clr/hipamd/tests/src/runtimeApi/stream/hipStreamAddCallback.cpp +++ b/projects/clr/hipamd/tests/src/runtimeApi/stream/hipStreamAddCallback.cpp @@ -18,13 +18,14 @@ THE SOFTWARE. */ /* HIT_START - * BUILD: %t %s ../../test_common.cpp + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 * RUN: %t * HIT_END */ #include -#include +#include +#include #include "hip/hip_runtime.h" #include "test_common.h" @@ -87,5 +88,6 @@ int main(int argc, char *argv[]) HIPCHECK(hipMemcpyAsync(C_h, C_d, Nbytes, hipMemcpyDeviceToHost, mystream)); HIPCHECK(hipStreamAddCallback(mystream, Callback, NULL, 0)); - while(!cbDone) sleep(1); + while(!cbDone) + std::this_thread::sleep_for(std::chrono::milliseconds(10)); }