MCPcopy Create free account
hub / github.com/numpy/numpy / npy_fastputmask_impl

Function npy_fastputmask_impl

numpy/core/src/multiarray/item_selection.c:567–594  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

565
566
567static NPY_GCC_OPT_3 inline void
568npy_fastputmask_impl(
569 char *dest, char *src, const npy_bool *mask_data,
570 npy_intp ni, npy_intp nv, npy_intp chunk)
571{
572 if (nv == 1) {
573 for (npy_intp i = 0; i < ni; i++) {
574 if (mask_data[i]) {
575 memmove(dest, src, chunk);
576 }
577 dest += chunk;
578 }
579 }
580 else {
581 char *tmp_src = src;
582 for (npy_intp i = 0, j = 0; i < ni; i++, j++) {
583 if (NPY_UNLIKELY(j >= nv)) {
584 j = 0;
585 tmp_src = src;
586 }
587 if (mask_data[i]) {
588 memmove(dest, tmp_src, chunk);
589 }
590 dest += chunk;
591 tmp_src += chunk;
592 }
593 }
594}
595
596
597/*

Callers 1

npy_fastputmaskFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected