Skip to content

Commit

Permalink
many, many small and moderate-size changes:
Browse files Browse the repository at this point in the history
* introduced scalar_t, which lists scalar type options: int, int8, ...int64, ... half, float, double, bool, char. The type replaces NN.Ast.nntyp_t. It can also be used in OpenCV bindings, but not yet
* extended many NN operations to support FP16
* accelerated fp16 <=> float conversions in default C branch (non-NEON, non-AVX2)
* accelerated vector exponent (currently available only in NEON configuration)
* extended GEMM to support various combinations of input/output data types, including complete FP16 support. For example, alpha * A (F16) * B (F32) + beta * C (F32) => result (F16) is supported.
  • Loading branch information
vpisarev committed Aug 2, 2022
1 parent db58554 commit 61a744e
Show file tree
Hide file tree
Showing 29 changed files with 6,612 additions and 6,750 deletions.
2 changes: 1 addition & 1 deletion compiler/C_form.fx
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ fun ctyp2str(t: ctyp_t, loc: loc_t) =
| CTypSize_t => ("size_t", noid)
| CTypSInt b => (f"int{b}_t", noid)
| CTypUInt b => (f"uint{b}_t", noid)
| CTypFloat 16 => ("fx_f16_t", noid)
| CTypFloat 16 => ("fx_f16", noid)
| CTypFloat 32 => ("float", noid)
| CTypFloat 64 => ("double", noid)
| CTypFloat b => throw compile_err(loc, f"invalid type CTypFloat({b})")
Expand Down
2 changes: 1 addition & 1 deletion compiler/bootstrap/C_form.c
Original file line number Diff line number Diff line change
Expand Up @@ -13348,7 +13348,7 @@ FX_EXTERN_C int _fx_M6C_formFM8ctyp2strT2SR9Ast__id_t2N14C_form__ctyp_tR10Ast__l
}
if (tag_0 == 6) {
if (t_0->u.CTypFloat == 16) {
fx_str_t slit_7 = FX_MAKE_STR("fx_f16_t");
fx_str_t slit_7 = FX_MAKE_STR("fx_f16");
_fx_make_T2SR9Ast__id_t(&slit_7, &_fx_g9Ast__noid, fx_result);
goto _fx_endmatch_0;
}
Expand Down
Loading

0 comments on commit 61a744e

Please sign in to comment.