-
Notifications
You must be signed in to change notification settings - Fork 21
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
Fix Options in C and Fortran APIs #152
Conversation
915f7da
to
03560fa
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.
Some minor comments need to be addressed first. But most of it is great!
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.
Some comments. More to come.
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've fixed or am working on most issues, but haven't pushed changes quite yet.
05d5688
to
32c6ae4
Compare
I added my fixes, rebased and fixed the merge conflict. |
@mgates3 Thanks for addressing Sebastien's comments. I apparently missed the notification. |
202b094
to
a0777c0
Compare
This also allows for a slightly more robust get_options function that automatically knows the right return type
It isn't part of our external API, so it shouldn't be included in the installation
* The example README had outdated information wrt pkg-config * ex05_blas hardcoded double instead of using scalar_type
… dependencies (see discussion in PR 152).
…tionally compile examples
…plex matrix. Update grid_size to match C code. Fix processing command line arguments.
a0777c0
to
1be0a17
Compare
After looking at things, I felt like the best way to implement
slate_Options
was to make it just a pointer to the C++ options object and provide accessor functions to read/write the various options. Theslate_Options_create
andslate_Options_destroy
functions match the create/destroy functions forslate_Matrix
/slate_Pivots
/etc.The options are set as, e.g.,
slate_Options_set_Lookahead( slate_Options opts, int64_t value )
and get as, e.g.,slate_Options_get_Lookahead( slate_Options opts, int64_t defval )
. So, normal usage would beTo help simplify things, passing
NULL
as the options gets converted into an empty options array. This helps simplify cases where the defaults are good enough, as in most of our examples:Alternative approaches:
create
function to set the defaults correctlybool
options since assigning any non-zero value to C'sbool
will always assign1
.Other improvements
get_option
that takes the Option argument as a template parameter and returns the expected type, instead of relying on the caller to specify the correct type.get_option
calls in LU (all 3) and Choleksy to make sure it was working.src
instead ofinclude/slate
. It's just internal functions, so it shouldn't be included in our external API.BaseMatrix::num_devices()
to the C/Fortran APIs (I needed it to only useTarget::Devices
in the gemm example when there are GPUs present.)examples/c_api
andexamples/fortran
, respectively. Additionally, these examples were added to the CI tests.