bench: minor api update, for consistency

BMK_benchTimedFn()
BMK_isCompleted_TimedFn() uses TimedFnState
This commit is contained in:
Yann Collet
2018-08-26 21:30:18 -07:00
parent c3a4baaf6e
commit 01dcd0fd17
4 changed files with 43 additions and 40 deletions
+2 -2
View File
@@ -521,7 +521,7 @@ static size_t benchMem(U32 benchNb,
for (;;) {
void* const dstBuffv = dstBuff;
BMK_runOutcome_t const bOutcome =
BMK_benchFunctionTimed( tfs,
BMK_benchTimedFn( tfs,
benchFunction, buff2,
NULL, NULL, /* initFn */
1, /* blockCount */
@@ -544,7 +544,7 @@ static size_t benchMem(U32 benchNb,
(unsigned)newResult.sumOfReturn );
}
if ( BMK_isCompleted_runOutcome(bOutcome) ) break;
if ( BMK_isCompleted_TimedFn(tfs) ) break;
}
BMK_freeTimedFnState(tfs);
}
+4 -4
View File
@@ -1441,7 +1441,7 @@ BMK_benchMemInvertible( buffers_t buf, contexts_t ctx,
dctxprep.dictBufferSize = dictBufferSize;
while(!compressionCompleted) {
BMK_runOutcome_t const cOutcome = BMK_benchFunctionTimed(timeStateCompress,
BMK_runOutcome_t const cOutcome = BMK_benchTimedFn(timeStateCompress,
&local_defaultCompress, cctx,
&local_initCCtx, &cctxprep,
nbBlocks,
@@ -1461,11 +1461,11 @@ BMK_benchMemInvertible( buffers_t buf, contexts_t ctx,
bResult.cSpeed = (srcSize * TIMELOOP_NANOSEC) / rResult.nanoSecPerRun;
bResult.cSize = rResult.sumOfReturn;
}
compressionCompleted = BMK_isCompleted_runOutcome(cOutcome);
compressionCompleted = BMK_isCompleted_TimedFn(timeStateCompress);
}
while (!decompressionCompleted) {
BMK_runOutcome_t const dOutcome = BMK_benchFunctionTimed(timeStateDecompress,
BMK_runOutcome_t const dOutcome = BMK_benchTimedFn(timeStateDecompress,
&local_defaultDecompress, dctx,
&local_initDCtx, &dctxprep,
nbBlocks,
@@ -1484,7 +1484,7 @@ BMK_benchMemInvertible( buffers_t buf, contexts_t ctx,
{ BMK_runTime_t const rResult = BMK_extract_runTime(dOutcome);
bResult.dSpeed = (srcSize * TIMELOOP_NANOSEC) / rResult.nanoSecPerRun;
}
decompressionCompleted = BMK_isCompleted_runOutcome(dOutcome);
decompressionCompleted = BMK_isCompleted_TimedFn(timeStateDecompress);
}
BMK_freeTimedFnState(timeStateCompress);