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
Add documentation to invoke_fused and friends NFC. #2611
Conversation
hpx/util/invoke_fused.hpp
Outdated
typename detail::fused_index_pack<Tuple>::type()); | ||
typedef typename detail::fused_result_of<F&&(Tuple&&)>::type R; | ||
|
||
return invoke_fused_r<R>(std::forward<F>(f), std::forward<Tuple>(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.
The original implementation attempted to reduce the number of entries on the stack (noise in stack traces, steps while debugging, etc), resulting in such de-simplifications.
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.
Shall I leave the simplification out of the commit then?
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.
Either way is fine with me, I don't feel strongly about it. I merely wanted to expose the underlying rationale for that implementation.
On that note, if the decision is to simplify then perhaps similar changes should be applied to invoke
as well, which followed the same rationale.
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.
Well, thanks for pointing that out.
I didn't intend to apply similar changes, just spotted that invoke_fused
isn't self explaining
thus I wanted to add documentation to it.
invoke
(and its underlying implementation) seems good for me since it's self-explanatory.
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 think, the same changes were applied to invoke
as well. Also, this change was also triggered by deficiencies in certain C++ compilers (notably NVCC) which was not able to compile things without those changes.
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 removed the simplification changes, since those aren't worth a broken build on a non popular toolchain.
Thanks for working on this. This is much appreciated! In order to get this into the docs you will have to add the file to the list of files parsed by doxygen (see here: https://github.com/STEllAR-GROUP/hpx/blob/master/docs/CMakeLists.txt#L46-L174). Also, you may want to consider creating a documentation index entry (http://stellar-group.github.io/hpx/docs/html/index/s05.html) for Also, if we start adding doxygen comments for those functions, it might be nice to add descriptions for what the function is doing and for the function argument values as well (see doxygen |
Thanks @hkaiser for your explanation, I will improve this commit in order to add the description of the function into the documentation (while adding the missing entry for the exception behaviour). |
The |
@hkaiser The PR was updated recently to also include I just rebased the PR so it should be ready for merging as soon as the CI reports green. |
hpx/util/invoke.hpp
Outdated
/// the given argument types. | ||
/// | ||
/// \throws std::exception thrown from a function | ||
/// invocation of f with the argument types vs. |
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.
where does this throws clause come from?
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.
Doxygen provides it as a part of its API: \throws <exception-object> { exception description }
.
The specification of a possible implicit thrown exception was requested above.
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.
Sorry, I meant what part of the implementation does this clause correspond to? In particular, what restricts exceptions to be of type std::exception
?
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.
hpx/util/invoke.hpp
Outdated
/// Invokes the given functional type f with the content of | ||
/// the argument pack vs | ||
/// | ||
/// \param f A functional type providing an `operator()` |
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.
What's the meaning of "functional type"?
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 meant an object invokeable through an operator()
like function pointers or objects overloading operator()
.
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 believe the term you are looking for is callable object (f
is not a type), which is comprised by function objects and member pointers.
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.
Thanks for the suggestion, I changed this accordingly.
@Naios is there anything needed to move this forward? |
@hkaiser I will finish this PR tomorrow due to my first GSoC working day, through applying the suggested improvements by K-ballo. |
@hkaiser I added the suggested improvements and thus the PR should be ready for merge. |
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.
Thanks, LGTM!
invoke_fused
throughusing
invoke_fused_r
instead of the internal implementation.