From eacee18c37a28b4c6c20ff279b24c7cbfca29cb8 Mon Sep 17 00:00:00 2001 From: amd-lthakur <46560939+amd-lthakur@users.noreply.github.com> Date: Fri, 9 Aug 2019 17:20:10 +0530 Subject: [PATCH] [dtests] Fix build issues with hipLaunchParm.cpp on windows (#1293) * Removed unwanted #include sys/time.h , gettimeofday() and timeval variables and this also helps avavoid compilation error in windows due to gettimeofday() call equivalent of which is not available in windows * Changed the Macro name from GPU_PRINT_TIME to MY_LAUNCH_MACRO [ROCm/hip commit: e94c0592de58b6f01423598689daf1b48dd97f18] --- projects/hip/tests/src/kernel/hipLaunchParm.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/projects/hip/tests/src/kernel/hipLaunchParm.cpp b/projects/hip/tests/src/kernel/hipLaunchParm.cpp index 772ddc1032..23742d7d6c 100644 --- a/projects/hip/tests/src/kernel/hipLaunchParm.cpp +++ b/projects/hip/tests/src/kernel/hipLaunchParm.cpp @@ -577,16 +577,11 @@ __global__ void vAdd(float* a) {} // Some wrapper macro for testing: #define WRAP(...) __VA_ARGS__ -#include -#define GPU_PRINT_TIME(cmd, elapsed, quiet) \ +#define MY_LAUNCH_MACRO(cmd, elapsed, quiet) \ do { \ - struct timeval start, stop; \ - float elapsed; \ - gettimeofday(&start, NULL); \ hipDeviceSynchronize(); \ cmd; \ hipDeviceSynchronize(); \ - gettimeofday(&stop, NULL); \ } while (0); @@ -918,14 +913,14 @@ int main() { // Test: Passing hipLaunchKernelGGL inside another macro: float e0; - GPU_PRINT_TIME(hipLaunchKernelGGL(vAdd, dim3(1024), + MY_LAUNCH_MACRO(hipLaunchKernelGGL(vAdd, dim3(1024), dim3(1), 0, 0, Ad), e0, j); - GPU_PRINT_TIME(WRAP(hipLaunchKernelGGL(vAdd, dim3(1024), + MY_LAUNCH_MACRO(WRAP(hipLaunchKernelGGL(vAdd, dim3(1024), dim3(1), 0, 0, Ad)), e0, j); #ifdef EXTRA_PARENS_1 // Don't wrap hipLaunchKernelGGL in extra set of parens: - GPU_PRINT_TIME((hipLaunchKernelGGL(vAdd, dim3(1024), + MY_LAUNCH_MACRO((hipLaunchKernelGGL(vAdd, dim3(1024), dim3(1), 0, 0, Ad)), e0, j); #endif