-
Notifications
You must be signed in to change notification settings - Fork 108
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
Document the most important API functions #495
base: main
Are you sure you want to change the base?
Conversation
@@ -117,13 +117,42 @@ typedef enum { | |||
DEM_ForwardModeSplit = 4, | |||
} CDerivativeMode; | |||
|
|||
/// Generates a new function based on the input, which uses forward-mode AD. | |||
/// |
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.
We also need to document the formal function: https://enzyme.mit.edu/doxygen/classEnzymeLogic.html#a8e6ba5c54950f1ebcdfcbd7ce2a16083
I'm slightly inclined to have the C API documentation be light, and instead forward one to see the C++ function which it wraps (this applies to all of the functions in the C API)
/// Based on the | ||
/// @param retType: When returning f32/f64 we might use DFT_OUT_DIFF. | ||
/// When returning anything else, one should use DFT_CONSTANT | ||
/// @param width: currently only supporting width=1 here |
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 wouldn't add this as a comment here, and instead describe what width should do.
/// Generates a new function based on the input, which uses reverse-mode AD. | ||
/// | ||
/// Based on the | ||
/// @param retType: When returning f32/f64 we might use DFT_OUT_DIFF. |
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 would use llvm type names here: float/double. We also would want to state the general rule that out_diff is used when the value being differentiated is being passed as a register (examples being float double, a vector of these, an llvm.struct of these, etc) rather than through memory (e.g. a pointer)
/// @param retType: DFT_DUP_ARG, DFT_CONSTANT | ||
/// @param constant_args: pointing to combinations of DFT_DUP_ARG and | ||
/// DFT_CONSTANT | ||
/// @param forceAnonymousTape: TODO |
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.
Per https://enzyme.mit.edu/doxygen/classEnzymeLogic.html#a8e6ba5c54950f1ebcdfcbd7ce2a16083, forceAnonymousTape forces the tape to be an i8* rather than the true tape
.
Just to get started, should be improved further.
Feel free to update this branch directly.