Skip to content

Instantly share code, notes, and snippets.

@fish2000
Created July 28, 2016 19:45
Show Gist options
  • Select an option

  • Save fish2000/143d2ef854fe0035f887b3a2c9287656 to your computer and use it in GitHub Desktop.

Select an option

Save fish2000/143d2ef854fe0035f887b3a2c9287656 to your computer and use it in GitHub Desktop.
Halide buffer_t serialization notes

int32_t extent[0] int32_t extent[1] int32_t extent[2] int32_t extent[3]

int32_t stride[0] int32_t stride[1] int32_t stride[2] int32_t stride[3]

int32_t min[0] int32_t min[1] int32_t min[2] int32_t min[3]

int32_t elem_size

"btz": "buffer_t Z" "imr": short for "imread" "imb": "image buffer" (or maybe "image bytes"?)

Header: "btz" (file marker) + xx 3 @ (endianness) + xx 4

       IIII IIII IIII IIII     (extents)     +      20  20
       IIII IIII IIII IIII     (strides)     +      36
       IIII IIII IIII IIII     (mins)        +      52
       IIII                    (elem_size)   +      56

'b' 't' 'z' '@'

4 + 4 + 4 + 1
    = 13
    * 32
        = 416 bits
        = 52 bytes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment