commit | 06c5edf8178bb2f078d28b882f9d855a312d62f2 | [log] [tgz] |
---|---|---|
author | Bob Badour <bbadour@google.com> | Tue Mar 23 14:30:10 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Mar 23 14:30:10 2021 +0000 |
tree | 9f16e59a90dd71814ef5eb0789e874819203fe52 | |
parent | 4db16106b5651485f92afe98563a14e1804b3c64 [diff] | |
parent | 9dc9ddb7a198e3a60c2f51f9e0648ade2e3238dd [diff] |
[LSC] Add LOCAL_LICENSE_KINDS to external/rust/crates/half am: 60b2ede2a5 am: 9dc9ddb7a1 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/half/+/1649538 Change-Id: Ia48b06689af4445889fd4c64eea5ab4fbc29a585
f16
and bf16
floating point types for RustThis crate implements a half-precision floating point f16
type for Rust implementing the IEEE 754-2008 standard binary16
a.k.a half
format, as well as a bf16
type implementing the bfloat16
format.
The f16
and bf16
types provides conversion operations as a normal Rust floating point type, but since they are primarily leveraged for minimal floating point storage and most major hardware does not implement them, all math operations should be done as an f32
type.
This crate provides no_std
support by default so can easily be used in embedded code where a smaller float format is most useful.
Requries Rust 1.32 or greater. If you need support for older versions of Rust, use versions 1.3 and earlier of this crate.
See the crate documentation for more details.
serde
- Implement Serialize
and Deserialize
traits for f16
and bf16
. This adds a dependency on the serde
crate.
use-intrinsics
- Use hardware intrinsics for f16
and bf16
conversions if available on the compiler host target. By default, without this feature, conversions are done only in software, which will be the fallback if the host target does not have hardware support. Available only on Rust nightly channel.
alloc
- Enable use of the alloc
crate when not using the std
library.
This enables the vec
module, which contains zero-copy conversions for the Vec
type. This allows fast conversion between raw Vec<u16>
bits and Vec<f16>
or Vec<bf16>
arrays, and vice versa. Requires Rust 1.36 or greater.
std
- Enable features that depend on the Rust std
library, including everything in the alloc
feature.
Enabling the std
feature enables runtime CPU feature detection when the use-intrsincis
feature is also enabled. Without this feature detection, intrinsics are only used when compiler host target supports them.
This library is distributed under the terms of either of:
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.