-
Notifications
You must be signed in to change notification settings - Fork 39
Adds conditional softcap switch macro #25
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -46,6 +46,16 @@ | |||||
| #define EVENK_SWITCH BOOL_SWITCH | ||||||
| #endif | ||||||
|
|
||||||
| #ifdef FLASHATTENTION_DISABLE_SOFTCAP | ||||||
| #define SOFTCAP_SWITCH(COND, CONST_NAME, ...) \ | ||||||
| [&] { \ | ||||||
|
||||||
| [&] { \ | |
| [] { \ |
Copilot
AI
Jun 23, 2025
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.
Using a macro parameter as a variable name (CONST_NAME) risks collisions. Consider generating a unique identifier (e.g., via __LINE__) or clearly documenting that callers must provide a unique name.
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
CONDparameter is unused whenFLASHATTENTION_DISABLE_SOFTCAPis defined, which may trigger an unused-parameter warning. Consider explicitly casting it away (e.g.,(void)COND;) inside the lambda.