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

Avoid trying to stick compilation logs of size N into buffers of size N-1 + Fix size-0 handling #544

Closed
eyalroz opened this issue Oct 3, 2023 · 0 comments

Comments

@eyalroz
Copy link
Owner

eyalroz commented Oct 3, 2023

With #539, we no longer return the trailing \0 character in the compilation log. However, when there's nothing else in the log - we're currently mishandling the situation, by asking CUDA to retrieve a size-N log (including the trailing '\0') into a size-N-1 buffer. Let's not do that.

Also, when some kind of string is of size 0, we should not bother to try and retrieve it anyway.

@eyalroz eyalroz self-assigned this Oct 3, 2023
@eyalroz eyalroz changed the title Support size-0 compilation logs Avoid trying to stick compilation logs of size N into buffers of size N-1 + size-0 fix Oct 3, 2023
@eyalroz eyalroz changed the title Avoid trying to stick compilation logs of size N into buffers of size N-1 + size-0 fix Avoid trying to stick compilation logs of size N into buffers of size N-1 + Fix size-0 handling Oct 3, 2023
eyalroz added a commit that referenced this issue Oct 3, 2023
* Not trying to make an actual retrieval API call for a size-0 buffer/string (or size-1 compilation log, since it's just the trailing '\0')
* Ensuring our buffer for the compilation log accommodates the trailing '\0'
eyalroz added a commit that referenced this issue Oct 3, 2023
* Not trying to make an actual retrieval API call for a size-0 buffer/string (or size-1 compilation log, since it's just the trailing '\0')
* Ensuring our buffer for the compilation log accommodates the trailing '\0'
eyalroz pushed a commit that referenced this issue Oct 4, 2023
* Reducing NVRTC's reported compilation log length by 1
* Not trying to make an actual retrieval API call for a size-0 buffer/string (or size-1 compilation log, since it's just the trailing '\0')
* Ensuring our buffer for the compilation log accommodates the trailing '\0' (and discards it)
@eyalroz eyalroz closed this as completed Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant