[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user