You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's currently possible to directly embed a CUDA module via Module::load_from_string(). It is using a CStr, which is meant for a list on nul-terminated bytes (strings) and not for binary data.
Hence I propose introducing Module::load_from_bytes(), which does the same thing, the only difference will be that the input will be a byte slice &[u8]. You can then use the include_bytes! macro to include the module.
I would even remove the Module::load_from_string() and only have Module:load_from_bytes(), but I'd leave this decision to the maintainers.
I'm happy to do a PR, if that's a feature that would be accepted.
The text was updated successfully, but these errors were encountered:
I forgot to mention that the inlcude_str! macro has additional restrictions, the input needs to be valid UTF-8, which leads to problems as described in issue #47.
It's currently possible to directly embed a CUDA module via
Module::load_from_string()
. It is using aCStr
, which is meant for a list on nul-terminated bytes (strings) and not for binary data.Hence I propose introducing
Module::load_from_bytes()
, which does the same thing, the only difference will be that the input will be a byte slice&[u8]
. You can then use theinclude_bytes!
macro to include the module.I would even remove the
Module::load_from_string()
and only haveModule:load_from_bytes()
, but I'd leave this decision to the maintainers.I'm happy to do a PR, if that's a feature that would be accepted.
The text was updated successfully, but these errors were encountered: