-
Notifications
You must be signed in to change notification settings - Fork 60
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
Expose C-API's for some of the keyvalue qsort #173
Conversation
de74aee
to
c21f0a4
Compare
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.
Mostly seems okay, though there is no documentation of this. I have a few comments though
|
||
// declare function here, linker will find this when linked to | ||
// libx86simdsortcpp.so | ||
void keyvalue_qsort_float_sizet(float *, size_t *, size_t); |
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.
Should we add a header file for these declarations? They probably should be documented somewhere, definitely if there's no header file for them
|
||
extern "C" { | ||
XSS_EXPORT_SYMBOL | ||
void keyvalue_qsort_float_uint32(float *key, uint32_t *val, uint32_t size) |
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.
Is there a reason why some of these functions take the size of the array as a uint32_t instead of a size_t? I'd prefer they all be the same if there's no reason for them not to be.
x86simdsort::keyvalue_qsort(key, val, size, true); | ||
} | ||
XSS_EXPORT_SYMBOL | ||
void keyvalue_qsort_float_sizet(float *key, size_t *val, size_t size) |
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.
I also think the argument type/function name of these being size_t is a little awkward. I think I would probably call them uint64; I guess that might not technically always be the same, if it was running on a 32-bit system. But I presume 64 bit unsigned integer is what is meant here
Also added an example file to demonstrate how to use it.