cuvs: add package version retrieval function#2337
Conversation
Add a function that allows to retrieve the current version of a `cuvs` package. Also add a simple unit test for the function.
|
I cannot assign labels myself. |
|
@cjnolet how do we proceed with it? Would you consider such feature to be added? We want to use this library as a GPU VS POC and engine (crate) version is required in our API. |
|
What is the use case you're after? I don't see value in wrapping |
| pub fn version() -> &'static str { | ||
| env!("CARGO_PKG_VERSION") | ||
| } |
There was a problem hiding this comment.
I would suggest instead to wrap the underlying FFI function like so.
/// Returns the cuVS library version as `(major, minor, patch)`.
pub fn version() -> Result<(u16, u16, u16), LibraryError> {
let mut major: u16 = 0;
let mut minor: u16 = 0;
let mut patch: u16 = 0;
// SAFETY:
// - All three pointers are valid, aligned `u16` locals.
let status = unsafe { ffi::cuvsVersionGet(&mut major, &mut minor, &mut patch) };
check_cuvs(status)?;
Ok((major, minor, patch))
}
Return engine (cuVS crate) version via the |
When could it be done and released? |
Add a function that allows to retrieve the current version of a
cuvsRust package.Also add a simple unit test for the function.