mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
TimerResolution Device Properties 1.2
Signed-off-by: John Falkowski <john.falkowski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
dc9b2351d5
commit
dc77174255
@@ -413,10 +413,11 @@ ze_result_t DeviceImp::getProperties(ze_device_properties_t *pDeviceProperties)
|
||||
|
||||
pDeviceProperties->numSlices = hardwareInfo.gtSystemInfo.SliceCount * ((this->numSubDevices > 0) ? this->numSubDevices : 1);
|
||||
|
||||
if (NEO::DebugManager.flags.UseCyclesPerSecondTimer.get() == 0) {
|
||||
pDeviceProperties->timerResolution = this->neoDevice->getDeviceInfo().outProfilingTimerResolution;
|
||||
} else {
|
||||
if ((NEO::DebugManager.flags.UseCyclesPerSecondTimer.get() == 1) ||
|
||||
(pDeviceProperties->stype == ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES_1_2)) {
|
||||
pDeviceProperties->timerResolution = this->neoDevice->getDeviceInfo().outProfilingTimerClock;
|
||||
} else {
|
||||
pDeviceProperties->timerResolution = this->neoDevice->getDeviceInfo().outProfilingTimerResolution;
|
||||
}
|
||||
|
||||
pDeviceProperties->timestampValidBits = hardwareInfo.capabilityTable.timestampValidBits;
|
||||
|
||||
@@ -250,7 +250,8 @@ bool testKernelTimestampHostQuery(ze_context_handle_t &context,
|
||||
}
|
||||
|
||||
bool testKernelTimestampApendQuery(ze_context_handle_t &context,
|
||||
ze_device_handle_t &device) {
|
||||
ze_device_handle_t &device,
|
||||
ze_device_properties_t devProperties) {
|
||||
|
||||
ze_command_queue_handle_t cmdQueue;
|
||||
ze_command_list_handle_t cmdList;
|
||||
@@ -332,20 +333,29 @@ bool testKernelTimestampApendQuery(ze_context_handle_t &context,
|
||||
|
||||
ze_kernel_timestamp_result_t *kernelTsResults = reinterpret_cast<ze_kernel_timestamp_result_t *>(timestampBuffer);
|
||||
|
||||
ze_device_properties_t devProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &devProperties));
|
||||
|
||||
uint64_t timerResolution = devProperties.timerResolution;
|
||||
uint64_t kernelDuration = kernelTsResults->context.kernelEnd - kernelTsResults->context.kernelStart;
|
||||
std::cout << "Kernel timestamp statistics: \n"
|
||||
<< std::fixed
|
||||
<< " Global start : " << std::dec << kernelTsResults->global.kernelStart << " cycles\n"
|
||||
<< " Kernel start: " << std::dec << kernelTsResults->context.kernelStart << " cycles\n"
|
||||
<< " Kernel end: " << std::dec << kernelTsResults->context.kernelEnd << " cycles\n"
|
||||
<< " Global end: " << std::dec << kernelTsResults->global.kernelEnd << " cycles\n"
|
||||
<< " timerResolution clock: " << std::dec << timerResolution << " cycles/s\n"
|
||||
<< " Kernel duration : " << std::dec << kernelDuration << " cycles, " << kernelDuration * (1000000000.0 / static_cast<double>(timerResolution)) << " ns\n";
|
||||
|
||||
if (devProperties.stype == ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES_1_2) {
|
||||
std::cout << "Kernel timestamp statistics (V1.2 and later): \n"
|
||||
<< std::fixed
|
||||
<< " Global start : " << std::dec << kernelTsResults->global.kernelStart << " cycles\n"
|
||||
<< " Kernel start: " << std::dec << kernelTsResults->context.kernelStart << " cycles\n"
|
||||
<< " Kernel end: " << std::dec << kernelTsResults->context.kernelEnd << " cycles\n"
|
||||
<< " Global end: " << std::dec << kernelTsResults->global.kernelEnd << " cycles\n"
|
||||
<< " timerResolution clock: " << std::dec << timerResolution << " cycles/s\n"
|
||||
<< " Kernel duration : " << std::dec << kernelDuration << " cycles, " << kernelDuration * (1000000000.0 / static_cast<double>(timerResolution)) << " ns\n";
|
||||
} else {
|
||||
std::cout << "Kernel timestamp statistics (prior to V1.2): \n"
|
||||
<< std::fixed
|
||||
<< " Global start : " << std::dec << kernelTsResults->global.kernelStart << " cycles\n"
|
||||
<< " Kernel start: " << std::dec << kernelTsResults->context.kernelStart << " cycles\n"
|
||||
<< " Kernel end: " << std::dec << kernelTsResults->context.kernelEnd << " cycles\n"
|
||||
<< " Global end: " << std::dec << kernelTsResults->global.kernelEnd << " cycles\n"
|
||||
<< " timerResolution: " << std::dec << timerResolution << " ns\n"
|
||||
<< " Kernel duration : " << std::dec << kernelDuration << " cycles, " << kernelDuration * timerResolution << " ns\n";
|
||||
}
|
||||
// Cleanup
|
||||
SUCCESS_OR_TERMINATE(zeMemFree(context, dstBuffer));
|
||||
SUCCESS_OR_TERMINATE(zeMemFree(context, srcBuffer));
|
||||
@@ -361,6 +371,7 @@ void printResult(bool result, std::string ¤tTest) {
|
||||
std::cout << "\nZello Timestamp: " << currentTest.c_str()
|
||||
<< " Results validation "
|
||||
<< (result ? "PASSED" : "FAILED")
|
||||
<< std::endl
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
@@ -379,8 +390,13 @@ int main(int argc, char *argv[]) {
|
||||
bool result;
|
||||
std::string currentTest;
|
||||
|
||||
currentTest = "Test Append Write of Global Timestamp";
|
||||
result = testKernelTimestampApendQuery(context, device);
|
||||
currentTest = "Test Append Write of Global Timestamp: Default Device Properties Structure";
|
||||
deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
result = testKernelTimestampApendQuery(context, device, deviceProperties);
|
||||
printResult(result, currentTest);
|
||||
currentTest = "Test Append Write of Global Timestamp: V1.2 (and later) Device Properties Structure";
|
||||
deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES_1_2};
|
||||
result = testKernelTimestampApendQuery(context, device, deviceProperties);
|
||||
printResult(result, currentTest);
|
||||
|
||||
SUCCESS_OR_TERMINATE(zeContextDestroy(context));
|
||||
|
||||
@@ -19,7 +19,7 @@ using ::testing::Return;
|
||||
using DevicePropertyTest = Test<DeviceFixture>;
|
||||
|
||||
HWTEST2_F(DevicePropertyTest, givenReturnedDevicePropertiesThenExpectedPropertiesFlagsSet, IsGen9) {
|
||||
ze_device_properties_t deviceProps;
|
||||
ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
|
||||
device->getProperties(&deviceProps);
|
||||
EXPECT_EQ(0u, deviceProps.flags & ZE_DEVICE_PROPERTY_FLAG_ONDEMANDPAGING);
|
||||
|
||||
@@ -362,6 +362,7 @@ TEST_F(DeviceTest, givenDeviceCachePropertiesThenAllPropertiesAreAssigned) {
|
||||
|
||||
TEST_F(DeviceTest, givenDevicePropertiesStructureWhenDevicePropertiesCalledThenAllPropertiesAreAssigned) {
|
||||
ze_device_properties_t deviceProperties, devicePropertiesBefore;
|
||||
deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
|
||||
deviceProperties.type = ZE_DEVICE_TYPE_FPGA;
|
||||
memset(&deviceProperties.vendorId, std::numeric_limits<int>::max(), sizeof(deviceProperties.vendorId));
|
||||
@@ -406,7 +407,7 @@ TEST_F(DeviceTest, givenDevicePropertiesStructureWhenDevicePropertiesCalledThenA
|
||||
}
|
||||
|
||||
TEST_F(DeviceTest, WhenGettingDevicePropertiesThenSubslicesPerSliceIsBasedOnSubslicesSupported) {
|
||||
ze_device_properties_t deviceProperties;
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
deviceProperties.type = ZE_DEVICE_TYPE_GPU;
|
||||
|
||||
device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo()->gtSystemInfo.MaxSubSlicesSupported = 48;
|
||||
@@ -421,7 +422,7 @@ TEST_F(DeviceTest, WhenGettingDevicePropertiesThenSubslicesPerSliceIsBasedOnSubs
|
||||
TEST_F(DeviceTest, GivenDebugApiUsedSetWhenGettingDevicePropertiesThenSubslicesPerSliceIsBasedOnMaxSubslicesSupported) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.DebugApiUsed.set(1);
|
||||
ze_device_properties_t deviceProperties;
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
deviceProperties.type = ZE_DEVICE_TYPE_GPU;
|
||||
|
||||
device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo()->gtSystemInfo.MaxSubSlicesSupported = 48;
|
||||
@@ -434,7 +435,7 @@ TEST_F(DeviceTest, GivenDebugApiUsedSetWhenGettingDevicePropertiesThenSubslicesP
|
||||
}
|
||||
|
||||
TEST_F(DeviceTest, givenCallToDevicePropertiesThenMaximumMemoryToBeAllocatedIsCorrectlyReturned) {
|
||||
ze_device_properties_t deviceProperties;
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
deviceProperties.maxMemAllocSize = 0;
|
||||
device->getProperties(&deviceProperties);
|
||||
EXPECT_EQ(deviceProperties.maxMemAllocSize, this->neoDevice->getDeviceInfo().maxMemAllocSize);
|
||||
@@ -474,7 +475,7 @@ TEST_F(DeviceHwInfoTest, givenDeviceWithNoPageFaultSupportThenFlagIsNotSet) {
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(&hardwareInfo);
|
||||
setDriverAndDevice();
|
||||
|
||||
ze_device_properties_t deviceProps;
|
||||
ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
device->getProperties(&deviceProps);
|
||||
EXPECT_FALSE(deviceProps.flags & ZE_DEVICE_PROPERTY_FLAG_ONDEMANDPAGING);
|
||||
}
|
||||
@@ -485,13 +486,13 @@ TEST_F(DeviceHwInfoTest, givenDeviceWithPageFaultSupportThenFlagIsSet) {
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(&hardwareInfo);
|
||||
setDriverAndDevice();
|
||||
|
||||
ze_device_properties_t deviceProps;
|
||||
ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
device->getProperties(&deviceProps);
|
||||
EXPECT_TRUE(deviceProps.flags & ZE_DEVICE_PROPERTY_FLAG_ONDEMANDPAGING);
|
||||
}
|
||||
|
||||
TEST_F(DeviceTest, whenGetDevicePropertiesCalledThenCorrectDevicePropertyEccFlagSet) {
|
||||
ze_device_properties_t deviceProps;
|
||||
ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
|
||||
device->getProperties(&deviceProps);
|
||||
auto expected = (this->neoDevice->getDeviceInfo().errorCorrectionSupport) ? ZE_DEVICE_PROPERTY_FLAG_ECC : static_cast<ze_device_property_flag_t>(0u);
|
||||
@@ -510,7 +511,7 @@ TEST_F(DeviceTest, givenCommandQueuePropertiesCallThenCallSucceeds) {
|
||||
}
|
||||
|
||||
TEST_F(DeviceTest, givenCallToDevicePropertiesThenTimestampValidBitsAreCorrectlyAssigned) {
|
||||
ze_device_properties_t deviceProps;
|
||||
ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
|
||||
device->getProperties(&deviceProps);
|
||||
EXPECT_EQ(36u, deviceProps.timestampValidBits);
|
||||
@@ -619,7 +620,7 @@ TEST_F(GlobalTimestampTest, whenGetProfilingTimerClockandProfilingTimerResolutio
|
||||
EXPECT_EQ(timerClock, static_cast<uint64_t>(1000000000.0 / timerResolution));
|
||||
}
|
||||
|
||||
TEST_F(GlobalTimestampTest, whenQueryingForTimerResolutionThenDefaultTimerResolutionInNanoSecondsIsReturned) {
|
||||
TEST_F(GlobalTimestampTest, whenQueryingForTimerResolutionWithLegacyDevicePropertiesStructThenDefaultTimerResolutionInNanoSecondsIsReturned) {
|
||||
neoDevice->setOSTime(new FalseCpuGpuTime());
|
||||
NEO::DeviceVector devices;
|
||||
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
|
||||
@@ -629,12 +630,28 @@ TEST_F(GlobalTimestampTest, whenQueryingForTimerResolutionThenDefaultTimerResolu
|
||||
double timerResolution = neoDevice->getProfilingTimerResolution();
|
||||
EXPECT_NE(timerResolution, 0.0);
|
||||
|
||||
ze_device_properties_t deviceProps = {};
|
||||
ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
ze_result_t res = driverHandle.get()->devices[0]->getProperties(&deviceProps);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
|
||||
EXPECT_EQ(deviceProps.timerResolution, static_cast<uint64_t>(timerResolution));
|
||||
}
|
||||
|
||||
TEST_F(GlobalTimestampTest, whenQueryingForTimerResolutionWithDeviceProperties_1_2_StructThenDefaultTimerResolutionInCyclesPerSecondsIsReturned) {
|
||||
neoDevice->setOSTime(new FalseCpuGpuTime());
|
||||
NEO::DeviceVector devices;
|
||||
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
|
||||
std::unique_ptr<L0::DriverHandleImp> driverHandle = std::make_unique<L0::DriverHandleImp>();
|
||||
driverHandle->initialize(std::move(devices));
|
||||
|
||||
uint64_t timerClock = neoDevice->getProfilingTimerClock();
|
||||
EXPECT_NE(timerClock, 0u);
|
||||
|
||||
ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES_1_2};
|
||||
ze_result_t res = driverHandle.get()->devices[0]->getProperties(&deviceProps);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
|
||||
EXPECT_EQ(deviceProps.timerResolution, timerClock);
|
||||
}
|
||||
|
||||
TEST_F(GlobalTimestampTest, whenQueryingForTimerResolutionWithUseCyclesPerSecondTimerSetThenTimerResolutionInCyclesPerSecondsIsReturned) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.UseCyclesPerSecondTimer.set(1u);
|
||||
@@ -648,7 +665,7 @@ TEST_F(GlobalTimestampTest, whenQueryingForTimerResolutionWithUseCyclesPerSecond
|
||||
uint64_t timerClock = neoDevice->getProfilingTimerClock();
|
||||
EXPECT_NE(timerClock, 0u);
|
||||
|
||||
ze_device_properties_t deviceProps = {};
|
||||
ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
ze_result_t res = driverHandle.get()->devices[0]->getProperties(&deviceProps);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
|
||||
EXPECT_EQ(deviceProps.timerResolution, timerClock);
|
||||
@@ -1018,7 +1035,7 @@ TEST_F(MultipleDevicesTest, whenRetriecingSubDevicePropertiesThenCorrectFlagIsSe
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
EXPECT_EQ(numSubDevices, count);
|
||||
|
||||
ze_device_properties_t deviceProps;
|
||||
ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
|
||||
L0::Device *subdevice0 = static_cast<L0::Device *>(subDevices[0]);
|
||||
subdevice0->getProperties(&deviceProps);
|
||||
@@ -1243,7 +1260,7 @@ TEST(DevicePropertyFlagIsIntegratedTest, givenIntegratedDeviceThenCorrectDeviceP
|
||||
driverHandle->initialize(std::move(devices));
|
||||
auto device = driverHandle->devices[0];
|
||||
|
||||
ze_device_properties_t deviceProps;
|
||||
ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
|
||||
device->getProperties(&deviceProps);
|
||||
EXPECT_EQ(ZE_DEVICE_PROPERTY_FLAG_INTEGRATED, deviceProps.flags & ZE_DEVICE_PROPERTY_FLAG_INTEGRATED);
|
||||
@@ -1261,7 +1278,7 @@ TEST(DevicePropertyFlagDiscreteDeviceTest, givenDiscreteDeviceThenCorrectDeviceP
|
||||
driverHandle->initialize(std::move(devices));
|
||||
auto device = driverHandle->devices[0];
|
||||
|
||||
ze_device_properties_t deviceProps;
|
||||
ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
|
||||
device->getProperties(&deviceProps);
|
||||
EXPECT_EQ(0u, deviceProps.flags & ZE_DEVICE_PROPERTY_FLAG_INTEGRATED);
|
||||
|
||||
@@ -29,7 +29,7 @@ ze_result_t DiagnosticsImp::diagnosticsRunTests(uint32_t start, uint32_t end, ze
|
||||
}
|
||||
|
||||
DiagnosticsImp::DiagnosticsImp(OsSysman *pOsSysman, const std::string &initalizedDiagTest, ze_device_handle_t handle) : deviceHandle(handle) {
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
Device::fromHandle(deviceHandle)->getProperties(&deviceProperties);
|
||||
pOsDiagnostics = OsDiagnostics::create(pOsSysman, initalizedDiagTest, deviceProperties.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE, deviceProperties.subdeviceId);
|
||||
UNRECOVERABLE_IF(nullptr == pOsDiagnostics);
|
||||
|
||||
@@ -115,7 +115,7 @@ void FrequencyImp::init() {
|
||||
}
|
||||
|
||||
FrequencyImp::FrequencyImp(OsSysman *pOsSysman, ze_device_handle_t handle, zes_freq_domain_t frequencyDomainNumber) : deviceHandle(handle) {
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
Device::fromHandle(deviceHandle)->getProperties(&deviceProperties);
|
||||
pOsFrequency = OsFrequency::create(pOsSysman, deviceProperties.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE, deviceProperties.subdeviceId, frequencyDomainNumber);
|
||||
UNRECOVERABLE_IF(nullptr == pOsFrequency);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -40,7 +40,7 @@ ze_result_t GlobalOperationsImp::processesGetState(uint32_t *pCount, zes_process
|
||||
|
||||
ze_result_t GlobalOperationsImp::deviceGetProperties(zes_device_properties_t *pProperties) {
|
||||
Device *device = pOsGlobalOperations->getDevice();
|
||||
ze_device_properties_t deviceProperties;
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
device->getProperties(&deviceProperties);
|
||||
sysmanProperties.core = deviceProperties;
|
||||
uint32_t count = 0;
|
||||
|
||||
@@ -71,7 +71,7 @@ void LinuxGlobalOperationsImp::getModelName(char (&modelName)[ZES_STRING_PROPERT
|
||||
}
|
||||
|
||||
void LinuxGlobalOperationsImp::getVendorName(char (&vendorName)[ZES_STRING_PROPERTY_SIZE]) {
|
||||
ze_device_properties_t coreDeviceProperties;
|
||||
ze_device_properties_t coreDeviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
pDevice->getProperties(&coreDeviceProperties);
|
||||
std::stringstream pciId;
|
||||
pciId << std::hex << coreDeviceProperties.vendorId;
|
||||
|
||||
@@ -199,7 +199,7 @@ void PlatformMonitoringTech::create(const std::vector<ze_device_handle_t> &devic
|
||||
std::map<uint32_t, L0::PlatformMonitoringTech *> &mapOfSubDeviceIdToPmtObject) {
|
||||
if (ZE_RESULT_SUCCESS == PlatformMonitoringTech::enumerateRootTelemIndex(pFsAccess, rootPciPathOfGpuDevice)) {
|
||||
for (const auto &deviceHandle : deviceHandles) {
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
Device::fromHandle(deviceHandle)->getProperties(&deviceProperties);
|
||||
auto pPmt = new PlatformMonitoringTech(pFsAccess, deviceProperties.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE,
|
||||
deviceProperties.subdeviceId);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -30,7 +30,7 @@ void MemoryImp::init() {
|
||||
}
|
||||
|
||||
MemoryImp::MemoryImp(OsSysman *pOsSysman, ze_device_handle_t handle) : deviceHandle(handle) {
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
Device::fromHandle(deviceHandle)->getProperties(&deviceProperties);
|
||||
pOsMemory = OsMemory::create(pOsSysman, deviceProperties.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE, deviceProperties.subdeviceId);
|
||||
init();
|
||||
|
||||
@@ -32,7 +32,7 @@ void PerformanceImp::init() {
|
||||
}
|
||||
|
||||
PerformanceImp::PerformanceImp(OsSysman *pOsSysman, ze_device_handle_t handle, zes_engine_type_flag_t domain) {
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
Device::fromHandle(handle)->getProperties(&deviceProperties);
|
||||
pOsPerformance = OsPerformance::create(pOsSysman, deviceProperties.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE,
|
||||
deviceProperties.subdeviceId, domain);
|
||||
|
||||
@@ -37,7 +37,7 @@ void RasImp::init() {
|
||||
}
|
||||
|
||||
RasImp::RasImp(OsSysman *pOsSysman, zes_ras_error_type_t type, ze_device_handle_t handle) : deviceHandle(handle) {
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
Device::fromHandle(deviceHandle)->getProperties(&deviceProperties);
|
||||
pOsRas = OsRas::create(pOsSysman, type, deviceProperties.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE, deviceProperties.subdeviceId);
|
||||
init();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -144,7 +144,7 @@ void SchedulerImp::init() {
|
||||
}
|
||||
|
||||
SchedulerImp::SchedulerImp(OsSysman *pOsSysman, zes_engine_type_flag_t engineType, std::vector<std::string> &listOfEngines, ze_device_handle_t deviceHandle) {
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
Device::fromHandle(deviceHandle)->getProperties(&deviceProperties);
|
||||
pOsScheduler = OsScheduler::create(pOsSysman, engineType, listOfEngines,
|
||||
deviceProperties.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE, deviceProperties.subdeviceId);
|
||||
|
||||
@@ -32,7 +32,7 @@ void StandbyImp::init() {
|
||||
}
|
||||
|
||||
StandbyImp::StandbyImp(OsSysman *pOsSysman, ze_device_handle_t handle) : deviceHandle(handle) {
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
Device::fromHandle(deviceHandle)->getProperties(&deviceProperties);
|
||||
pOsStandby = OsStandby::create(pOsSysman, deviceProperties.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE, deviceProperties.subdeviceId);
|
||||
UNRECOVERABLE_IF(nullptr == pOsStandby);
|
||||
|
||||
@@ -36,7 +36,7 @@ void TemperatureImp::init() {
|
||||
}
|
||||
|
||||
TemperatureImp::TemperatureImp(const ze_device_handle_t &deviceHandle, OsSysman *pOsSysman, zes_temp_sensors_t type) {
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
Device::fromHandle(deviceHandle)->getProperties(&deviceProperties);
|
||||
pOsTemperature = OsTemperature::create(pOsSysman, deviceProperties.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE,
|
||||
deviceProperties.subdeviceId, type);
|
||||
|
||||
@@ -583,7 +583,7 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq
|
||||
|
||||
TEST_F(SysmanMultiDeviceFixture, GivenValidDevicePointerWhenGettingFrequencyPropertiesThenValidSchedPropertiesRetrieved) {
|
||||
zes_freq_properties_t properties = {};
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
Device::fromHandle(device)->getProperties(&deviceProperties);
|
||||
LinuxFrequencyImp *pLinuxFrequencyImp = new LinuxFrequencyImp(pOsSysman, deviceProperties.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE,
|
||||
deviceProperties.subdeviceId, ZES_FREQ_DOMAIN_GPU);
|
||||
|
||||
@@ -219,7 +219,7 @@ TEST_F(ZesPmtFixtureMultiDevice, GivenValidSyscallsWhenDoingPMTInitAndcloseSysCa
|
||||
TEST_F(ZesPmtFixtureMultiDevice, GivenValidSyscallsWhenDoingPMTInitThenPMTmapOfSubDeviceIdToPmtObjectWouldContainValidEntries) {
|
||||
std::map<uint32_t, L0::PlatformMonitoringTech *> mapOfSubDeviceIdToPmtObject;
|
||||
for (const auto &deviceHandle : deviceHandles) {
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
Device::fromHandle(deviceHandle)->getProperties(&deviceProperties);
|
||||
auto pPmt = new PublicPlatformMonitoringTech(pTestFsAccess.get(), deviceProperties.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE,
|
||||
deviceProperties.subdeviceId);
|
||||
@@ -239,7 +239,7 @@ TEST_F(ZesPmtFixtureMultiDevice, GivenValidSyscallsWhenDoingPMTInitThenPMTmapOfS
|
||||
TEST_F(ZesPmtFixtureMultiDevice, GivenOpenSyscallFailWhenDoingPMTInitThenPMTmapOfSubDeviceIdToPmtObjectWouldBeEmpty) {
|
||||
std::map<uint32_t, L0::PlatformMonitoringTech *> mapOfSubDeviceIdToPmtObject;
|
||||
for (const auto &deviceHandle : deviceHandles) {
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
Device::fromHandle(deviceHandle)->getProperties(&deviceProperties);
|
||||
auto pPmt = new PublicPlatformMonitoringTech(pTestFsAccess.get(), deviceProperties.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE,
|
||||
deviceProperties.subdeviceId);
|
||||
@@ -257,7 +257,7 @@ TEST_F(ZesPmtFixtureMultiDevice, GivenOpenSyscallFailWhenDoingPMTInitThenPMTmapO
|
||||
TEST_F(ZesPmtFixtureMultiDevice, GivenNoPMTHandleInmapOfSubDeviceIdToPmtObjectWhenCallingreleasePmtObjectThenMapWouldGetEmpty) {
|
||||
auto mapOriginal = pLinuxSysmanImp->mapOfSubDeviceIdToPmtObject;
|
||||
for (const auto &deviceHandle : deviceHandles) {
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
Device::fromHandle(deviceHandle)->getProperties(&deviceProperties);
|
||||
pLinuxSysmanImp->mapOfSubDeviceIdToPmtObject.emplace(deviceProperties.subdeviceId, nullptr);
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenGettingBandwidthThen
|
||||
|
||||
TEST_F(SysmanMultiDeviceFixture, GivenValidDevicePointerWhenGettingMemoryPropertiesThenValidMemoryPropertiesRetrieved) {
|
||||
zes_mem_properties_t properties = {};
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
ze_bool_t isSubDevice = deviceProperties.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE;
|
||||
Device::fromHandle(device)->getProperties(&deviceProperties);
|
||||
LinuxMemoryImp *pLinuxMemoryImp = new LinuxMemoryImp(pOsSysman, isSubDevice, deviceProperties.subdeviceId);
|
||||
|
||||
@@ -52,7 +52,7 @@ class SysmanDevicePowerFixture : public SysmanDeviceFixture {
|
||||
}
|
||||
|
||||
for (auto &deviceHandle : deviceHandles) {
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
Device::fromHandle(deviceHandle)->getProperties(&deviceProperties);
|
||||
auto pPmt = new NiceMock<Mock<PowerPmt>>(pFsAccess.get(), deviceProperties.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE,
|
||||
deviceProperties.subdeviceId);
|
||||
|
||||
@@ -450,7 +450,7 @@ TEST_F(SysmanDeviceSchedulerFixture, GivenValidDeviceHandleWhenCallingzesSchedul
|
||||
TEST_F(SysmanMultiDeviceFixture, GivenValidDevicePointerWhenGettingSchedPropertiesThenValidSchedPropertiesRetrieved) {
|
||||
zes_sched_properties_t properties = {};
|
||||
std::vector<std::string> listOfEngines;
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
Device::fromHandle(device)->getProperties(&deviceProperties);
|
||||
LinuxSchedulerImp *pLinuxSchedulerImp = new LinuxSchedulerImp(pOsSysman, ZES_ENGINE_TYPE_FLAG_RENDER, listOfEngines,
|
||||
deviceProperties.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE, deviceProperties.subdeviceId);
|
||||
|
||||
@@ -48,7 +48,7 @@ class SysmanMultiDeviceTemperatureFixture : public SysmanMultiDeviceFixture {
|
||||
}
|
||||
|
||||
for (auto &deviceHandle : deviceHandles) {
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
Device::fromHandle(deviceHandle)->getProperties(&deviceProperties);
|
||||
auto pPmt = new NiceMock<Mock<TemperaturePmt>>(pFsAccess.get(), deviceProperties.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE,
|
||||
deviceProperties.subdeviceId);
|
||||
@@ -119,7 +119,7 @@ TEST_F(SysmanMultiDeviceTemperatureFixture, GivenCreatePmtObjectsWhenRootTileInd
|
||||
PlatformMonitoringTech::create(deviceHandles, pFsAccess.get(), rootPciPathOfGpuDevice, mapOfSubDeviceIdToPmtObject);
|
||||
uint32_t deviceHandlesIndex = 0;
|
||||
for (auto &subDeviceIdToPmtEntry : mapOfSubDeviceIdToPmtObject) {
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
Device::fromHandle(deviceHandles[deviceHandlesIndex++])->getProperties(&deviceProperties);
|
||||
EXPECT_NE(subDeviceIdToPmtEntry.second, nullptr);
|
||||
EXPECT_EQ(subDeviceIdToPmtEntry.first, deviceProperties.subdeviceId);
|
||||
@@ -153,7 +153,7 @@ class SysmanDeviceTemperatureFixture : public SysmanDeviceFixture {
|
||||
}
|
||||
|
||||
for (auto &deviceHandle : deviceHandles) {
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
Device::fromHandle(deviceHandle)->getProperties(&deviceProperties);
|
||||
auto pPmt = new NiceMock<Mock<TemperaturePmt>>(pFsAccess.get(), deviceProperties.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE,
|
||||
deviceProperties.subdeviceId);
|
||||
@@ -213,7 +213,7 @@ TEST_F(SysmanDeviceTemperatureFixture, GivenValidTempHandleAndPmtReadValueFailsW
|
||||
pSysmanDeviceImp->pTempHandleContext->handleList.pop_back();
|
||||
}
|
||||
for (auto &deviceHandle : deviceHandles) {
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
Device::fromHandle(deviceHandle)->getProperties(&deviceProperties);
|
||||
auto pPmt = new NiceMock<Mock<TemperaturePmt>>(pFsAccess.get(), deviceProperties.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE,
|
||||
deviceProperties.subdeviceId);
|
||||
@@ -231,7 +231,7 @@ TEST_F(SysmanDeviceTemperatureFixture, GivenValidTempHandleAndPmtReadValueFailsW
|
||||
}
|
||||
|
||||
TEST_F(SysmanDeviceTemperatureFixture, GivenValidTempHandleWhenGettingUnsupportedSensorsTemperatureThenUnsupportedReturned) {
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
Device::fromHandle(device->toHandle())->getProperties(&deviceProperties);
|
||||
auto pPublicLinuxTemperatureImp = std::make_unique<LinuxTemperatureImp>(pOsSysman, deviceProperties.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE,
|
||||
deviceProperties.subdeviceId);
|
||||
|
||||
Reference in New Issue
Block a user