summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYashasvi Misra <yashasvimisra_bh@srmuniv.edu.in>2021-08-19 19:35:42 +0000
committerYashasvi Misra <yashasvimisra_bh@srmuniv.edu.in>2021-08-19 19:35:42 +0000
commitaf0fe021058c045748e0117eee4e856c60c879c5 (patch)
treefdf10a75ab8d27baccb4c99f01ce038cfaf8c6ca
parent5350aa0972a394afcda4ad6ecaca7690cbe5f702 (diff)
downloadnumpy-af0fe021058c045748e0117eee4e856c60c879c5.tar.gz
update
-rw-r--r--numpy/core/src/multiarray/lowlevel_strided_loops.c.src4
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/lowlevel_strided_loops.c.src b/numpy/core/src/multiarray/lowlevel_strided_loops.c.src
index e533e4932..e38873746 100644
--- a/numpy/core/src/multiarray/lowlevel_strided_loops.c.src
+++ b/numpy/core/src/multiarray/lowlevel_strided_loops.c.src
@@ -819,6 +819,10 @@ NPY_NO_EXPORT PyArrayMethod_StridedLoop *
# define _CONVERT_FN(x) npy_floatbits_to_halfbits(x)
# elif @is_double1@
# define _CONVERT_FN(x) npy_doublebits_to_halfbits(x)
+# elif @is_half1@
+# define _CONVERT_FN(x) (x)
+# elif @is_bool1@
+# define _CONVERT_FN(x) npy_float_to_half((float)(x!=0))
# else
# define _CONVERT_FN(x) npy_float_to_half((float)x)
# endif