[Platform] Add current_platform.num_compute_units interface (#35042)

Signed-off-by: Kunshang Ji <kunshang.ji@intel.com>
Signed-off-by: Kunshang Ji <jikunshang95@gmail.com>
This commit is contained in:
Kunshang Ji
2026-02-24 22:22:49 -08:00
committed by GitHub
parent 92510edc32
commit 8ad54a991b
24 changed files with 72 additions and 52 deletions
+10
View File
@@ -692,6 +692,16 @@ class Platform:
"""
return {}
@classmethod
def num_compute_units(cls, device_id: int = 0) -> int:
"""
Get the number of compute units for the current platform.
(NVIDIA SM / AMD CU / Intel EU)
"""
raise NotImplementedError(
"num_compute_units is not implemented for the current platform."
)
class UnspecifiedPlatform(Platform):
_enum = PlatformEnum.UNSPECIFIED