Home
last modified time | relevance | path

Searched refs:itemsize (Results 1 – 25 of 51) sorted by relevance

123

/third_party/python/Modules/
Darraymodule.c34 int itemsize; member
171 if (_new_size <= ((~(size_t)0) / self->ob_descr->itemsize)) in array_resize()
172 PyMem_RESIZE(items, char, (_new_size * self->ob_descr->itemsize)); in array_resize()
593 if (size > PY_SSIZE_T_MAX / descr->itemsize) { in newarrayobject()
596 nbytes = size * descr->itemsize; in newarrayobject()
656 memmove(items + (where+1)*self->ob_descr->itemsize, in ins1()
657 items + where*self->ob_descr->itemsize, in ins1()
658 (n-where)*self->ob_descr->itemsize); in ins1()
834 memcpy(np->ob_item, a->ob_item + ilow * a->ob_descr->itemsize, in array_slice()
835 (ihigh-ilow) * a->ob_descr->itemsize); in array_slice()
[all …]
D_testbuffer.c109 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
[all …]
D_operator.c1135 .itemsize = 0,
1467 .itemsize = 0,
1723 .itemsize = 0,
D_struct.c1306 Py_ssize_t size, len, num, itemsize; in prepare_s() local
1358 itemsize = e->size; in prepare_s()
1364 if (num > (PY_SSIZE_T_MAX - size) / itemsize) in prepare_s()
1366 size += num * itemsize; in prepare_s()
/third_party/python/Objects/
Dmemoryobject.c228 ((view)->shape[0] == 1 || (view)->strides[0] == (view)->itemsize)
264 dest->strides[dest->ndim-1] == dest->itemsize && in last_dim_is_contiguous()
265 src->strides[src->ndim-1] == src->itemsize); in last_dim_is_contiguous()
284 dest->itemsize != src->itemsize) { in equiv_format()
332 copy_base(const Py_ssize_t *shape, Py_ssize_t itemsize, in copy_base() argument
338 Py_ssize_t size = shape[0] * itemsize; in copy_base()
347 for (i=0, p=mem; i < shape[0]; p+=itemsize, sptr+=sstrides[0], i++) { in copy_base()
349 memcpy(p, xsptr, itemsize); in copy_base()
351 for (i=0, p=mem; i < shape[0]; p+=itemsize, dptr+=dstrides[0], i++) { in copy_base()
353 memcpy(xdptr, p, itemsize); in copy_base()
[all …]
Dabstract.c422 sd = view->itemsize; in _IsFortranContiguous()
449 sd = view->itemsize; in _IsCContiguous()
531 Py_ssize_t itemsize = -1; in PyBuffer_SizeFromFormat() local
535 return itemsize; in PyBuffer_SizeFromFormat()
553 itemsize = PyLong_AsSsize_t(res); in PyBuffer_SizeFromFormat()
554 if (itemsize < 0) { in PyBuffer_SizeFromFormat()
563 return itemsize; in PyBuffer_SizeFromFormat()
606 elements = len / view->itemsize; in PyBuffer_FromContiguous()
609 memcpy(ptr, src, view->itemsize); in PyBuffer_FromContiguous()
610 src += view->itemsize; in PyBuffer_FromContiguous()
[all …]
Dpicklebufobject.c171 mv->view.itemsize = 1; in picklebuf_raw()
175 mv->view.strides = &mv->view.itemsize; in picklebuf_raw()
/third_party/python/Lib/test/
Dtest_buffer.py264 def strides_from_shape(ndim, shape, itemsize, layout): argument
270 strides = list(shape[1:]) + [itemsize]
274 strides = [itemsize] + list(shape[:-1])
435 def verify_structure(memlen, itemsize, ndim, shape, strides, offset): argument
442 if offset % itemsize:
444 if offset < 0 or offset+itemsize > memlen:
446 if any(v % itemsize for v in strides):
459 return 0 <= offset+imin and offset+imax+itemsize <= memlen
468 memlen, itemsize, ndim, shape, strides, offset = t
478 memlen, itemsize, ndim, shape, strides, offset = t
[all …]
Dtest_memoryview.py186 self.assertEqual(m.itemsize, self.itemsize)
190 self.assertEqual(m.strides, (self.itemsize,))
266 with check: m.itemsize
408 itemsize = 1 variable in BaseBytesMemoryTests
415 itemsize = array.array('i').itemsize variable in BaseArrayMemoryTests
Dtest_picklebuffer.py25 self.assertEqual(m.itemsize, expected.itemsize)
Dtest_array.py19 sizeof_wchar = array.array('u').itemsize
214 self.assertGreaterEqual(a.itemsize, self.minitemsize)
242 if a.itemsize in (1, 2, 4, 8):
245 if a.itemsize==1:
518 if a.itemsize>1:
1121 self.assertEqual(len(a) * a.itemsize, 4)
1127 buffer_size = a.buffer_info()[1] * a.itemsize
1185 self.assertEqual(a.itemsize, sizeof_wchar)
1334 lower = -1 * int(pow(2, a.itemsize * 8 - 1))
1335 upper = int(pow(2, a.itemsize * 8 - 1)) - 1
[all …]
Dtest_ioctl.py41 intsize = buf.itemsize
/third_party/python/Doc/c-api/
Dbuffer.rst116 ``product(shape) * itemsize``. For contiguous arrays, this is the length
130 .. c:member:: Py_ssize_t itemsize
137 be set to ``NULL``, but :c:member:`~Py_buffer.itemsize` still has
141 ``product(shape) * itemsize == len`` still holds and the consumer
142 can use :c:member:`~Py_buffer.itemsize` to navigate the buffer.
146 :c:member:`~Py_buffer.itemsize` and assume ``itemsize == 1``.
171 ``shape[0] * ... * shape[ndim-1] * itemsize`` MUST be equal to
235 :c:member:`~Py_buffer.len`, :c:member:`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`.
347 The logical structure of NumPy-style arrays is defined by :c:member:`~Py_buffer.itemsize`,
351 interpreted as a scalar of size :c:member:`~Py_buffer.itemsize`. In that case,
[all …]
/third_party/python/Lib/ctypes/test/
Dtest_pep3118.py32 self.assertEqual(v.itemsize, sizeof(itemtp))
46 self.assertEqual(n * v.itemsize, len(v.tobytes()))
62 self.assertEqual(v.itemsize, sizeof(itemtp))
/third_party/python/Lib/multiprocessing/
Dconnection.py187 if m.itemsize > 1:
230 itemsize = m.itemsize
231 bytesize = itemsize * len(m)
242 result.readinto(m[offset // itemsize :
243 (offset + size) // itemsize])
Dreduction.py156 bytes_size = a.itemsize * size
169 if len(cmsg_data) % a.itemsize != 0:
/third_party/gstreamer/gstplugins_bad/ext/opencv/
DMotionCells.cpp80 m_header.itemsize = 0; in MotionCells()
308 m_header.itemsize = in initDataFile()
346 GINT32_FROM_BE (m_header.itemsize) - sizeof (mc_data.timestamp)); in saveMotionCells()
376 GINT32_FROM_BE (m_header.itemsize) - sizeof (mc_data.timestamp), 1, in saveMotionCells()
DMotionCells.h67 gint32 itemsize; member
/third_party/python/Doc/library/
Darray.rst63 through the :attr:`itemsize` attribute.
99 .. attribute:: array.itemsize
114 array.itemsize``. This is occasionally useful when working with low-level (and
/third_party/tzdata/
Dzic.c492 size_product(ptrdiff_t nitems, ptrdiff_t itemsize) in size_product() argument
496 if (!ckd_mul(&product, nitems, itemsize) && product <= INDEX_MAX) in size_product()
499 ptrdiff_t nitems_max = INDEX_MAX / itemsize; in size_product()
501 return nitems * itemsize; in size_product()
549 grow_nitems_alloc(ptrdiff_t *nitems_alloc, ptrdiff_t itemsize) in grow_nitems_alloc() argument
555 && !ckd_mul(&product, *nitems_alloc, itemsize) && product <= INDEX_MAX) in grow_nitems_alloc()
558 if (*nitems_alloc <= ((INDEX_MAX - 1) / 3 * 2) / itemsize) { in grow_nitems_alloc()
560 return *nitems_alloc * itemsize; in grow_nitems_alloc()
567 growalloc(void *ptr, ptrdiff_t itemsize, ptrdiff_t nitems, in growalloc() argument
572 : erealloc(ptr, grow_nitems_alloc(nitems_alloc, itemsize))); in growalloc()
/third_party/python/Lib/
Dsocket.py573 _socket.CMSG_LEN(maxfds * fds.itemsize))
577 len(cmsg_data) - (len(cmsg_data) % fds.itemsize)])
/third_party/python/Include/cpython/
Dabstract.h313 int itemsize,
Dobject.h53 Py_ssize_t itemsize; /* This is Py_ssize_t so it can be member
/third_party/mesa3d/docs/relnotes/
D11.0.7.rst59 - r600: geometry shader gsvs itemsize workaround
/third_party/rust/crates/minimal-lexical/etc/correctness/test-parse-unittests/
Dto_toml.py57 return '{0:0{1}x}'.format(self.to_bits(), self.value.itemsize * 2)

123