mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +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>
103 lines
2.9 KiB
C++
103 lines
2.9 KiB
C++
/*
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "gmock/gmock.h"
|
|
#include "gtest/gtest.h"
|
|
#include "instrumentation.h"
|
|
|
|
using namespace OCLRT;
|
|
|
|
struct InstrumentationTest : public ::testing::Test {
|
|
InstrumentationTest() {}
|
|
};
|
|
|
|
TEST(InstrumentationTest, instrAutoSamplingStart) {
|
|
InstrEscCbData cbData = {0};
|
|
void **ppOAInterface = nullptr;
|
|
instrAutoSamplingStart(cbData, ppOAInterface);
|
|
}
|
|
|
|
TEST(InstrumentationTest, instrAutoSamplingStop) {
|
|
void **ppOAInterface = nullptr;
|
|
instrAutoSamplingStop(ppOAInterface);
|
|
}
|
|
|
|
TEST(InstrumentationTest, instrCheckPmRegsCfg) {
|
|
InstrPmRegsCfg *pQueryPmRegsCfg = nullptr;
|
|
uint32_t *pLastPmRegsCfgHandle = nullptr;
|
|
const void *pASInterface = nullptr;
|
|
instrCheckPmRegsCfg(pQueryPmRegsCfg, pLastPmRegsCfgHandle, pASInterface);
|
|
InstrPmRegsCfg cfg;
|
|
instrCheckPmRegsCfg(&cfg, pLastPmRegsCfgHandle, pASInterface);
|
|
}
|
|
|
|
TEST(InstrumentationTest, instrGetPerfCountersQueryData) {
|
|
InstrEscCbData cbData = {0};
|
|
GTDI_QUERY *pData = nullptr;
|
|
HwPerfCounters *pLayout = nullptr;
|
|
uint64_t cpuRawTimestamp = 0;
|
|
void *pASInterface = nullptr;
|
|
InstrPmRegsCfg *pPmRegsCfg = nullptr;
|
|
bool useMiRPC = false;
|
|
bool resetASData = false;
|
|
const InstrAllowedContexts *pAllowedContexts = nullptr;
|
|
instrGetPerfCountersQueryData(cbData, pData, pLayout, cpuRawTimestamp, pASInterface, pPmRegsCfg, useMiRPC, resetASData, pAllowedContexts);
|
|
}
|
|
|
|
TEST(InstrumentationTest, instrEscGetPmRegsCfg) {
|
|
InstrEscCbData cbData = {0};
|
|
uint32_t cfgId = 0;
|
|
InstrPmRegsCfg *pCfg = nullptr;
|
|
InstrAutoSamplingMode *pAutoSampling = nullptr;
|
|
instrEscGetPmRegsCfg(cbData, cfgId, pCfg, pAutoSampling);
|
|
}
|
|
|
|
TEST(InstrumentationTest, instrEscHwMetricsEnable) {
|
|
InstrEscCbData cbData = {0};
|
|
bool enable = false;
|
|
instrEscHwMetricsEnable(cbData, enable);
|
|
}
|
|
|
|
TEST(InstrumentationTest, instrEscLoadPmRegsCfg) {
|
|
InstrEscCbData cbData = {0};
|
|
InstrPmRegsCfg *pCfg = nullptr;
|
|
bool hardwareAccess = false;
|
|
instrEscLoadPmRegsCfg(cbData, pCfg, hardwareAccess);
|
|
}
|
|
|
|
TEST(InstrumentationTest, instrEscSetPmRegsCfg) {
|
|
InstrEscCbData cbData = {0};
|
|
uint32_t count = 0;
|
|
uint32_t *pOffsets = nullptr;
|
|
uint32_t *pValues = nullptr;
|
|
instrEscSetPmRegsCfg(cbData, count, pOffsets, pValues);
|
|
}
|
|
|
|
TEST(InstrumentationTest, instrEscSendReadRegsCfg) {
|
|
InstrEscCbData cbData = {0};
|
|
uint32_t count = 0;
|
|
uint32_t *pOffsets = nullptr;
|
|
uint32_t *pBitSizes = nullptr;
|
|
instrEscSendReadRegsCfg(cbData, count, pOffsets, pBitSizes);
|
|
}
|
|
|
|
TEST(InstrumentationTest, instrSetAvailable) {
|
|
bool enabled = false;
|
|
instrSetAvailable(enabled);
|
|
}
|
|
|
|
TEST(InstrumentationTest, instrEscVerifyEnable) {
|
|
InstrEscCbData cbData = {0};
|
|
instrEscVerifyEnable(cbData);
|
|
}
|
|
|
|
TEST(InstrumentationTest, instrSetPlatformInfo) {
|
|
uint32_t productId = 0;
|
|
void *pSkuTable = nullptr;
|
|
instrSetPlatformInfo(productId, pSkuTable);
|
|
}
|