feat(const_eval): impl. cosh

This commit is contained in:
Erich Gubler 2023-12-22 07:47:37 -05:00
parent 7528b22e57
commit 12b11f870b
2 changed files with 4 additions and 0 deletions

View File

@ -45,6 +45,7 @@ Bottom level categories:
- [#4879](https://github.com/gfx-rs/wgpu/pull/4879) by @ErichDonGubler:
- `abs`
- `cos`
- `cosh`
- `round`
- `saturate`
- `sin`

View File

@ -837,6 +837,9 @@ impl<'a> ConstantEvaluator<'a> {
crate::MathFunction::Cos => {
component_wise_float!(self, span, [arg], |e| { Ok([e.cos()]) })
}
crate::MathFunction::Cosh => {
component_wise_float!(self, span, [arg], |e| { Ok([e.cosh()]) })
}
crate::MathFunction::Round => {
// TODO: Use `f{32,64}.round_ties_even()` when available on stable. This polyfill
// is shamelessly [~~stolen from~~ inspired by `ndarray-image`][polyfill source],