Skip to content

Make MathExtensions device constants constexpr#4347

Draft
cyyever wants to merge 1 commit into
intel:mainfrom
cyyever:agent/mathext-constexpr
Draft

Make MathExtensions device constants constexpr#4347
cyyever wants to merge 1 commit into
intel:mainfrom
cyyever:agent/mathext-constexpr

Conversation

@cyyever

@cyyever cyyever commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

The special-function locals in MathExtensions.h were static const, which on device carries a guard variable and static storage. This switches the literal scalars (PI_f64, EXP1, lanczos_g, MAXITER, SMALL/LARGE/*RATIO) and the is_same<>::value-selected ones (MAXLOG, MACHEP, BIG, BIGINV) to constexpr, and modernizes their is_same<>::value / is_same<>() to is_same_v. Coefficient tables and arrays are left as-is.


Authored with the assistance of an AI coding agent (Claude).

The special-function locals were `static const`, which on device carries a
guard variable. Switch the literal scalars and the is_same-selected ones to
constexpr (with is_same_v); coefficient tables are left as-is.
@cyyever
cyyever marked this pull request as draft July 15, 2026 05:39
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.

1 participant