Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions src/winml/modelkit/sysinfo/pdh_adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,10 @@ class AdapterInfo:

@property
def is_npu(self) -> bool:
"""NPU heuristic: only Compute engine types, no 3D/Video/Copy/etc."""
non_compute = {e for e in self.engine_types if not e.startswith("Compute")}
return len(non_compute) == 0 and len(self.engine_types) > 0

@property
def compute_engine_type(self) -> str | None:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused

"""Return the first Compute engine type name."""
for et in sorted(self.engine_types):
if et.startswith("Compute"):
return et
return None
"""NPU heuristic: only Compute/Neural engine types, no 3D/Video/Copy/etc."""
return len(self.engine_types) > 0 and all(
e.startswith(("Compute", "Neural")) for e in self.engine_types
)


def enumerate_adapters() -> dict[str, AdapterInfo]:
Expand Down
Loading