ashvardanian / SimSIMD

Up to 200x Faster Dot Products & Similarity Metrics — for Python, Rust, C, JS, and Swift, supporting f64, f32, f16 real & complex, i8, and bit vectors using SIMD for both AVX2, AVX-512, NEON, SVE, & SVE2 📐
https://ashvardanian.com/posts/simsimd-faster-scipy/
Apache License 2.0
989 stars 59 forks source link

warning: ISO C does not support the ‘_Float16’ type #122

Closed MarkReedZ closed 3 months ago

MarkReedZ commented 5 months ago

We have the following warnings. I can replace _Float16 with simsimd_f16_t

/home/ch/code/mr/SimSIMD/include/simsimd/probability.h:485:35: warning: ISO C does not support the ‘_Float16’ type [-Wpedantic]
  485 |     __m512h one = _mm512_set1_ph((_Float16)1);
      |                                   ^~~~~~~~
ashvardanian commented 5 months ago

Yes, familiar with that. Do you know of a good way to avoid that warning?

MarkReedZ commented 5 months ago

simsimd_f16_t is _Float16 so I presume this PR is okay, but haven't tested it on sapphire yet. Was there a reason we had to use _Float16 or was it just an oversight?

https://github.com/ashvardanian/SimSIMD/pull/125

ashvardanian commented 5 months ago

I wanted to make it independent from the alias, and used _Float16 similar to Intel docs.