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

Expose C-API's for some of the keyvalue qsort #173

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

r-devulap
Copy link
Contributor

Also added an example file to demonstrate how to use it.

@r-devulap r-devulap force-pushed the postgres branch 2 times, most recently from de74aee to c21f0a4 Compare November 27, 2024 19:41
Copy link
Contributor

@sterrettm2 sterrettm2 left a 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);
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

@sterrettm2 sterrettm2 Nov 27, 2024

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

@sterrettm2 sterrettm2 merged commit 59e298d into intel:main Nov 27, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants