-
Notifications
You must be signed in to change notification settings - Fork 171
Add PTX helpers #686
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
base: main
Are you sure you want to change the base?
Add PTX helpers #686
Conversation
} | ||
|
||
|
||
def get_minimal_required_driver_ver_from_ptx_ver(ptx_version: str) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of driver_ver
should we call this cuda_ver
? Since someone could be using nvjitlink
instead?
# Regex pattern to match .version directive and capture the version number | ||
_ptx_ver_pattern = re.compile(r'\.version\s+([0-9]+\.[0-9]+)') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a future note that this will slow down import time which some people care about and that we could potentially lazily initialize this instead if needed?
>>> get_ptx_ver(ptx) | ||
'8.8' | ||
""" | ||
m = _ptx_ver_pattern.search(ptx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on https://docs.nvidia.com/cuda/parallel-thread-execution/#source-format, the first line is always going to be .version
, so we'd probably be better off avoiding the regular expression and always just look at the beginning of the string?
Description
Close #653.
Checklist