| 762 | } |
| 763 | |
| 764 | static NPY_GCC_OPT_3 inline int |
| 765 | npy_fastrepeat_impl( |
| 766 | npy_intp n_outer, npy_intp n, npy_intp nel, npy_intp chunk, |
| 767 | npy_bool broadcast, npy_intp* counts, char* new_data, char* old_data, |
| 768 | npy_intp elsize, NPY_cast_info cast_info, int needs_refcounting) |
| 769 | { |
| 770 | npy_intp i, j, k; |
| 771 | for (i = 0; i < n_outer; i++) { |
| 772 | for (j = 0; j < n; j++) { |
| 773 | npy_intp tmp = broadcast ? counts[0] : counts[j]; |
| 774 | for (k = 0; k < tmp; k++) { |
| 775 | if (!needs_refcounting) { |
| 776 | memcpy(new_data, old_data, chunk); |
| 777 | } |
| 778 | else { |
| 779 | char *data[2] = {old_data, new_data}; |
| 780 | npy_intp strides[2] = {elsize, elsize}; |
| 781 | if (cast_info.func(&cast_info.context, data, &nel, |
| 782 | strides, cast_info.auxdata) < 0) { |
| 783 | return -1; |
| 784 | } |
| 785 | } |
| 786 | new_data += chunk; |
| 787 | } |
| 788 | old_data += chunk; |
| 789 | } |
| 790 | } |
| 791 | return 0; |
| 792 | } |
| 793 | |
| 794 | static NPY_GCC_OPT_3 int |
| 795 | npy_fastrepeat( |