ashvardanian / SimSIMD

Up to 200x Faster Inner Products and Vector Similarity — for Python, JavaScript, Rust, C, and Swift, supporting f64, f32, f16 real & complex, i8, and binary vectors using SIMD for both x86 AVX2 & AVX-512 and Arm NEON & SVE 📐
https://ashvardanian.com/posts/simsimd-faster-scipy/
Apache License 2.0
794 stars 42 forks source link

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

Open MarkReedZ opened 1 month ago

MarkReedZ commented 1 month 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 1 month ago

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

MarkReedZ commented 1 month 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 1 month ago

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