pub unsafe extern "C" fn mlirDenseElementsAttrRawBufferGet(
    shapedType: MlirType,
    rawBufferSize: usize,
    rawBuffer: *const c_void
) -> MlirAttribute
Expand description

Creates a dense elements attribute with the given Shaped type and elements populated from a packed, row-major opaque buffer of contents.

The format of the raw buffer is a densely packed array of values that can be bitcast to the storage format of the element type specified. Types that are not byte aligned will be:

  • For bitwidth > 1: Rounded up to the next byte.
  • For bitwidth = 1: Packed into 8bit bytes with bits corresponding to the linear order of the shape type from MSB to LSB, padded to on the right.

A raw buffer of a single element (or for 1-bit, a byte of value 0 or 255) will be interpreted as a splat. User code should be prepared for additional, conformant patterns to be identified as splats in the future.