@@ -105,7 +105,7 @@ void HbmReadBwKernel(const void* __restrict pSrcBuffer,
105105
106106 // Update min/max start times
107107 __syncthreads ();
108- if (threadIdx.x == 0 ) {
108+ if (threadIdx.x == 0 && minStartCycle != NULL ) {
109109 int64_t stopTime = GetTimestamp ();
110110 atomicMin (minStartCycle, startTime);
111111 atomicMax (maxStopCycle, stopTime);
@@ -473,13 +473,15 @@ int HbmBandwidthPreset(EnvVars& ev,
473473 if (!useWallClock) {
474474 HIP_CALL (hipEventRecord (startEvent, stream));
475475 }
476- kernel<<<gridDim, blockDim, 0 , stream>>>(inputBuffers[currBufferIdx++], NULL , numSteps, minStartCycle, maxStopCycle);
476+ kernel<<<gridDim, blockDim, 0 , stream>>>(inputBuffers[currBufferIdx++], NULL , numSteps,
477+ useWallClock ? minStartCycle : NULL , maxStopCycle);
477478 if (!useWallClock) {
478479 HIP_CALL (hipEventRecord (stopEvent, stream));
479480 }
480481#else
481482 hipExtLaunchKernelGGL (kernel, gridDim, blockDim, 0 , stream, useWallClock ? NULL : startEvent, useWallClock ? NULL : stopEvent, 0 ,
482- inputBuffers[currBufferIdx], nullptr , numSteps, minStartCycle, maxStopCycle);
483+ inputBuffers[currBufferIdx], nullptr , numSteps,
484+ useWallClock ? minStartCycle : NULL , maxStopCycle);
483485#endif
484486 HIP_CALL (hipStreamSynchronize (stream));
485487 if (currBufferIdx == numBuffers) currBufferIdx = 0 ;
0 commit comments