From 792415f960dc07a9051f2dfc0cab988e2f7e028e Mon Sep 17 00:00:00 2001 From: Tao Sang Date: Thu, 3 Jun 2021 17:01:56 -0400 Subject: [PATCH] SWDEV-287768 - Fix hipTestClock test Use long long instead of int as clock64() return. Change-Id: Id3e4645c05959e13f58efd88bc43f3a1d3e50d59 --- tests/src/deviceLib/hipTestClock.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/src/deviceLib/hipTestClock.cpp b/tests/src/deviceLib/hipTestClock.cpp index b5bb5d9a05..d3661b67ea 100644 --- a/tests/src/deviceLib/hipTestClock.cpp +++ b/tests/src/deviceLib/hipTestClock.cpp @@ -31,21 +31,21 @@ THE SOFTWARE. #define HIP_ASSERT(status) assert(status == hipSuccess) #define LEN 512 -#define SIZE 2048 +#define SIZE (LEN * sizeof(long long)) - static __global__ void kernel1(int* Ad) { + static __global__ void kernel1(long long* Ad) { int tid = threadIdx.x + blockIdx.x * blockDim.x; Ad[tid] = clock() + clock64() + __clock() + __clock64(); } - static __global__ void kernel2(int* Ad) { + static __global__ void kernel2(long long* Ad) { int tid = threadIdx.x + blockIdx.x * blockDim.x; Ad[tid] = clock() + clock64() + __clock() + __clock64() - Ad[tid]; } void run() { - int *A, *Ad; - A = new int[LEN]; + long long *A, *Ad; + A = new long long[LEN]; for (unsigned i = 0; i < LEN; i++) { A[i] = 0; }