-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
MAINT: Convert scalar_math.c.src to scalarmath.cpp.src #21486
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
base: main
Are you sure you want to change the base?
MAINT: Convert scalar_math.c.src to scalarmath.cpp.src #21486
Conversation
npy_static_cast<T>() is roughly equivalent to a static_cast<T>() but it's designed so that it can be non-intrusively extended for numpy types. In particular as npy_half is just a type alias on uint16_t, we cannot speciailize behavior on its type without impacting npy_ushort. so use the tagging system already used for other C++ parts instead. Ultimately, it would be great to make npy_half a regular struct to avoid this kind of situation.
In particular as |
Would it make sense to create a second name for If that is all that is necessary to avoid the tags, that seems worthwhile? |
I don't know what's an INTERNAL_BUILD, but using a
should have no cost on execution time and would make life easier (and code cleaner). |
I can do that in a separate PR if that's fine with you. |
@serge-sans-paille I was thinking of just abusing these defines:
which are used in our public headers to change things a bit. We could even just create a new define which we just always set for NumPy itself (i.e. when one of those two is set)?
Yeah, doing that in a seperate PR first seems like the right thing to me also. |
|
No description provided.