|
17 | 17 | get_unary_impl_for_fn_and_ty, |
18 | 18 | get_binary_impl_for_fn_and_ty, |
19 | 19 | ) |
20 | | -from numba.cuda.np.ufunc_db import _fill_ufunc_db |
21 | 20 |
|
22 | 21 |
|
23 | 22 | def get_ufunc_info(ufunc_key): |
@@ -683,6 +682,66 @@ def np_real_atanh_impl(context, builder, sig, args): |
683 | 682 | "D->D": npyfuncs.np_complex_log10_impl, |
684 | 683 | } |
685 | 684 |
|
686 | | - _fill_ufunc_db(db) |
| 685 | + db[np.isnan] = { |
| 686 | + "f->?": npyfuncs.np_real_isnan_impl, |
| 687 | + "d->?": npyfuncs.np_real_isnan_impl, |
| 688 | + "F->?": npyfuncs.np_complex_isnan_impl, |
| 689 | + "D->?": npyfuncs.np_complex_isnan_impl, |
| 690 | + # int8 |
| 691 | + "b->?": npyfuncs.np_int_isnan_impl, |
| 692 | + "B->?": npyfuncs.np_int_isnan_impl, |
| 693 | + # int16 |
| 694 | + "h->?": npyfuncs.np_int_isnan_impl, |
| 695 | + "H->?": npyfuncs.np_int_isnan_impl, |
| 696 | + # int32 |
| 697 | + "i->?": npyfuncs.np_int_isnan_impl, |
| 698 | + "I->?": npyfuncs.np_int_isnan_impl, |
| 699 | + # int64 |
| 700 | + "l->?": npyfuncs.np_int_isnan_impl, |
| 701 | + "L->?": npyfuncs.np_int_isnan_impl, |
| 702 | + # intp |
| 703 | + "q->?": npyfuncs.np_int_isnan_impl, |
| 704 | + "Q->?": npyfuncs.np_int_isnan_impl, |
| 705 | + # boolean |
| 706 | + "?->?": npyfuncs.np_int_isnan_impl, |
| 707 | + # datetime & timedelta |
| 708 | + "m->?": npyfuncs.np_datetime_isnat_impl, |
| 709 | + "M->?": npyfuncs.np_datetime_isnat_impl, |
| 710 | + } |
| 711 | + |
| 712 | + db[np.conjugate] = { |
| 713 | + "b->b": numbers.real_conjugate_impl, |
| 714 | + "B->B": numbers.real_conjugate_impl, |
| 715 | + "h->h": numbers.real_conjugate_impl, |
| 716 | + "H->H": numbers.real_conjugate_impl, |
| 717 | + "i->i": numbers.real_conjugate_impl, |
| 718 | + "I->I": numbers.real_conjugate_impl, |
| 719 | + "l->l": numbers.real_conjugate_impl, |
| 720 | + "L->L": numbers.real_conjugate_impl, |
| 721 | + "q->q": numbers.real_conjugate_impl, |
| 722 | + "Q->Q": numbers.real_conjugate_impl, |
| 723 | + "f->f": numbers.real_conjugate_impl, |
| 724 | + "d->d": numbers.real_conjugate_impl, |
| 725 | + "F->F": numbers.complex_conjugate_impl, |
| 726 | + "D->D": numbers.complex_conjugate_impl, |
| 727 | + } |
| 728 | + |
| 729 | + if np.divide != np.true_divide: |
| 730 | + db[np.divide] = { |
| 731 | + "bb->b": npyfuncs.np_int_sdiv_impl, |
| 732 | + "BB->B": npyfuncs.np_int_udiv_impl, |
| 733 | + "hh->h": npyfuncs.np_int_sdiv_impl, |
| 734 | + "HH->H": npyfuncs.np_int_udiv_impl, |
| 735 | + "ii->i": npyfuncs.np_int_sdiv_impl, |
| 736 | + "II->I": npyfuncs.np_int_udiv_impl, |
| 737 | + "ll->l": npyfuncs.np_int_sdiv_impl, |
| 738 | + "LL->L": npyfuncs.np_int_udiv_impl, |
| 739 | + "qq->q": npyfuncs.np_int_sdiv_impl, |
| 740 | + "QQ->Q": npyfuncs.np_int_udiv_impl, |
| 741 | + "ff->f": npyfuncs.np_real_div_impl, |
| 742 | + "dd->d": npyfuncs.np_real_div_impl, |
| 743 | + "FF->F": npyfuncs.np_complex_div_impl, |
| 744 | + "DD->D": npyfuncs.np_complex_div_impl, |
| 745 | + } |
687 | 746 |
|
688 | 747 | return db |
0 commit comments