Skip to main content

Module ndarray_ffi

Module ndarray_ffi 

Source
Expand description

asdf/core/ndarray.h and asdf/core/datatype.h.

§Why the layouts matter here

asdf_ndarray_t and asdf_datatype_t are not opaque. Callers read array->ndim and array->shape[0] directly, and libasdf’s own write example builds an asdf_ndarray_t as a stack literal. So both layouts are reproduced field for field, and the trailing _reserved pointer is where this implementation keeps the state it needs.

Structs§

asdf_datatype_t
Mirror of asdf_datatype_t.
asdf_ndarray_t
Mirror of asdf_ndarray_t.

Enums§

NdarrayErr
Error codes matching asdf_ndarray_err_t.

Functions§

asdf_datatype_size
The size of one element of a datatype, computing it when left at zero.
asdf_get_ndarray
Read the array at path.
asdf_is_ndarray
Whether the value at path is an ndarray.
asdf_ndarray_array_copy
Deep-copy a null-terminated array of ndarrays.
asdf_ndarray_block
The block underlying an array, or null when its data is inline.
asdf_ndarray_compression_set
Set the compression used when the array is written.
asdf_ndarray_copy
Deep-copy an ndarray into fresh storage.
asdf_ndarray_copy_into
Deep-copy an ndarray into caller-provided storage.
asdf_ndarray_data
The array’s data, decompressed if needed.
asdf_ndarray_data_alloc
Allocate a data buffer sized for the array.
asdf_ndarray_data_copy
Allocate the array’s buffer and copy src into it.
asdf_ndarray_data_dealloc
Free a buffer from asdf_ndarray_data_alloc.
asdf_ndarray_data_raw
The array’s data as stored, without decompressing.
asdf_ndarray_deinit
Free an ndarray’s fields without freeing the struct.
asdf_ndarray_destroy
Free an ndarray handle and everything it owns.
asdf_ndarray_nbytes
The number of bytes the elements occupy.
asdf_ndarray_read_all
Read the whole array, converting to dst_t.
asdf_ndarray_read_at
Read one element, converting to dst_t.
asdf_ndarray_read_float32_at
Read one element, converted to this type.
asdf_ndarray_read_float64_at
Read one element, converted to this type.
asdf_ndarray_read_int8_at
Read one element, converted to this type.
asdf_ndarray_read_int16_at
Read one element, converted to this type.
asdf_ndarray_read_int32_at
Read one element, converted to this type.
asdf_ndarray_read_int64_at
Read one element, converted to this type.
asdf_ndarray_read_tile_2d
Read a 2-D tile, converting to dst_t.
asdf_ndarray_read_tile_ndim
Read an N-dimensional tile, converting to dst_t.
asdf_ndarray_read_uint8_at
Read one element, converted to this type.
asdf_ndarray_read_uint16_at
Read one element, converted to this type.
asdf_ndarray_read_uint32_at
Read one element, converted to this type.
asdf_ndarray_read_uint64_at
Read one element, converted to this type.
asdf_ndarray_size
The number of elements.
asdf_ndarray_storage
Where the array’s data will be written.
asdf_ndarray_storage_set
Set where the array’s data will be written.
asdf_scalar_datatype_from_string
The scalar type named by a string, or UNKNOWN.
asdf_scalar_datatype_to_string
The string naming a scalar type.
asdf_set_ndarray
Write an ndarray at path, appending its data as a new block.
asdf_shim_ndarray_read_float16_bits_at
Read one float16 element, returning its raw bit pattern.
asdf_value_as_ndarray
Interpret a value as an array.
asdf_value_is_ndarray
Whether a value is an ndarray, by its tag.
asdf_value_of_ndarray
Build a value for an ndarray, writing its data into a new block.

Type Aliases§

ByteOrderAbi
asdf_byteorder_t as it crosses the boundary.
ScalarTypeAbi
asdf_scalar_datatype_t as it crosses the boundary.