mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-20 13:11:34 +08:00

Include files are now grouped and sorted in following order: 1. Header file of the class the current file implements 2. Project files 3. Third party files 4. Standard library Change-Id: If31af05652184169f7fee1d7ad08f1b2ed602cf0 Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
46 lines
933 B
C++
46 lines
933 B
C++
/*
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include "runtime/utilities/timer_util.h"
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
#include <stdint.h>
|
|
|
|
extern const char *perfLogPath;
|
|
extern long long refTime;
|
|
void setReferenceTime();
|
|
|
|
bool getTestRatio(uint64_t hash, double &ratio);
|
|
|
|
bool saveTestRatio(uint64_t hash, double ratio);
|
|
|
|
bool isInRange(double data, double reference, double rangePercentage);
|
|
bool isLowerThanReference(double data, double reference, double rangePercentage);
|
|
|
|
bool updateTestRatio(uint64_t hash, double ratio);
|
|
|
|
template <typename T>
|
|
T majorityVote(T time1, T time2, T time3) {
|
|
T minTime1 = 0;
|
|
T minTime2 = 0;
|
|
|
|
if (time1 < time2) {
|
|
minTime1 = time1;
|
|
minTime2 = time2;
|
|
} else {
|
|
minTime1 = time2;
|
|
minTime2 = time1;
|
|
}
|
|
|
|
if (minTime2 > time3)
|
|
minTime2 = time3;
|
|
|
|
return (minTime1 + minTime2) / 2;
|
|
}
|