https://github.com/janeliascicomp/uint12arrays.jl
Julia package for supporting arrays of 12-bit integers
https://github.com/janeliascicomp/uint12arrays.jl
Last synced: 12 months ago
JSON representation
Julia package for supporting arrays of 12-bit integers
- Host: GitHub
- URL: https://github.com/janeliascicomp/uint12arrays.jl
- Owner: JaneliaSciComp
- License: other
- Created: 2021-05-13T10:48:06.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-08-11T10:13:20.000Z (over 1 year ago)
- Last Synced: 2025-02-14T08:47:05.198Z (12 months ago)
- Language: Julia
- Size: 101 KB
- Stars: 9
- Watchers: 6
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UInt12Arrays.jl
[](https://JaneliaSciComp.github.io/UInt12Arrays.jl/stable/)
[](https://JaneliaSciComp.github.io/UInt12Arrays.jl/dev/)
[](https://github.com/JaneliaSciComp/UInt12Arrays.jl/actions/workflows/CI.yml?query=branch%3Amain)
## Synposis
UInt12Arrays.jl is a Julia package to support the use of arrays of 12-bit
unsigned integers and their elements. This package's main purpose is to
provide a `UInt12Array` type that allows for the indexing into arrays of packed
`UInt12`s.
## Background
Dealing with 12-bit integers is challenging because the the underlying LLVM
integer support is based on integers that are a multiple of a byte (8-bits).
For integer types that are a multiple of a byte, see
[BitIntegers.jl](https://github.com/rfourquet/BitIntegers.jl).
To use unsigned 12-bit integers (`UInt12`) in computations, it is easiest to
load them as unsigned 16-bit integers (`UInt16`). However, to conserve memory
it may be advantageous to keep the 12-bit integers packed into a dense array.
## What this package does
1. Provide a `UInt12Array` that allows for indexing of arrays of packed `UInt12`s.
2. Allow access of 12-bit integers as type `UInt16` (default element type of `UInt12Array`)
3. Provides a prototype `UInt12` type that boxes a `UInt16` and implement 12-bit arithmetic
4. Provides lookup table (LUT) and single instruction multiple data (SIMD) methods for unpacking 12-bit data
## Why is the default element type a `UInt16` rather than `UInt12`?
As mentioned in the background, there is better hardware and compiler support
for `UInt16`. Additionally the supporting code for `UInt12` is under
development with the main implementation being a boxed `UInt16`.