-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
gh-153740: Optimize PyFloat_Pack/Unpack2 using native _Float16 #154796
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
502589d
d90dafb
8bda53a
7f7b1c4
ac38cb8
5d88691
a8aa77a
7267d2d
00d48b7
702b888
d7a79fa
7776661
272c538
eb06f94
f2770cb
6bfff56
d5b2feb
972124e
0358727
924fd20
e416b31
165a48f
1d7e15a
b5203e1
44e602d
d0254b0
5202c97
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 |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| If available on the platform, use native :c:type:`_Float16` in | ||
| :c:func:`PyFloat_Pack2` and :c:func:`PyFloat_Unpack2` functions. Patch by | ||
| Sergey B Kirpichev. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4469,6 +4469,25 @@ if test "$ac_cv_ffi_complex_double_supported" = "yes"; then | |
| [Defined if _Complex C type can be used with libffi.]) | ||
| fi | ||
|
|
||
| # Check for native half-float type (_Float16). | ||
| AC_CACHE_CHECK([for _Float16 support], [ac_cv_float16_supported], | ||
| WITH_SAVE_ENV([ | ||
| CFLAGS="$CFLAGS -O0" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you change the compiler flags?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To disable optimizations. |
||
| AC_RUN_IFELSE([AC_LANG_SOURCE([[ | ||
| int main(void) | ||
| { | ||
| _Float16 val = 1.0f16; | ||
| double d = 3.14; | ||
| val = d; | ||
| return 0; | ||
| } | ||
| ]])], [ac_cv_float16_supported=yes], | ||
| [ac_cv_float16_supported=no], | ||
| [ac_cv_float16_supported=no])])) | ||
| AS_VAR_IF([ac_cv_float16_supported], [yes], | ||
| [AC_DEFINE([HAVE_FLOAT16], [1], | ||
| [Defined if _Float16 C type is supported])]) | ||
|
|
||
| dnl Check for libmpdec >= 2.5.0 | ||
| PKG_CHECK_MODULES([LIBMPDEC], [libmpdec >= 2.5.0], [have_mpdec=yes], [ | ||
| WITH_SAVE_ENV([ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.