Skip to content

Commit

Permalink
adds mappings for f16 variants of halide float math (#8029)
Browse files Browse the repository at this point in the history
* adds mappings for f16 variants of halide float math

* fix clang format errors

* trigger buildbots

---------

Co-authored-by: Steven Johnson <srj@google.com>
  • Loading branch information
mikewoodworth and steven-johnson authored Jan 16, 2024
1 parent 91b063d commit 8d3c12e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/CodeGen_Metal_Dev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,31 @@ void CodeGen_Metal_Dev::init_module() {
<< "#define tanh_f32 tanh\n"
<< "#define atanh_f32 atanh\n"
<< "#define fast_inverse_sqrt_f32 rsqrt\n"
<< "#define is_nan_f16 isnan\n"
<< "#define is_inf_f16 isinf\n"
<< "#define is_finite_f16 isfinite\n"
<< "#define sqrt_f16 sqrt\n"
<< "#define sin_f16 sin\n"
<< "#define cos_f16 cos\n"
<< "#define exp_f16 exp\n"
<< "#define log_f16 log\n"
<< "#define abs_f16 fabs\n"
<< "#define floor_f16 floor\n"
<< "#define ceil_f16 ceil\n"
<< "#define trunc_f16 trunc\n"
<< "#define pow_f16 pow\n"
<< "#define asin_f16 asin\n"
<< "#define acos_f16 acos\n"
<< "#define tan_f16 tan\n"
<< "#define atan_f16 atan\n"
<< "#define atan2_f16 atan2\n"
<< "#define sinh_f16 sinh\n"
<< "#define asinh_f16 asinh\n"
<< "#define cosh_f16 cosh\n"
<< "#define acosh_f16 acosh\n"
<< "#define tanh_f16 tanh\n"
<< "#define atanh_f16 atanh\n"
<< "#define fast_inverse_sqrt_f16 rsqrt\n"
// This is quite annoying: even though the MSL docs claim
// all versions of Metal support the same memory fence
// names, the truth is that 1.0 does not.
Expand Down

0 comments on commit 8d3c12e

Please sign in to comment.