DirectML/Samples
Zu-shi 94fafe580e
For NPU Sample, add flexibility in device creation options and fix Generic ML Device logic (#624)
* For NPU Sample, add flexibility in device creation options and fix Generic ML Device logic

Expand NPU sample's capabilities for creating devices based on attributes.

More specifically, allow options to filter based on allowed, unallowed, and required attributes. Then add some flags for the most commonly needed options for this sample.

The logic for how each interacts with CreateAdapterList is a bit unconventional since CreateAdapterList ANDs the passed in attributes.

Tested locally on Intel NPU.

* Fix comment typo in NPU Sample

* Set D3D Feature Level Requirement to Generic, Optimize Adapter Selection

* Add flags to filter for GENERIC_ML only without COMPUTE

* Improve labelling of flags & lists for developer friendliness

* Minor smaller PR feedback in comments & loop optimization

* address initial PR feedback

* Simplify adapter discovery logic

* Update Package Versions, Simplify Device-Querying Logic

* Address PR feedback

* Additional PR feedback

* Improve documentation to add context for NPU creation

* minor fix to sample output

* Address Initial PR feedback

* Create adapter under COMPUTE feature level if CORE adapters are not availible

* Add comments noting that HMODULEs should be freed after usage

---------

Co-authored-by: Zu Shi <zuomingshi@microsoft.com>
2024-10-22 17:53:48 -04:00
..
DirectMLNpuInference For NPU Sample, add flexibility in device creation options and fix Generic ML Device logic (#624) 2024-10-22 17:53:48 -04:00
DirectMLSuperResolution Update Samples and Release.md (#636) 2024-08-23 16:52:54 -07:00
DirectML_ESRGAN Update Readme (#649) 2024-09-27 11:31:55 -07:00
HelloDirectML Update Samples and Release.md (#636) 2024-08-23 16:52:54 -07:00
yolov4 Update Samples and Release.md (#636) 2024-08-23 16:52:54 -07:00
README.md

README.md

DirectML Samples

These samples provide examples of DirectML concepts and code.

In This Section

  • HelloDirectML: A minimal "hello world" application that executes a single DirectML operator.
  • DirectMLSuperResolution: A sample that uses DirectML to execute a basic super-resolution model to upscale video from 540p to 1080p in real time.
  • YOLO-V4: An object-detection sample that uses the YOLO V4 model on a video file.