[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
This commit is contained in:
committed by
Maneesh Gupta
parent
c212c484af
commit
36977dc276
@@ -577,16 +577,11 @@ __global__ void vAdd(float* a) {}
|
|||||||
// Some wrapper macro for testing:
|
// Some wrapper macro for testing:
|
||||||
#define WRAP(...) __VA_ARGS__
|
#define WRAP(...) __VA_ARGS__
|
||||||
|
|
||||||
#include <sys/time.h>
|
#define MY_LAUNCH_MACRO(cmd, elapsed, quiet) \
|
||||||
#define GPU_PRINT_TIME(cmd, elapsed, quiet) \
|
|
||||||
do { \
|
do { \
|
||||||
struct timeval start, stop; \
|
|
||||||
float elapsed; \
|
|
||||||
gettimeofday(&start, NULL); \
|
|
||||||
hipDeviceSynchronize(); \
|
hipDeviceSynchronize(); \
|
||||||
cmd; \
|
cmd; \
|
||||||
hipDeviceSynchronize(); \
|
hipDeviceSynchronize(); \
|
||||||
gettimeofday(&stop, NULL); \
|
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
|
|
||||||
@@ -918,14 +913,14 @@ int main() {
|
|||||||
|
|
||||||
// Test: Passing hipLaunchKernelGGL inside another macro:
|
// Test: Passing hipLaunchKernelGGL inside another macro:
|
||||||
float e0;
|
float e0;
|
||||||
GPU_PRINT_TIME(hipLaunchKernelGGL(vAdd, dim3(1024),
|
MY_LAUNCH_MACRO(hipLaunchKernelGGL(vAdd, dim3(1024),
|
||||||
dim3(1), 0, 0, Ad), e0, j);
|
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);
|
dim3(1), 0, 0, Ad)), e0, j);
|
||||||
|
|
||||||
#ifdef EXTRA_PARENS_1
|
#ifdef EXTRA_PARENS_1
|
||||||
// Don't wrap hipLaunchKernelGGL in extra set of parens:
|
// 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);
|
dim3(1), 0, 0, Ad)), e0, j);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user