mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 07:14:10 +08:00
Apply CamelCase for class and struct names
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
856318ccc2
commit
e2e00413a8
@@ -401,7 +401,7 @@ bool IpSamplingMetricGroupImp::stallIpDataMapUpdate(StallSumIpDataMap_t &stallSu
|
||||
stallSumData.syncCount += getCount();
|
||||
stallSumData.instFetchCount += getCount();
|
||||
|
||||
struct stallCntrInfo {
|
||||
struct StallCntrInfo {
|
||||
uint16_t subslice;
|
||||
uint16_t flags;
|
||||
} stallCntrInfo = {};
|
||||
|
||||
@@ -348,7 +348,7 @@ bool LinuxEventsUtil::listenSystemEvents(zes_event_type_flags_t *pEvents, uint32
|
||||
pfd[1].events = POLLIN;
|
||||
pfd[1].revents = 0;
|
||||
|
||||
auto start = L0::steadyClock::now();
|
||||
auto start = L0::SteadyClock::now();
|
||||
std::chrono::duration<double, std::milli> timeElapsed;
|
||||
getDevIndexToDevPathMap(registeredEvents, count, phDevices, mapOfDevIndexToDevPath);
|
||||
eventsMutex.unlock();
|
||||
@@ -374,7 +374,7 @@ bool LinuxEventsUtil::listenSystemEvents(zes_event_type_flags_t *pEvents, uint32
|
||||
}
|
||||
|
||||
if (!eventReceived) {
|
||||
timeElapsed = L0::steadyClock::now() - start;
|
||||
timeElapsed = L0::SteadyClock::now() - start;
|
||||
if (timeout > timeElapsed.count()) {
|
||||
timeout = timeout - timeElapsed.count();
|
||||
continue;
|
||||
@@ -386,7 +386,7 @@ bool LinuxEventsUtil::listenSystemEvents(zes_event_type_flags_t *pEvents, uint32
|
||||
void *dev = nullptr;
|
||||
dev = pUdevLib->allocateDeviceToReceiveData();
|
||||
if (dev == nullptr) {
|
||||
timeElapsed = L0::steadyClock::now() - start;
|
||||
timeElapsed = L0::SteadyClock::now() - start;
|
||||
if (timeout > timeElapsed.count()) {
|
||||
timeout = timeout - timeElapsed.count();
|
||||
continue;
|
||||
@@ -407,7 +407,7 @@ bool LinuxEventsUtil::listenSystemEvents(zes_event_type_flags_t *pEvents, uint32
|
||||
if (retval) {
|
||||
break;
|
||||
}
|
||||
timeElapsed = L0::steadyClock::now() - start;
|
||||
timeElapsed = L0::SteadyClock::now() - start;
|
||||
if (timeout > timeElapsed.count()) {
|
||||
timeout = timeout - timeElapsed.count();
|
||||
continue;
|
||||
|
||||
@@ -334,13 +334,13 @@ ze_result_t LinuxGlobalOperationsImp::reset(ze_bool_t force) {
|
||||
// this engine 0 is used by process.
|
||||
ze_result_t LinuxGlobalOperationsImp::scanProcessesState(std::vector<zes_process_state_t> &pProcessList) {
|
||||
std::vector<std::string> clientIds;
|
||||
struct deviceMemStruct {
|
||||
struct DeviceMemStruct {
|
||||
uint64_t deviceMemorySize;
|
||||
uint64_t deviceSharedMemorySize;
|
||||
};
|
||||
struct engineMemoryPairType {
|
||||
struct EngineMemoryPairType {
|
||||
int64_t engineTypeField;
|
||||
deviceMemStruct deviceMemStructField;
|
||||
DeviceMemStruct deviceMemStructField;
|
||||
};
|
||||
|
||||
ze_result_t result = pSysfsAccess->scanDirEntries(clientsDir, clientIds);
|
||||
@@ -350,7 +350,7 @@ ze_result_t LinuxGlobalOperationsImp::scanProcessesState(std::vector<zes_process
|
||||
}
|
||||
|
||||
// Create a map with unique pid as key and engineType as value
|
||||
std::map<uint64_t, engineMemoryPairType> pidClientMap;
|
||||
std::map<uint64_t, EngineMemoryPairType> pidClientMap;
|
||||
for (const auto &clientId : clientIds) {
|
||||
// realClientPidPath will be something like: clients/<clientId>/pid
|
||||
std::string realClientPidPath = clientsDir + "/" + clientId + "/" + "pid";
|
||||
@@ -440,13 +440,13 @@ ze_result_t LinuxGlobalOperationsImp::scanProcessesState(std::vector<zes_process
|
||||
return result;
|
||||
}
|
||||
}
|
||||
deviceMemStruct totalDeviceMem = {memSize, sharedMemSize};
|
||||
engineMemoryPairType engineMemoryPair = {engineType, totalDeviceMem};
|
||||
DeviceMemStruct totalDeviceMem = {memSize, sharedMemSize};
|
||||
EngineMemoryPairType engineMemoryPair = {engineType, totalDeviceMem};
|
||||
auto ret = pidClientMap.insert(std::make_pair(pid, engineMemoryPair));
|
||||
if (ret.second == false) {
|
||||
// insertion failed as entry with same pid already exists in map
|
||||
// Now update the engineMemoryPairType field for the existing pid entry
|
||||
engineMemoryPairType updateEngineMemoryPair;
|
||||
// Now update the EngineMemoryPairType field for the existing pid entry
|
||||
EngineMemoryPairType updateEngineMemoryPair;
|
||||
auto pidEntryFromMap = pidClientMap.find(pid);
|
||||
auto existingEngineType = pidEntryFromMap->second.engineTypeField;
|
||||
auto existingdeviceMemorySize = pidEntryFromMap->second.deviceMemStructField.deviceMemorySize;
|
||||
|
||||
@@ -15,11 +15,11 @@ constexpr uint32_t MbpsToBytesPerSecond = 125000;
|
||||
constexpr double milliVoltsFactor = 1000.0;
|
||||
|
||||
namespace L0 {
|
||||
struct steadyClock {
|
||||
struct SteadyClock {
|
||||
typedef std::chrono::duration<uint64_t, std::milli> duration;
|
||||
typedef duration::rep rep;
|
||||
typedef duration::period period;
|
||||
typedef std::chrono::time_point<steadyClock> time_point;
|
||||
typedef std::chrono::time_point<SteadyClock> time_point;
|
||||
static time_point now() noexcept {
|
||||
static auto epoch = std::chrono::steady_clock::now();
|
||||
return time_point(std::chrono::duration_cast<duration>(std::chrono::steady_clock::now() - epoch));
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace L0 {
|
||||
ze_result_t WddmSysmanDriverImp::eventsListen(uint64_t timeout, uint32_t count, zes_device_handle_t *phDevices, uint32_t *pNumDeviceEvents, zes_event_type_flags_t *pEvents) {
|
||||
bool gotSysmanEvent = false;
|
||||
memset(pEvents, 0, count * sizeof(zes_event_type_flags_t));
|
||||
auto timeToExitLoop = L0::steadyClock::now() + std::chrono::duration<uint64_t, std::milli>(timeout);
|
||||
auto timeToExitLoop = L0::SteadyClock::now() + std::chrono::duration<uint64_t, std::milli>(timeout);
|
||||
do {
|
||||
for (uint32_t devIndex = 0; devIndex < count; devIndex++) {
|
||||
gotSysmanEvent = L0::SysmanDevice::fromHandle(phDevices[devIndex])->deviceEventListen(pEvents[devIndex], timeout);
|
||||
@@ -31,7 +31,7 @@ ze_result_t WddmSysmanDriverImp::eventsListen(uint64_t timeout, uint32_t count,
|
||||
break;
|
||||
}
|
||||
NEO::sleep(std::chrono::milliseconds(10)); // Sleep for 10 milliseconds before next check of events
|
||||
} while ((L0::steadyClock::now() <= timeToExitLoop));
|
||||
} while ((L0::SteadyClock::now() <= timeToExitLoop));
|
||||
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user