Home
last modified time | relevance | path

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

123

/external/python/cpython2/Modules/
Darraymodule.c26 int itemsize; member
78 if (_new_size <= ((~(size_t)0) / self->ob_descr->itemsize)) in array_resize()
79 PyMem_RESIZE(items, char, (_new_size * self->ob_descr->itemsize)); in array_resize()
426 nbytes = size * descr->itemsize; in newarrayobject()
428 if (nbytes / descr->itemsize != (size_t)size) { in newarrayobject()
486 memmove(items + (where+1)*self->ob_descr->itemsize, in ins1()
487 items + where*self->ob_descr->itemsize, in ins1()
488 (n-where)*self->ob_descr->itemsize); in ins1()
624 memcpy(np->ob_item, a->ob_item + ilow * a->ob_descr->itemsize, in array_slice()
625 (ihigh-ilow) * a->ob_descr->itemsize); in array_slice()
[all …]
D_testcapimodule.c391 Py_ssize_t itemsize = sizeof(int); in test_to_contiguous() local
393 Py_ssize_t strides = 2 * itemsize; in test_to_contiguous()
397 5 * itemsize, in test_to_contiguous()
398 itemsize, in test_to_contiguous()
420 view.strides[0] = -2 * itemsize; in test_to_contiguous()
439 Py_ssize_t itemsize = sizeof(int); in test_from_contiguous() local
441 Py_ssize_t strides = 2 * itemsize; in test_from_contiguous()
445 5 * itemsize, in test_from_contiguous()
446 itemsize, in test_from_contiguous()
470 view.strides[0] = -2 * itemsize; in test_from_contiguous()
/external/python/cpython3/Modules/
Darraymodule.c31 int itemsize; member
159 if (_new_size <= ((~(size_t)0) / self->ob_descr->itemsize)) in array_resize()
160 PyMem_RESIZE(items, char, (_new_size * self->ob_descr->itemsize)); in array_resize()
587 if (size > PY_SSIZE_T_MAX / descr->itemsize) { in newarrayobject()
590 nbytes = size * descr->itemsize; in newarrayobject()
647 memmove(items + (where+1)*self->ob_descr->itemsize, in ins1()
648 items + where*self->ob_descr->itemsize, in ins1()
649 (n-where)*self->ob_descr->itemsize); in ins1()
811 memcpy(np->ob_item, a->ob_item + ilow * a->ob_descr->itemsize, in array_slice()
812 (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 …]
/external/python/cpython2/Objects/
Dmemoryobject.c116 Py_ssize_t *strides, Py_ssize_t itemsize, char fort) in _strided_copy_nd() argument
122 memcpy(dest, src, itemsize); in _strided_copy_nd()
126 memcpy(dest, src, itemsize); in _strided_copy_nd()
127 dest += itemsize; in _strided_copy_nd()
138 outstride = itemsize; in _strided_copy_nd()
144 strides, itemsize, fort); in _strided_copy_nd()
156 outstride = itemsize; in _strided_copy_nd()
162 strides+1, itemsize, in _strided_copy_nd()
208 memcpy(dest, ptr, view->itemsize); in _indirect_copy_nd()
209 dest += view->itemsize; in _indirect_copy_nd()
[all …]
Dabstract.c380 sd = view->itemsize; in _IsFortranContiguous()
401 sd = view->itemsize; in _IsCContiguous()
522 elements = len / view->itemsize; in PyBuffer_ToContiguous()
525 memcpy(dest, ptr, view->itemsize); in PyBuffer_ToContiguous()
526 dest += view->itemsize; in PyBuffer_ToContiguous()
573 elements = len / view->itemsize; in PyBuffer_FromContiguous()
576 memcpy(ptr, src, view->itemsize); in PyBuffer_FromContiguous()
577 src += view->itemsize; in PyBuffer_FromContiguous()
647 memcpy(dptr, sptr, view_src.itemsize); in PyObject_CopyData()
657 Py_ssize_t *strides, int itemsize, in PyBuffer_FillContiguousStrides() argument
[all …]
/external/python/cpython3/Objects/
Dmemoryobject.c212 ((view)->shape[0] == 1 || (view)->strides[0] == (view)->itemsize)
254 dest->strides[dest->ndim-1] == dest->itemsize && in last_dim_is_contiguous()
255 src->strides[src->ndim-1] == src->itemsize); in last_dim_is_contiguous()
274 dest->itemsize != src->itemsize) { in equiv_format()
322 copy_base(const Py_ssize_t *shape, Py_ssize_t itemsize, in copy_base() argument
328 Py_ssize_t size = shape[0] * itemsize; in copy_base()
337 for (i=0, p=mem; i < shape[0]; p+=itemsize, sptr+=sstrides[0], i++) { in copy_base()
339 memcpy(p, xsptr, itemsize); in copy_base()
341 for (i=0, p=mem; i < shape[0]; p+=itemsize, dptr+=dstrides[0], i++) { in copy_base()
343 memcpy(xdptr, p, itemsize); in copy_base()
[all …]
Dabstract.c396 sd = view->itemsize; in _IsFortranContiguous()
423 sd = view->itemsize; in _IsCContiguous()
538 elements = len / view->itemsize; in PyBuffer_FromContiguous()
541 memcpy(ptr, src, view->itemsize); in PyBuffer_FromContiguous()
542 src += view->itemsize; in PyBuffer_FromContiguous()
612 memcpy(dptr, sptr, view_src.itemsize); in PyObject_CopyData()
622 Py_ssize_t *strides, int itemsize, in PyBuffer_FillContiguousStrides() argument
628 sd = itemsize; in PyBuffer_FillContiguousStrides()
667 view->itemsize = 1; in PyBuffer_FillInfo()
677 view->strides = &(view->itemsize); in PyBuffer_FillInfo()
/external/python/cpython3/Lib/test/
Dtest_buffer.py256 def strides_from_shape(ndim, shape, itemsize, layout): argument
262 strides = list(shape[1:]) + [itemsize]
266 strides = [itemsize] + list(shape[:-1])
427 def verify_structure(memlen, itemsize, ndim, shape, strides, offset): argument
434 if offset % itemsize:
436 if offset < 0 or offset+itemsize > memlen:
438 if any(v % itemsize for v in strides):
451 return 0 <= offset+imin and offset+imax+itemsize <= memlen
460 memlen, itemsize, ndim, shape, strides, offset = t
470 memlen, itemsize, ndim, shape, strides, offset = t
[all …]
Dtest_memoryview.py184 self.assertEqual(m.itemsize, self.itemsize)
188 self.assertEqual(m.strides, (self.itemsize,))
264 with check: m.itemsize
395 itemsize = 1 variable in BaseBytesMemoryTests
402 itemsize = array.array('i').itemsize variable in BaseArrayMemoryTests
Dtest_array.py17 sizeof_wchar = array.array('u').itemsize
195 self.assertGreaterEqual(a.itemsize, self.minitemsize)
223 if a.itemsize in (1, 2, 4, 8):
226 if a.itemsize==1:
443 if a.itemsize>1:
458 if a.itemsize>1:
1049 self.assertEqual(len(a) * a.itemsize, 4)
1055 buffer_size = a.buffer_info()[1] * a.itemsize
1113 self.assertEqual(a.itemsize, sizeof_wchar)
1260 lower = -1 * int(pow(2, a.itemsize * 8 - 1))
[all …]
Dtest_ioctl.py40 intsize = buf.itemsize
/external/python/cpython3/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 …]
/external/python/cpython2/Lib/ctypes/test/
Dtest_pep3118.py32 self.assertEqual(v.itemsize, sizeof(itemtp))
43 self.assertEqual(n * v.itemsize, len(v.tobytes()))
59 self.assertEqual(v.itemsize, sizeof(itemtp))
/external/python/cpython3/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))
/external/python/cpython2/Lib/test/
Dtest_memoryview.py179 self.assertEqual(m.itemsize, self.itemsize)
183 self.assertEqual(m.strides, (self.itemsize,))
256 itemsize = 1 variable in BaseBytesMemoryTests
Dtest_array.py74 self.assertGreaterEqual(a.itemsize, self.minitemsize)
98 if a.itemsize in (1, 2, 4, 8):
101 if a.itemsize==1:
263 if a.itemsize>1:
996 lower = -1 * long(pow(2, a.itemsize * 8 - 1))
997 upper = long(pow(2, a.itemsize * 8 - 1)) - 1L
1009 upper = long(pow(2, a.itemsize * 8)) - 1L
1016 buffer_size = a.buffer_info()[1] * a.itemsize
1089 if a.itemsize in (1, 2, 4, 8):
1092 if a.itemsize==1:
Dtest_ioctl.py40 intsize = buf.itemsize
/external/libxml2/os400/
Dxmllintcl.c30 #define paramlist(itemsize, itemtype) \ argument
34 char _pad[itemsize]; \
Dxmlcatlgcl.c30 #define paramlist(itemsize, itemtype) \ argument
34 char _pad[itemsize]; \
/external/python/cpython3/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.py152 bytes_size = a.itemsize * size
165 if len(cmsg_data) % a.itemsize != 0:
/external/python/cpython2/Doc/c-api/
Dbuffer.rst84 ``((*shape)[0] * ... * (*shape)[ndims-1])*itemsize`` should be equal to
122 .. c:member:: Py_ssize_t itemsize
124 This is a storage for the itemsize (in bytes) of each element of the
128 to know the itemsize for proper interpretation of striding. Therefore,
270 Return the implied :c:data:`~Py_buffer.itemsize` from the struct-stype
281 …illContiguousStrides(int ndims, Py_ssize_t *shape, Py_ssize_t *strides, int itemsize, char fortran)
/external/python/cpython3/Doc/library/
Darray.rst69 through the :attr:`itemsize` attribute.
104 .. attribute:: array.itemsize
119 array.itemsize``. This is occasionally useful when working with low-level (and
/external/python/cpython2/Doc/library/
Darray.rst53 through the :attr:`itemsize` attribute. The values stored for ``'L'`` and
93 .. attribute:: array.itemsize
108 array.itemsize``. This is occasionally useful when working with low-level (and

123