• Home
  • Raw
  • Download

Lines Matching refs:itemsize

109 ndbuf_new(Py_ssize_t nitems, Py_ssize_t itemsize, Py_ssize_t offset, int flags)  in ndbuf_new()  argument
115 len = nitems * itemsize; in ndbuf_new()
116 if (offset % itemsize) { in ndbuf_new()
121 if (offset < 0 || offset+itemsize > len) { in ndbuf_new()
151 base->itemsize = 1; in ndbuf_new()
302 Py_ssize_t itemsize) in pack_from_list() argument
345 offset = PyLong_FromSsize_t(i*itemsize); in pack_from_list()
395 pack_single(char *ptr, PyObject *item, const char *fmt, Py_ssize_t itemsize) in pack_single() argument
416 mview = PyMemoryView_FromMemory(ptr, itemsize, PyBUF_WRITE); in pack_single()
473 copy_rec(const Py_ssize_t *shape, Py_ssize_t ndim, Py_ssize_t itemsize, in copy_rec() argument
484 dstrides[0] == itemsize && sstrides[0] == itemsize) { in copy_rec()
485 memmove(dptr, sptr, shape[0] * itemsize); in copy_rec()
490 for (i=0, p=mem; i<shape[0]; p+=itemsize, sptr+=sstrides[0], i++) { in copy_rec()
492 memcpy(p, xsptr, itemsize); in copy_rec()
494 for (i=0, p=mem; i<shape[0]; p+=itemsize, dptr+=dstrides[0], i++) { in copy_rec()
496 memcpy(xdptr, p, itemsize); in copy_rec()
506 copy_rec(shape+1, ndim-1, itemsize, in copy_rec()
519 dest->itemsize != src->itemsize || in cmp_structure()
551 dest->strides[dest->ndim-1] != dest->itemsize || in copy_buffer()
552 src->strides[src->ndim-1] != src->itemsize) { in copy_buffer()
553 mem = PyMem_Malloc(dest->shape[dest->ndim-1] * dest->itemsize); in copy_buffer()
560 copy_rec(dest->shape, dest->ndim, dest->itemsize, in copy_buffer()
572 unpack_single(char *ptr, const char *fmt, Py_ssize_t itemsize) in unpack_single() argument
578 itemsize = 1; in unpack_single()
585 mview = PyMemoryView_FromMemory(ptr, itemsize, PyBUF_READ); in unpack_single()
612 const Py_ssize_t *suboffsets, Py_ssize_t ndim, Py_ssize_t itemsize) in unpack_rec() argument
622 memcpy(item, ptr, itemsize); in unpack_rec()
644 ndim-1, itemsize); in unpack_rec()
686 strides[0] = base->itemsize; in ndarray_as_list()
708 item = PyMem_Malloc(base->itemsize); in ndarray_as_list()
714 mview = PyMemoryView_FromMemory(item, base->itemsize, PyBUF_WRITE); in ndarray_as_list()
720 base->ndim, base->itemsize); in ndarray_as_list()
789 Py_ssize_t itemsize; in get_itemsize() local
794 itemsize = PyLong_AsSsize_t(tmp); in get_itemsize()
797 return itemsize; in get_itemsize()
823 Py_ssize_t itemsize) in init_simple() argument
833 ret = pack_from_list(mview, items, format, itemsize); in init_simple()
839 base->itemsize = itemsize; in init_simple()
899 s[0] = base->itemsize; in strides_from_shape()
904 s[base->ndim-1] = base->itemsize; in strides_from_shape()
929 verify_structure(Py_ssize_t len, Py_ssize_t itemsize, Py_ssize_t offset, in verify_structure() argument
938 if (ndim == 0 && (offset < 0 || offset+itemsize > len)) in verify_structure()
942 if (strides[n] % itemsize) { in verify_structure()
959 if (imin + offset < 0 || imax + offset + itemsize > len) in verify_structure()
1116 base->len *= base->itemsize; in init_len()
1150 if (verify_structure(base->len, base->itemsize, ndbuf->offset, in init_structure()
1183 Py_ssize_t itemsize; in init_ndbuf() local
1212 itemsize = get_itemsize(format); in init_ndbuf()
1213 if (itemsize <= 0) { in init_ndbuf()
1214 if (itemsize == 0) { in init_ndbuf()
1241 ndbuf = ndbuf_new(nitems, itemsize, offset, flags); in init_ndbuf()
1248 if (init_simple(ndbuf, items, format, itemsize) < 0) in init_ndbuf()
1578 ptr += base->itemsize * index; in ptr_from_index()
1604 return unpack_single(ptr, base->format, base->itemsize); in ndarray_item()
1788 return unpack_single(base->buf, base->format, base->itemsize); in ndarray_subscript()
1886 return pack_single(ptr, value, dest->format, dest->itemsize); in ndarray_ass_subscript()
1903 return pack_single(ptr, value, dest->format, dest->itemsize); in ndarray_ass_subscript()
2046 return PyLong_FromSsize_t(base->itemsize); in ndarray_get_itemsize()
2347 ret = unpack_single(ptr, view.format, view.itemsize); in get_pointer()
2535 v1.itemsize != v2.itemsize || in cmp_contig()