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

Add some hierarchy in the Python header #135

Open
keryell opened this issue Dec 14, 2022 · 2 comments
Open

Add some hierarchy in the Python header #135

keryell opened this issue Dec 14, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@keryell
Copy link
Contributor

keryell commented Dec 14, 2022

The Python code looks flat like C from 1972.
But there are classes and modules in Python. :-)
For example urProgramCreateWithBinary could become oneapi.program.create_with_binary.
I am unsure that squashing the imported modules like

from ctypes import *
from enum import *

instead of

from ctypes import *
from enum import *

improves the code quality and readability. https://peps.python.org/pep-0008/#imports
I am curious about how the C++ API will look like. :-)

@pbalcer
Copy link
Contributor

pbalcer commented Dec 14, 2022

The ur.py code contains automatically generated raw FFI bindings. Eventually, it might make sense to build a rich idiomatic python library on top of it, but there are no immediate plans to do so. That's because the UR interface is still being defined and would be a moving target for any higher-level software layer.

@FranklandJack FranklandJack added the enhancement New feature or request label Dec 14, 2022
@keryell
Copy link
Contributor Author

keryell commented Dec 14, 2022

Thanks for the clarification.
But since it is automatically generated, this is even better: you could improve the automatic generator to add the right types at the right place and the right hierarchy. Otherwise it will pollute all the Python global namespace.

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

No branches or pull requests

3 participants