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

Provide printf()-family functions #98

Open
eyalroz opened this issue Apr 23, 2022 · 0 comments
Open

Provide printf()-family functions #98

eyalroz opened this issue Apr 23, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request fixed on development A fix for this issue has been committed to the development branch

Comments

@eyalroz
Copy link
Owner

eyalroz commented Apr 23, 2022

While this repository is C++-oriented - it is still useful to provide some C standard library functions, some of which are already available. Missing are the printf()-family of functions: Both printf() itself, as CUDA's printf() does not support several C99 printf features; and even more importantly, sprintf(), for returning formatted strings, or marshalling them before actually printf()'ing.

@eyalroz eyalroz added the enhancement New feature or request label Apr 23, 2022
@eyalroz eyalroz self-assigned this Apr 23, 2022
eyalroz added a commit that referenced this issue Apr 23, 2022
…ons as `kat::printf()`, `kat::sprintf()` etc.

* Added functions `vprintf()`, `vsnprintf()`, `vsprintf()`, `vnprintf()`, `printf()`, `sprintf()`, `snprintf().
* Also added two specialty functions where the caller provides scratch space: `vnprintf_with_scratch()`, `nprintf_with_scratch()`
* Added a separate target, `cuda-kat::kat-printf`, to link against for using the functions.
* Added unit tests for the new functions.

Notes:

* The implementation is based on the [eyalroz/printf](https://github.com/eyalroz/printf) self-contained library, originally by Marco Palland.
* The library statically linked and with separable compilation; it this takes a long time to build, but a short time to  use, and doesn't inflate your kernel code by inlining the entire `printf()` implementation.
eyalroz added a commit that referenced this issue Apr 24, 2022
…ons as `kat::printf()`, `kat::sprintf()` etc.

* Added functions `vprintf()`, `vsnprintf()`, `vsprintf()`, `vnprintf()`, `printf()`, `sprintf()`, `snprintf().
* Also added two specialty functions where the caller provides scratch space: `vnprintf_with_scratch()`, `nprintf_with_scratch()`
* Added a separate target, `cuda-kat::kat-printf`, to link against for using the functions.
* Added unit tests for the new functions.
* `cuda-kat` is now no longer a header-only library... (so dropped the comment to that effect from `CMakeLists.txt`)

Notes:

* The implementation is based on the [eyalroz/printf](https://github.com/eyalroz/printf) self-contained library, originally by Marco Palland.
* The library statically linked and with separable compilation; it this takes a long time to build, but a short time to  use, and doesn't inflate your kernel code by inlining the entire `printf()` implementation.
@eyalroz eyalroz added the fixed on development A fix for this issue has been committed to the development branch label Jul 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed on development A fix for this issue has been committed to the development branch
Projects
None yet
Development

No branches or pull requests

1 participant