Skip to content

Commit bd364c5

Browse files
committed
Implement a few additional services
1 parent e2b8523 commit bd364c5

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

offload/plugins-nextgen/level_zero/include/L0Device.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,23 @@ class L0DeviceTy final : public GenericDeviceTy {
351351
uint32_t getMaxGroupSize() const {
352352
return ComputeProperties.maxTotalGroupSize;
353353
}
354+
uint32_t getMaxGroupCount() const {
355+
return getMaxGroupCountX() * getMaxGroupCountY() * getMaxGroupCountZ();
356+
}
357+
358+
uint32_t getMaxGroupSizeX() const { return ComputeProperties.maxGroupSizeX; }
359+
uint32_t getMaxGroupSizeY() const { return ComputeProperties.maxGroupSizeY; }
360+
uint32_t getMaxGroupSizeZ() const { return ComputeProperties.maxGroupSizeZ; }
361+
uint32_t getMaxGroupCountX() const {
362+
return ComputeProperties.maxGroupCountX;
363+
}
364+
uint32_t getMaxGroupCountY() const {
365+
return ComputeProperties.maxGroupCountY;
366+
}
367+
uint32_t getMaxGroupCountZ() const {
368+
return ComputeProperties.maxGroupCountZ;
369+
}
370+
uint32_t getMemoryClockRate() const { return MemoryProperties.maxClockRate; }
354371
uint64_t getGlobalMemorySize() const { return MemoryProperties.totalSize; }
355372
size_t getCacheSize() const { return CacheProperties.cacheSize; }
356373
uint64_t getMaxMemAllocSize() const {
@@ -597,6 +614,12 @@ class L0DeviceTy final : public GenericDeviceTy {
597614
}
598615

599616
Expected<InfoTreeNode> obtainInfoImpl() override;
617+
uint64_t getClockFrequency() const override { return DeviceProperties.coreClockRate; }
618+
uint64_t getHardwareParallelism() const override { return getTotalThreads(); }
619+
Error getDeviceMemorySize(uint64_t &DSize) {
620+
DSize = getGlobalMemorySize();
621+
return Plugin::success();
622+
}
600623

601624
Error getDeviceStackSize(uint64_t &V) override {
602625
V = 0;

offload/plugins-nextgen/level_zero/src/L0Device.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,20 @@ Expected<InfoTreeNode> L0DeviceTy::obtainInfoImpl() {
563563
Info.add("Number of slices", getNumSlices());
564564
Info.add("Max Group size", getMaxGroupSize(), "",
565565
DeviceInfo::MAX_WORK_GROUP_SIZE);
566+
auto &MaxGroupSize =
567+
*Info.add("Workgroup Max Size per Dimension", std::monostate{}, "",
568+
DeviceInfo::MAX_WORK_GROUP_SIZE_PER_DIMENSION);
569+
MaxGroupSize.add("x", getMaxGroupSizeX());
570+
MaxGroupSize.add("y", getMaxGroupSizeY());
571+
MaxGroupSize.add("z", getMaxGroupSizeZ());
572+
Info.add("Maximum Grid Dimensions", getMaxGroupSize() * getMaxGroupCount(),
573+
"", DeviceInfo::MAX_WORK_SIZE);
574+
auto &MaxSize = *Info.add("Grid Size per Dimension", std::monostate{}, "",
575+
DeviceInfo::MAX_WORK_SIZE_PER_DIMENSION);
576+
MaxSize.add("x", getMaxGroupSizeX() * getMaxGroupCountX());
577+
MaxSize.add("y", getMaxGroupSizeY() * getMaxGroupCountY());
578+
MaxSize.add("z", getMaxGroupSizeZ() * getMaxGroupCountZ());
579+
566580
Info.add("Local memory size (bytes)", getMaxSharedLocalMemory());
567581
Info.add("Global memory size (bytes)", getGlobalMemorySize(), "",
568582
DeviceInfo::GLOBAL_MEM_SIZE);
@@ -571,6 +585,10 @@ Expected<InfoTreeNode> L0DeviceTy::obtainInfoImpl() {
571585
DeviceInfo::MAX_MEM_ALLOC_SIZE);
572586
Info.add("Max clock frequency (MHz)", getClockRate(), "",
573587
DeviceInfo::MAX_CLOCK_FREQUENCY);
588+
Info.add("Max memory clock frequency (MHz)", getMemoryClockRate(), "",
589+
DeviceInfo::MEMORY_CLOCK_RATE);
590+
Info.add("Memory Address Size", uint64_t{64u}, "bits",
591+
DeviceInfo::ADDRESS_BITS);
574592
return Info;
575593
}
576594

0 commit comments

Comments
 (0)