Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propose to make the device wrapper of PyDirectML for C++ sample usage #84

Open
huningxin opened this issue Mar 9, 2021 · 2 comments
Open

Comments

@huningxin
Copy link
Contributor

The device wrapper of Python samples is a quite good helper for DirectML device and resource management. I propose to make it also useful for C++ sample, e.g. HelloDirectML . That would simplify the C++ sample and improve the code reuse.

Any thoughts?

@jstoecker
Copy link
Contributor

It's an interesting suggestion! I believe the original intent with HelloDirectML was to write the shortest possible code sample, without any superfluous code, that does a step-by-step walk-through of the stages of initializing and executing a single operator. I personally agree that this sample could be cleaned up a bit, though it's tricky to introduce abstractions here without muddying key concepts like binding, operator initialization, and operator dispatching. The style of abstractions that work best really depend on the application.

@huningxin
Copy link
Contributor Author

Probably HelloDirectML could have two code paths that illustrate both the step-by-step and the abstract ways. Just like it uses USE_DMLX for graph building.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants