usearch 2.21.4 → 2.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -24
- package/binding.gyp +15 -37
- package/c/CMakeLists.txt +4 -5
- package/c/README.md +7 -7
- package/c/lib.cpp +32 -14
- package/c/test.c +83 -1
- package/c/usearch.h +24 -3
- package/cpp/CMakeLists.txt +4 -0
- package/cpp/README.md +5 -5
- package/cpp/bench.cpp +97 -116
- package/cpp/test.cpp +117 -20
- package/include/usearch/index.hpp +224 -48
- package/include/usearch/index_dense.hpp +105 -40
- package/include/usearch/index_plugins.hpp +1387 -204
- package/javascript/dist/cjs/usearch.d.ts +8 -3
- package/javascript/dist/cjs/usearch.js +12 -4
- package/javascript/dist/esm/usearch.d.ts +8 -3
- package/javascript/dist/esm/usearch.js +12 -4
- package/javascript/lib.cpp +17 -0
- package/javascript/usearch.ts +14 -6
- package/numkong/.clang-tidy +30 -0
- package/{simsimd → numkong}/.cmake-format.py +18 -0
- package/numkong/.editorconfig +12 -0
- package/numkong/.git-blame-ignore-revs +123 -0
- package/numkong/.mailmap +15 -0
- package/numkong/.spi.yml +11 -0
- package/numkong/.swift-format +14 -0
- package/numkong/CITATION.cff +81 -0
- package/numkong/CONTRIBUTING.md +500 -0
- package/numkong/Cargo.toml +54 -0
- package/numkong/MANIFEST.in +8 -0
- package/numkong/Package.swift +84 -0
- package/numkong/README.md +569 -0
- package/numkong/bench/README.md +217 -0
- package/numkong/bench/bench-browser.html +323 -0
- package/numkong/bench/bench.cpp +344 -0
- package/numkong/bench/bench.hpp +816 -0
- package/numkong/bench/bench.js +148 -0
- package/numkong/bench/bench.mjs +616 -0
- package/numkong/bench/bench_attention.cpp +113 -0
- package/numkong/bench/bench_cast.cpp +264 -0
- package/numkong/bench/bench_cross_amx.cpp +62 -0
- package/numkong/bench/bench_cross_arm.cpp +245 -0
- package/numkong/bench/bench_cross_blas.cpp +309 -0
- package/numkong/bench/bench_cross_loongarch.cpp +106 -0
- package/numkong/bench/bench_cross_power.cpp +84 -0
- package/numkong/bench/bench_cross_rvv.cpp +121 -0
- package/numkong/bench/bench_cross_serial.cpp +151 -0
- package/numkong/bench/bench_cross_sme.cpp +163 -0
- package/numkong/bench/bench_cross_wasm.cpp +142 -0
- package/numkong/bench/bench_cross_x86.cpp +455 -0
- package/numkong/bench/bench_curved.cpp +210 -0
- package/numkong/bench/bench_dot.cpp +315 -0
- package/numkong/bench/bench_each.cpp +503 -0
- package/numkong/bench/bench_geospatial.cpp +112 -0
- package/numkong/bench/bench_maxsim.cpp +154 -0
- package/numkong/bench/bench_mesh.cpp +148 -0
- package/numkong/bench/bench_probability.cpp +60 -0
- package/numkong/bench/bench_reduce.cpp +371 -0
- package/numkong/bench/bench_set.cpp +73 -0
- package/numkong/bench/bench_sparse.cpp +198 -0
- package/numkong/bench/bench_spatial.cpp +347 -0
- package/numkong/bench/bench_trigonometry.cpp +137 -0
- package/numkong/bench/swift/Bench.swift +506 -0
- package/numkong/binding.gyp +169 -0
- package/numkong/build.rs +484 -0
- package/numkong/c/dispatch.h +512 -0
- package/numkong/c/dispatch_bf16.c +447 -0
- package/numkong/c/dispatch_bf16c.c +52 -0
- package/numkong/c/dispatch_e2m3.c +296 -0
- package/numkong/c/dispatch_e3m2.c +284 -0
- package/numkong/c/dispatch_e4m3.c +318 -0
- package/numkong/c/dispatch_e5m2.c +316 -0
- package/numkong/c/dispatch_f16.c +452 -0
- package/numkong/c/dispatch_f16c.c +58 -0
- package/numkong/c/dispatch_f32.c +434 -0
- package/numkong/c/dispatch_f32c.c +99 -0
- package/numkong/c/dispatch_f64.c +348 -0
- package/numkong/c/dispatch_f64c.c +98 -0
- package/numkong/c/dispatch_i16.c +96 -0
- package/numkong/c/dispatch_i32.c +89 -0
- package/numkong/c/dispatch_i4.c +153 -0
- package/numkong/c/dispatch_i64.c +86 -0
- package/numkong/c/dispatch_i8.c +348 -0
- package/numkong/c/dispatch_other.c +348 -0
- package/numkong/c/dispatch_u1.c +193 -0
- package/numkong/c/dispatch_u16.c +124 -0
- package/numkong/c/dispatch_u32.c +118 -0
- package/numkong/c/dispatch_u4.c +153 -0
- package/numkong/c/dispatch_u64.c +102 -0
- package/numkong/c/dispatch_u8.c +364 -0
- package/numkong/c/numkong.c +940 -0
- package/numkong/cmake/nk_arm_isa_probes.cmake +61 -0
- package/numkong/cmake/nk_isa_probe.cmake +90 -0
- package/numkong/cmake/nk_loongarch_isa_probes.cmake +15 -0
- package/numkong/cmake/nk_math_lib.cmake +46 -0
- package/numkong/cmake/nk_power_isa_probes.cmake +15 -0
- package/numkong/cmake/nk_riscv_isa_probes.cmake +19 -0
- package/numkong/cmake/nk_x86_isa_probes.cmake +35 -0
- package/numkong/cmake/toolchain-aarch64-gnu.cmake +86 -0
- package/numkong/cmake/toolchain-android-arm64.cmake +25 -0
- package/numkong/cmake/toolchain-android-armv7.cmake +25 -0
- package/numkong/cmake/toolchain-loongarch64-gnu.cmake +68 -0
- package/numkong/cmake/toolchain-ppc64le-gnu.cmake +74 -0
- package/numkong/cmake/toolchain-riscv64-gnu.cmake +107 -0
- package/numkong/cmake/toolchain-riscv64-llvm.cmake +114 -0
- package/numkong/cmake/toolchain-wasi.cmake +77 -0
- package/numkong/cmake/toolchain-wasm.cmake +70 -0
- package/numkong/cmake/toolchain-wasm64.cmake +62 -0
- package/numkong/cmake/toolchain-x86_64-llvm.cmake +47 -0
- package/numkong/include/README.md +643 -0
- package/numkong/include/module.modulemap +129 -0
- package/numkong/include/numkong/attention/sapphireamx.h +1363 -0
- package/numkong/include/numkong/attention/sme.h +2075 -0
- package/numkong/include/numkong/attention.h +49 -0
- package/numkong/include/numkong/capabilities.h +930 -0
- package/numkong/include/numkong/cast/README.md +262 -0
- package/numkong/include/numkong/cast/diamond.h +64 -0
- package/numkong/include/numkong/cast/haswell.h +823 -0
- package/numkong/include/numkong/cast/icelake.h +475 -0
- package/numkong/include/numkong/cast/loongsonasx.h +252 -0
- package/numkong/include/numkong/cast/neon.h +1174 -0
- package/numkong/include/numkong/cast/powervsx.h +449 -0
- package/numkong/include/numkong/cast/rvv.h +970 -0
- package/numkong/include/numkong/cast/sapphire.h +262 -0
- package/numkong/include/numkong/cast/serial.h +2336 -0
- package/numkong/include/numkong/cast/skylake.h +915 -0
- package/numkong/include/numkong/cast/v128relaxed.h +537 -0
- package/numkong/include/numkong/cast.h +254 -0
- package/numkong/include/numkong/cast.hpp +44 -0
- package/numkong/include/numkong/curved/README.md +223 -0
- package/numkong/include/numkong/curved/genoa.h +182 -0
- package/numkong/include/numkong/curved/haswell.h +276 -0
- package/numkong/include/numkong/curved/neon.h +329 -0
- package/numkong/include/numkong/curved/neonbfdot.h +211 -0
- package/numkong/include/numkong/curved/rvv.h +305 -0
- package/numkong/include/numkong/curved/serial.h +207 -0
- package/numkong/include/numkong/curved/skylake.h +457 -0
- package/numkong/include/numkong/curved/smef64.h +530 -0
- package/numkong/include/numkong/curved.h +513 -0
- package/numkong/include/numkong/curved.hpp +144 -0
- package/numkong/include/numkong/dot/README.md +442 -0
- package/numkong/include/numkong/dot/alder.h +563 -0
- package/numkong/include/numkong/dot/diamond.h +158 -0
- package/numkong/include/numkong/dot/genoa.h +289 -0
- package/numkong/include/numkong/dot/haswell.h +1723 -0
- package/numkong/include/numkong/dot/icelake.h +997 -0
- package/numkong/include/numkong/dot/loongsonasx.h +671 -0
- package/numkong/include/numkong/dot/neon.h +869 -0
- package/numkong/include/numkong/dot/neonbfdot.h +243 -0
- package/numkong/include/numkong/dot/neonfhm.h +358 -0
- package/numkong/include/numkong/dot/neonfp8.h +323 -0
- package/numkong/include/numkong/dot/neonsdot.h +622 -0
- package/numkong/include/numkong/dot/powervsx.h +752 -0
- package/numkong/include/numkong/dot/rvv.h +722 -0
- package/numkong/include/numkong/dot/rvvbb.h +72 -0
- package/numkong/include/numkong/dot/rvvbf16.h +123 -0
- package/numkong/include/numkong/dot/rvvhalf.h +129 -0
- package/numkong/include/numkong/dot/sapphire.h +141 -0
- package/numkong/include/numkong/dot/serial.h +874 -0
- package/numkong/include/numkong/dot/sierra.h +405 -0
- package/numkong/include/numkong/dot/skylake.h +1116 -0
- package/numkong/include/numkong/dot/sve.h +420 -0
- package/numkong/include/numkong/dot/svebfdot.h +75 -0
- package/numkong/include/numkong/dot/svehalf.h +168 -0
- package/numkong/include/numkong/dot/svesdot.h +90 -0
- package/numkong/include/numkong/dot/v128relaxed.h +1293 -0
- package/numkong/include/numkong/dot.h +1136 -0
- package/numkong/include/numkong/dot.hpp +94 -0
- package/numkong/include/numkong/dots/README.md +496 -0
- package/numkong/include/numkong/dots/alder.h +117 -0
- package/numkong/include/numkong/dots/diamond.h +86 -0
- package/numkong/include/numkong/dots/genoa.h +100 -0
- package/numkong/include/numkong/dots/graniteamx.h +733 -0
- package/numkong/include/numkong/dots/haswell.h +310 -0
- package/numkong/include/numkong/dots/icelake.h +180 -0
- package/numkong/include/numkong/dots/loongsonasx.h +176 -0
- package/numkong/include/numkong/dots/neon.h +123 -0
- package/numkong/include/numkong/dots/neonbfdot.h +59 -0
- package/numkong/include/numkong/dots/neonfhm.h +96 -0
- package/numkong/include/numkong/dots/neonfp8.h +99 -0
- package/numkong/include/numkong/dots/neonsdot.h +144 -0
- package/numkong/include/numkong/dots/powervsx.h +194 -0
- package/numkong/include/numkong/dots/rvv.h +2593 -0
- package/numkong/include/numkong/dots/sapphireamx.h +4017 -0
- package/numkong/include/numkong/dots/serial.h +2867 -0
- package/numkong/include/numkong/dots/sierra.h +100 -0
- package/numkong/include/numkong/dots/skylake.h +207 -0
- package/numkong/include/numkong/dots/sme.h +5041 -0
- package/numkong/include/numkong/dots/smebi32.h +477 -0
- package/numkong/include/numkong/dots/smef64.h +1328 -0
- package/numkong/include/numkong/dots/smehalf.h +47 -0
- package/numkong/include/numkong/dots/v128relaxed.h +317 -0
- package/numkong/include/numkong/dots.h +3110 -0
- package/numkong/include/numkong/dots.hpp +641 -0
- package/numkong/include/numkong/each/README.md +465 -0
- package/numkong/include/numkong/each/haswell.h +1658 -0
- package/numkong/include/numkong/each/icelake.h +272 -0
- package/numkong/include/numkong/each/neon.h +1138 -0
- package/numkong/include/numkong/each/neonbfdot.h +211 -0
- package/numkong/include/numkong/each/neonhalf.h +318 -0
- package/numkong/include/numkong/each/rvv.h +1121 -0
- package/numkong/include/numkong/each/sapphire.h +343 -0
- package/numkong/include/numkong/each/serial.h +282 -0
- package/numkong/include/numkong/each/skylake.h +1562 -0
- package/numkong/include/numkong/each/v128relaxed.h +562 -0
- package/numkong/include/numkong/each.h +2232 -0
- package/numkong/include/numkong/each.hpp +434 -0
- package/numkong/include/numkong/geospatial/README.md +147 -0
- package/numkong/include/numkong/geospatial/haswell.h +633 -0
- package/numkong/include/numkong/geospatial/neon.h +615 -0
- package/numkong/include/numkong/geospatial/rvv.h +701 -0
- package/numkong/include/numkong/geospatial/serial.h +309 -0
- package/numkong/include/numkong/geospatial/skylake.h +613 -0
- package/numkong/include/numkong/geospatial/v128relaxed.h +652 -0
- package/numkong/include/numkong/geospatial.h +453 -0
- package/numkong/include/numkong/geospatial.hpp +235 -0
- package/numkong/include/numkong/matrix.hpp +336 -0
- package/numkong/include/numkong/maxsim/README.md +187 -0
- package/numkong/include/numkong/maxsim/alder.h +511 -0
- package/numkong/include/numkong/maxsim/genoa.h +115 -0
- package/numkong/include/numkong/maxsim/haswell.h +553 -0
- package/numkong/include/numkong/maxsim/icelake.h +480 -0
- package/numkong/include/numkong/maxsim/neonsdot.h +394 -0
- package/numkong/include/numkong/maxsim/sapphireamx.h +877 -0
- package/numkong/include/numkong/maxsim/serial.h +490 -0
- package/numkong/include/numkong/maxsim/sme.h +993 -0
- package/numkong/include/numkong/maxsim/v128relaxed.h +280 -0
- package/numkong/include/numkong/maxsim.h +571 -0
- package/numkong/include/numkong/maxsim.hpp +133 -0
- package/numkong/include/numkong/mesh/README.md +219 -0
- package/numkong/include/numkong/mesh/haswell.h +2013 -0
- package/numkong/include/numkong/mesh/neon.h +1821 -0
- package/numkong/include/numkong/mesh/neonbfdot.h +771 -0
- package/numkong/include/numkong/mesh/rvv.h +936 -0
- package/numkong/include/numkong/mesh/serial.h +721 -0
- package/numkong/include/numkong/mesh/skylake.h +2344 -0
- package/numkong/include/numkong/mesh/v128relaxed.h +1081 -0
- package/numkong/include/numkong/mesh.h +666 -0
- package/numkong/include/numkong/mesh.hpp +701 -0
- package/numkong/include/numkong/numkong.h +78 -0
- package/numkong/include/numkong/numkong.hpp +58 -0
- package/numkong/include/numkong/probability/README.md +177 -0
- package/numkong/include/numkong/probability/haswell.h +267 -0
- package/numkong/include/numkong/probability/neon.h +255 -0
- package/numkong/include/numkong/probability/rvv.h +414 -0
- package/numkong/include/numkong/probability/serial.h +181 -0
- package/numkong/include/numkong/probability/skylake.h +324 -0
- package/numkong/include/numkong/probability.h +380 -0
- package/numkong/include/numkong/probability.hpp +120 -0
- package/numkong/include/numkong/random.h +50 -0
- package/numkong/include/numkong/random.hpp +285 -0
- package/numkong/include/numkong/reduce/README.md +552 -0
- package/numkong/include/numkong/reduce/alder.h +636 -0
- package/numkong/include/numkong/reduce/genoa.h +201 -0
- package/numkong/include/numkong/reduce/haswell.h +3785 -0
- package/numkong/include/numkong/reduce/icelake.h +549 -0
- package/numkong/include/numkong/reduce/neon.h +3980 -0
- package/numkong/include/numkong/reduce/neonbfdot.h +142 -0
- package/numkong/include/numkong/reduce/neonfhm.h +293 -0
- package/numkong/include/numkong/reduce/neonsdot.h +357 -0
- package/numkong/include/numkong/reduce/rvv.h +3533 -0
- package/numkong/include/numkong/reduce/serial.h +753 -0
- package/numkong/include/numkong/reduce/sierra.h +338 -0
- package/numkong/include/numkong/reduce/skylake.h +3794 -0
- package/numkong/include/numkong/reduce/sve.h +52 -0
- package/numkong/include/numkong/reduce/v128relaxed.h +2302 -0
- package/numkong/include/numkong/reduce.h +1582 -0
- package/numkong/include/numkong/reduce.hpp +778 -0
- package/numkong/include/numkong/scalar/README.md +89 -0
- package/numkong/include/numkong/scalar/haswell.h +122 -0
- package/numkong/include/numkong/scalar/loongsonasx.h +74 -0
- package/numkong/include/numkong/scalar/neon.h +122 -0
- package/numkong/include/numkong/scalar/neonhalf.h +70 -0
- package/numkong/include/numkong/scalar/powervsx.h +96 -0
- package/numkong/include/numkong/scalar/rvv.h +211 -0
- package/numkong/include/numkong/scalar/sapphire.h +74 -0
- package/numkong/include/numkong/scalar/serial.h +332 -0
- package/numkong/include/numkong/scalar/v128relaxed.h +56 -0
- package/numkong/include/numkong/scalar.h +696 -0
- package/numkong/include/numkong/set/README.md +179 -0
- package/numkong/include/numkong/set/haswell.h +334 -0
- package/numkong/include/numkong/set/icelake.h +485 -0
- package/numkong/include/numkong/set/loongsonasx.h +181 -0
- package/numkong/include/numkong/set/neon.h +363 -0
- package/numkong/include/numkong/set/powervsx.h +326 -0
- package/numkong/include/numkong/set/rvv.h +226 -0
- package/numkong/include/numkong/set/rvvbb.h +117 -0
- package/numkong/include/numkong/set/serial.h +174 -0
- package/numkong/include/numkong/set/sve.h +187 -0
- package/numkong/include/numkong/set/v128relaxed.h +240 -0
- package/numkong/include/numkong/set.h +471 -0
- package/numkong/include/numkong/set.hpp +114 -0
- package/numkong/include/numkong/sets/README.md +149 -0
- package/numkong/include/numkong/sets/haswell.h +63 -0
- package/numkong/include/numkong/sets/icelake.h +66 -0
- package/numkong/include/numkong/sets/loongsonasx.h +52 -0
- package/numkong/include/numkong/sets/neon.h +61 -0
- package/numkong/include/numkong/sets/powervsx.h +65 -0
- package/numkong/include/numkong/sets/serial.h +43 -0
- package/numkong/include/numkong/sets/smebi32.h +1135 -0
- package/numkong/include/numkong/sets/v128relaxed.h +58 -0
- package/numkong/include/numkong/sets.h +382 -0
- package/numkong/include/numkong/sparse/README.md +156 -0
- package/numkong/include/numkong/sparse/icelake.h +463 -0
- package/numkong/include/numkong/sparse/neon.h +288 -0
- package/numkong/include/numkong/sparse/serial.h +117 -0
- package/numkong/include/numkong/sparse/sve2.h +504 -0
- package/numkong/include/numkong/sparse/turin.h +322 -0
- package/numkong/include/numkong/sparse.h +363 -0
- package/numkong/include/numkong/sparse.hpp +113 -0
- package/numkong/include/numkong/spatial/README.md +439 -0
- package/numkong/include/numkong/spatial/alder.h +604 -0
- package/numkong/include/numkong/spatial/diamond.h +240 -0
- package/numkong/include/numkong/spatial/genoa.h +222 -0
- package/numkong/include/numkong/spatial/haswell.h +979 -0
- package/numkong/include/numkong/spatial/icelake.h +1067 -0
- package/numkong/include/numkong/spatial/loongsonasx.h +483 -0
- package/numkong/include/numkong/spatial/neon.h +846 -0
- package/numkong/include/numkong/spatial/neonbfdot.h +164 -0
- package/numkong/include/numkong/spatial/neonfp8.h +258 -0
- package/numkong/include/numkong/spatial/neonsdot.h +429 -0
- package/numkong/include/numkong/spatial/powervsx.h +738 -0
- package/numkong/include/numkong/spatial/rvv.h +991 -0
- package/numkong/include/numkong/spatial/rvvbf16.h +128 -0
- package/numkong/include/numkong/spatial/rvvhalf.h +120 -0
- package/numkong/include/numkong/spatial/serial.h +347 -0
- package/numkong/include/numkong/spatial/sierra.h +516 -0
- package/numkong/include/numkong/spatial/skylake.h +605 -0
- package/numkong/include/numkong/spatial/sve.h +246 -0
- package/numkong/include/numkong/spatial/svebfdot.h +125 -0
- package/numkong/include/numkong/spatial/svehalf.h +136 -0
- package/numkong/include/numkong/spatial/svesdot.h +143 -0
- package/numkong/include/numkong/spatial/v128relaxed.h +969 -0
- package/numkong/include/numkong/spatial.h +1681 -0
- package/numkong/include/numkong/spatial.hpp +183 -0
- package/numkong/include/numkong/spatials/README.md +580 -0
- package/numkong/include/numkong/spatials/alder.h +94 -0
- package/numkong/include/numkong/spatials/diamond.h +82 -0
- package/numkong/include/numkong/spatials/genoa.h +94 -0
- package/numkong/include/numkong/spatials/graniteamx.h +173 -0
- package/numkong/include/numkong/spatials/haswell.h +219 -0
- package/numkong/include/numkong/spatials/icelake.h +113 -0
- package/numkong/include/numkong/spatials/loongsonasx.h +153 -0
- package/numkong/include/numkong/spatials/neon.h +109 -0
- package/numkong/include/numkong/spatials/neonbfdot.h +60 -0
- package/numkong/include/numkong/spatials/neonfhm.h +92 -0
- package/numkong/include/numkong/spatials/neonfp8.h +111 -0
- package/numkong/include/numkong/spatials/neonsdot.h +143 -0
- package/numkong/include/numkong/spatials/powervsx.h +153 -0
- package/numkong/include/numkong/spatials/rvv.h +1976 -0
- package/numkong/include/numkong/spatials/sapphireamx.h +1149 -0
- package/numkong/include/numkong/spatials/serial.h +248 -0
- package/numkong/include/numkong/spatials/sierra.h +96 -0
- package/numkong/include/numkong/spatials/skylake.h +184 -0
- package/numkong/include/numkong/spatials/sme.h +1927 -0
- package/numkong/include/numkong/spatials/smef64.h +483 -0
- package/numkong/include/numkong/spatials/v128relaxed.h +240 -0
- package/numkong/include/numkong/spatials.h +3374 -0
- package/numkong/include/numkong/spatials.hpp +509 -0
- package/numkong/include/numkong/tensor.hpp +1981 -0
- package/numkong/include/numkong/trigonometry/README.md +184 -0
- package/numkong/include/numkong/trigonometry/haswell.h +653 -0
- package/numkong/include/numkong/trigonometry/neon.h +638 -0
- package/numkong/include/numkong/trigonometry/rvv.h +700 -0
- package/numkong/include/numkong/trigonometry/serial.h +703 -0
- package/numkong/include/numkong/trigonometry/skylake.h +725 -0
- package/numkong/include/numkong/trigonometry/v128relaxed.h +667 -0
- package/numkong/include/numkong/trigonometry.h +467 -0
- package/numkong/include/numkong/trigonometry.hpp +166 -0
- package/numkong/include/numkong/types.h +1695 -0
- package/numkong/include/numkong/types.hpp +6027 -0
- package/numkong/include/numkong/vector.hpp +766 -0
- package/numkong/javascript/@numkong-darwin-arm64/package.json +26 -0
- package/numkong/javascript/@numkong-darwin-x64/package.json +26 -0
- package/numkong/javascript/@numkong-linux-arm64/package.json +25 -0
- package/numkong/javascript/@numkong-linux-x64/package.json +25 -0
- package/numkong/javascript/@numkong-win32-arm64/package.json +25 -0
- package/numkong/javascript/@numkong-win32-x64/package.json +25 -0
- package/numkong/javascript/README.md +254 -0
- package/numkong/javascript/node-gyp-build.d.ts +4 -0
- package/numkong/javascript/numkong-browser.ts +40 -0
- package/numkong/javascript/numkong-wasm.ts +750 -0
- package/numkong/javascript/numkong.c +712 -0
- package/numkong/javascript/numkong.ts +613 -0
- package/{simsimd → numkong}/javascript/tsconfig-base.json +6 -3
- package/numkong/javascript/tsconfig-cjs.json +13 -0
- package/{simsimd → numkong}/javascript/tsconfig-esm.json +1 -1
- package/numkong/javascript/types.ts +784 -0
- package/numkong/numkong.gypi +104 -0
- package/numkong/package.json +108 -0
- package/numkong/probes/arm_neon.c +8 -0
- package/numkong/probes/arm_neon_bfdot.c +9 -0
- package/numkong/probes/arm_neon_fhm.c +9 -0
- package/numkong/probes/arm_neon_half.c +8 -0
- package/numkong/probes/arm_neon_sdot.c +9 -0
- package/numkong/probes/arm_neonfp8.c +9 -0
- package/numkong/probes/arm_sme.c +16 -0
- package/numkong/probes/arm_sme2.c +16 -0
- package/numkong/probes/arm_sme2p1.c +16 -0
- package/numkong/probes/arm_sme_bf16.c +16 -0
- package/numkong/probes/arm_sme_bi32.c +16 -0
- package/numkong/probes/arm_sme_f64.c +16 -0
- package/numkong/probes/arm_sme_fa64.c +14 -0
- package/numkong/probes/arm_sme_half.c +16 -0
- package/numkong/probes/arm_sme_lut2.c +15 -0
- package/numkong/probes/arm_sve.c +18 -0
- package/numkong/probes/arm_sve2.c +20 -0
- package/numkong/probes/arm_sve2p1.c +18 -0
- package/numkong/probes/arm_sve_bfdot.c +20 -0
- package/numkong/probes/arm_sve_half.c +18 -0
- package/numkong/probes/arm_sve_sdot.c +21 -0
- package/numkong/probes/loongarch_lasx.c +12 -0
- package/numkong/probes/power_vsx.c +12 -0
- package/numkong/probes/probe.js +127 -0
- package/numkong/probes/riscv_rvv.c +14 -0
- package/numkong/probes/riscv_rvv_bb.c +15 -0
- package/numkong/probes/riscv_rvv_bf16.c +17 -0
- package/numkong/probes/riscv_rvv_half.c +14 -0
- package/numkong/probes/wasm_v128relaxed.c +11 -0
- package/numkong/probes/x86_alder.c +17 -0
- package/numkong/probes/x86_diamond.c +17 -0
- package/numkong/probes/x86_genoa.c +17 -0
- package/numkong/probes/x86_graniteamx.c +19 -0
- package/numkong/probes/x86_haswell.c +11 -0
- package/numkong/probes/x86_icelake.c +17 -0
- package/numkong/probes/x86_sapphire.c +16 -0
- package/numkong/probes/x86_sapphireamx.c +18 -0
- package/numkong/probes/x86_sierra.c +17 -0
- package/numkong/probes/x86_skylake.c +15 -0
- package/numkong/probes/x86_turin.c +17 -0
- package/numkong/rust/README.md +698 -0
- package/numkong/rust/capabilities.rs +96 -0
- package/numkong/rust/cast.rs +314 -0
- package/numkong/rust/curved.rs +391 -0
- package/numkong/rust/each.rs +2721 -0
- package/numkong/rust/geospatial.rs +343 -0
- package/numkong/rust/matrix.rs +5424 -0
- package/numkong/rust/maxsim.rs +540 -0
- package/numkong/rust/mesh.rs +837 -0
- package/numkong/rust/numkong.rs +409 -0
- package/numkong/rust/probability.rs +272 -0
- package/numkong/rust/reduce.rs +1249 -0
- package/numkong/rust/set.rs +194 -0
- package/numkong/rust/sparse.rs +513 -0
- package/numkong/rust/spatial.rs +1815 -0
- package/numkong/rust/tensor.rs +7565 -0
- package/numkong/rust/types.rs +3666 -0
- package/numkong/rust/vector.rs +1899 -0
- package/numkong/rustfmt.toml +2 -0
- package/numkong/swift/Matrix.swift +1388 -0
- package/numkong/swift/MaxSim.swift +151 -0
- package/numkong/swift/NumKong.swift +283 -0
- package/numkong/swift/Numerics.swift +329 -0
- package/numkong/swift/README.md +433 -0
- package/numkong/swift/Scalar.swift +741 -0
- package/numkong/swift/Tensor.swift +209 -0
- package/numkong/test/README.md +315 -0
- package/numkong/test/playwright.config.ts +16 -0
- package/numkong/test/swift/Test.swift +534 -0
- package/numkong/test/test-browser-bundle-runner.mjs +36 -0
- package/numkong/test/test-browser-bundle.html +188 -0
- package/numkong/test/test-browser-runner.mjs +43 -0
- package/numkong/test/test-browser.html +305 -0
- package/numkong/test/test-dtypes.mjs +453 -0
- package/numkong/test/test-wasm.mjs +267 -0
- package/numkong/test/test.cpp +442 -0
- package/numkong/test/test.hpp +580 -0
- package/numkong/test/test.mjs +363 -0
- package/numkong/test/test_base.py +1041 -0
- package/numkong/test/test_cast.cpp +242 -0
- package/numkong/test/test_cross.hpp +551 -0
- package/numkong/test/test_cross.py +467 -0
- package/numkong/test/test_cross_amx.cpp +50 -0
- package/numkong/test/test_cross_arm.cpp +225 -0
- package/numkong/test/test_cross_blas.cpp +354 -0
- package/numkong/test/test_cross_loongarch.cpp +90 -0
- package/numkong/test/test_cross_power.cpp +73 -0
- package/numkong/test/test_cross_rvv.cpp +109 -0
- package/numkong/test/test_cross_serial.cpp +181 -0
- package/numkong/test/test_cross_sme.cpp +148 -0
- package/numkong/test/test_cross_wasm.cpp +141 -0
- package/numkong/test/test_cross_x86.cpp +442 -0
- package/numkong/test/test_curved.cpp +182 -0
- package/numkong/test/test_curved.py +207 -0
- package/numkong/test/test_dot.cpp +353 -0
- package/numkong/test/test_dot.py +296 -0
- package/numkong/test/test_each.cpp +437 -0
- package/numkong/test/test_each.py +756 -0
- package/numkong/test/test_geospatial.cpp +155 -0
- package/numkong/test/test_geospatial.py +241 -0
- package/numkong/test/test_maxsim.cpp +138 -0
- package/numkong/test/test_maxsim.py +209 -0
- package/numkong/test/test_mesh.cpp +203 -0
- package/numkong/test/test_mesh.py +394 -0
- package/numkong/test/test_probability.cpp +136 -0
- package/numkong/test/test_probability.py +166 -0
- package/numkong/test/test_reduce.cpp +563 -0
- package/numkong/test/test_reduce.py +781 -0
- package/numkong/test/test_set.cpp +151 -0
- package/numkong/test/test_set.py +120 -0
- package/numkong/test/test_similarities.py +579 -0
- package/numkong/test/test_sparse.cpp +121 -0
- package/numkong/test/test_sparse.py +118 -0
- package/numkong/test/test_spatial.cpp +518 -0
- package/numkong/test/test_spatial.py +269 -0
- package/numkong/test/test_tensor.cpp +884 -0
- package/numkong/test/test_tensor.py +1417 -0
- package/numkong/test/test_trigonometry.cpp +156 -0
- package/numkong/test/test_trigonometry.py +180 -0
- package/package.json +7 -8
- package/prebuilds/darwin-arm64+x64/usearch.node +0 -0
- package/prebuilds/linux-arm64/usearch.node +0 -0
- package/prebuilds/linux-x64/usearch.node +0 -0
- package/fp16/CMakeLists.txt +0 -176
- package/fp16/LICENSE +0 -11
- package/fp16/README.md +0 -20
- package/fp16/bench/alt-element.cc +0 -89
- package/fp16/bench/from-alt-array.cc +0 -175
- package/fp16/bench/from-ieee-array.cc +0 -399
- package/fp16/bench/ieee-element.cc +0 -272
- package/fp16/bench/to-alt-array.cc +0 -91
- package/fp16/bench/to-ieee-array.cc +0 -303
- package/fp16/cmake/DownloadGoogleBenchmark.cmake +0 -15
- package/fp16/cmake/DownloadGoogleTest.cmake +0 -15
- package/fp16/cmake/DownloadPSimd.cmake +0 -15
- package/fp16/configure.py +0 -65
- package/fp16/confu.yaml +0 -8
- package/fp16/include/fp16/__init__.py +0 -0
- package/fp16/include/fp16/avx.py +0 -50
- package/fp16/include/fp16/avx2.py +0 -53
- package/fp16/include/fp16/bitcasts.h +0 -92
- package/fp16/include/fp16/fp16.h +0 -451
- package/fp16/include/fp16/psimd.h +0 -131
- package/fp16/include/fp16.h +0 -11
- package/fp16/jni/Android.mk +0 -6
- package/fp16/jni/Application.mk +0 -4
- package/fp16/test/alt-from-fp32-value.cc +0 -498
- package/fp16/test/alt-to-fp32-bits.cc +0 -263
- package/fp16/test/alt-to-fp32-psimd.cc +0 -145
- package/fp16/test/alt-to-fp32-value.cc +0 -348
- package/fp16/test/alt-to-fp32x2-psimd.cc +0 -245
- package/fp16/test/bitcasts.cc +0 -56
- package/fp16/test/ieee-from-fp32-value.cc +0 -523
- package/fp16/test/ieee-to-fp32-bits.cc +0 -333
- package/fp16/test/ieee-to-fp32-psimd.cc +0 -312
- package/fp16/test/ieee-to-fp32-value.cc +0 -420
- package/fp16/test/ieee-to-fp32x2-psimd.cc +0 -541
- package/fp16/test/peachpy/alt-xmm-to-fp32-xmm-avx.cc +0 -96
- package/fp16/test/peachpy/alt-xmm-to-fp32-ymm-avx2.cc +0 -96
- package/fp16/test/peachpy/stubs.py +0 -38
- package/fp16/test/tables.cc +0 -530
- package/fp16/test/tables.h +0 -13
- package/fp16/third-party/THHalf.h +0 -92
- package/fp16/third-party/eigen-half.h +0 -170
- package/fp16/third-party/float16-compressor.h +0 -80
- package/fp16/third-party/half.hpp +0 -2916
- package/fp16/third-party/npy-halffloat.h +0 -328
- package/simsimd/.git-blame-ignore-revs +0 -2
- package/simsimd/CONTRIBUTING.md +0 -321
- package/simsimd/Cargo.toml +0 -49
- package/simsimd/MANIFEST.in +0 -4
- package/simsimd/Package.swift +0 -28
- package/simsimd/README.md +0 -1493
- package/simsimd/binding.gyp +0 -35
- package/simsimd/build.rs +0 -70
- package/simsimd/c/lib.c +0 -374
- package/simsimd/include/module.modulemap +0 -4
- package/simsimd/include/simsimd/binary.h +0 -486
- package/simsimd/include/simsimd/curved.h +0 -1541
- package/simsimd/include/simsimd/dot.h +0 -1853
- package/simsimd/include/simsimd/elementwise.h +0 -2465
- package/simsimd/include/simsimd/geospatial.h +0 -43
- package/simsimd/include/simsimd/mesh.h +0 -69
- package/simsimd/include/simsimd/probability.h +0 -606
- package/simsimd/include/simsimd/simsimd.h +0 -2567
- package/simsimd/include/simsimd/sparse.h +0 -1384
- package/simsimd/include/simsimd/spatial.h +0 -2335
- package/simsimd/include/simsimd/types.h +0 -666
- package/simsimd/javascript/fallback.ts +0 -233
- package/simsimd/javascript/lib.c +0 -125
- package/simsimd/javascript/node-gyp-build.d.ts +0 -1
- package/simsimd/javascript/simsimd.ts +0 -179
- package/simsimd/javascript/tsconfig-cjs.json +0 -8
- package/simsimd/package-lock.json +0 -1761
- package/simsimd/package.json +0 -61
- package/simsimd/rust/lib.rs +0 -1821
- package/simsimd/scripts/bench.cxx +0 -1170
- package/simsimd/scripts/bench.ipynb +0 -187
- package/simsimd/scripts/bench.js +0 -127
- package/simsimd/scripts/bench.rs +0 -876
- package/simsimd/scripts/bench_vectors.py +0 -734
- package/simsimd/scripts/bench_vectors_live.py +0 -213
- package/simsimd/scripts/test.c +0 -187
- package/simsimd/scripts/test.mjs +0 -220
- package/simsimd/scripts/test.py +0 -1505
- package/simsimd/swift/SimSIMD.swift +0 -149
- package/simsimd/swift/Test.swift +0 -128
- /package/{simsimd → numkong}/CODE_OF_CONDUCT.md +0 -0
- /package/{simsimd → numkong}/LICENSE +0 -0
- /package/{simsimd → numkong}/javascript/dist-package-cjs.json +0 -0
- /package/{simsimd → numkong}/javascript/dist-package-esm.json +0 -0
package/simsimd/binding.gyp
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"variables": {"openssl_fips": ""},
|
|
3
|
-
"targets": [
|
|
4
|
-
{
|
|
5
|
-
"target_name": "simsimd",
|
|
6
|
-
"sources": ["javascript/lib.c", "c/lib.c"],
|
|
7
|
-
"include_dirs": ["include"],
|
|
8
|
-
"defines": [
|
|
9
|
-
"SIMSIMD_NATIVE_F16=0",
|
|
10
|
-
"SIMSIMD_NATIVE_BF16=0",
|
|
11
|
-
"SIMSIMD_DYNAMIC_DISPATCH=1",
|
|
12
|
-
],
|
|
13
|
-
"cflags": [
|
|
14
|
-
"-std=c11",
|
|
15
|
-
"-ffast-math",
|
|
16
|
-
"-Wno-unknown-pragmas",
|
|
17
|
-
"-Wno-maybe-uninitialized",
|
|
18
|
-
"-Wno-cast-function-type",
|
|
19
|
-
"-Wno-switch",
|
|
20
|
-
],
|
|
21
|
-
"conditions": [
|
|
22
|
-
[
|
|
23
|
-
"OS=='mac'",
|
|
24
|
-
{
|
|
25
|
-
"xcode_settings": {
|
|
26
|
-
"MACOSX_DEPLOYMENT_TARGET": "11.0",
|
|
27
|
-
"OTHER_CFLAGS": ["-arch arm64", "-arch x86_64"],
|
|
28
|
-
"OTHER_LDFLAGS": ["-arch arm64", "-arch x86_64"],
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
]
|
|
32
|
-
],
|
|
33
|
-
}
|
|
34
|
-
],
|
|
35
|
-
}
|
package/simsimd/build.rs
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
fn main() -> Result<(), cc::Error> {
|
|
2
|
-
let mut build = cc::Build::new();
|
|
3
|
-
|
|
4
|
-
build
|
|
5
|
-
// Prefer portable flags to support MSVC and older toolchains
|
|
6
|
-
.std("c99") // Enforce C99 standard when supported
|
|
7
|
-
.file("c/lib.c")
|
|
8
|
-
.include("include")
|
|
9
|
-
.define("SIMSIMD_NATIVE_F16", "0")
|
|
10
|
-
.define("SIMSIMD_NATIVE_BF16", "0")
|
|
11
|
-
.define("SIMSIMD_DYNAMIC_DISPATCH", "1")
|
|
12
|
-
.opt_level(3)
|
|
13
|
-
.flag_if_supported("-pedantic") // Strict compliance when supported
|
|
14
|
-
.warnings(false);
|
|
15
|
-
|
|
16
|
-
if let Err(e) = build.try_compile("simsimd") {
|
|
17
|
-
print!("cargo:warning=Failed to compile with all SIMD backends...");
|
|
18
|
-
|
|
19
|
-
let target_arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap_or_default();
|
|
20
|
-
let flags_to_try = match target_arch.as_str() {
|
|
21
|
-
"arm" | "aarch64" => vec![
|
|
22
|
-
"SIMSIMD_TARGET_SVE2",
|
|
23
|
-
"SIMSIMD_TARGET_SVE_BF16",
|
|
24
|
-
"SIMSIMD_TARGET_SVE_F16",
|
|
25
|
-
"SIMSIMD_TARGET_SVE_I8",
|
|
26
|
-
"SIMSIMD_TARGET_SVE",
|
|
27
|
-
"SIMSIMD_TARGET_NEON_BF16",
|
|
28
|
-
"SIMSIMD_TARGET_NEON_F16",
|
|
29
|
-
"SIMSIMD_TARGET_NEON_I8",
|
|
30
|
-
"SIMSIMD_TARGET_NEON",
|
|
31
|
-
],
|
|
32
|
-
_ => vec![
|
|
33
|
-
"SIMSIMD_TARGET_SIERRA",
|
|
34
|
-
"SIMSIMD_TARGET_TURIN",
|
|
35
|
-
"SIMSIMD_TARGET_SAPPHIRE",
|
|
36
|
-
"SIMSIMD_TARGET_GENOA",
|
|
37
|
-
"SIMSIMD_TARGET_ICE",
|
|
38
|
-
"SIMSIMD_TARGET_SKYLAKE",
|
|
39
|
-
"SIMSIMD_TARGET_HASWELL",
|
|
40
|
-
],
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
let mut result = Err(e);
|
|
44
|
-
for flag in flags_to_try.iter() {
|
|
45
|
-
build.define(flag, "0");
|
|
46
|
-
result = build.try_compile("simsimd");
|
|
47
|
-
if result.is_ok() {
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Print the failed configuration
|
|
52
|
-
println!(
|
|
53
|
-
"cargo:warning=Failed to compile after disabling {}, trying next configuration...",
|
|
54
|
-
flag
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
result?;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
println!("cargo:rerun-if-changed=c/lib.c");
|
|
61
|
-
println!("cargo:rerun-if-changed=rust/lib.rs");
|
|
62
|
-
println!("cargo:rerun-if-changed=include/simsimd/simsimd.h");
|
|
63
|
-
|
|
64
|
-
println!("cargo:rerun-if-changed=include/simsimd/dot.h");
|
|
65
|
-
println!("cargo:rerun-if-changed=include/simsimd/spatial.h");
|
|
66
|
-
println!("cargo:rerun-if-changed=include/simsimd/probability.h");
|
|
67
|
-
println!("cargo:rerun-if-changed=include/simsimd/binary.h");
|
|
68
|
-
println!("cargo:rerun-if-changed=include/simsimd/types.h");
|
|
69
|
-
Ok(())
|
|
70
|
-
}
|
package/simsimd/c/lib.c
DELETED
|
@@ -1,374 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @brief Dynamic dispatch library for SimSIMD.
|
|
3
|
-
* @note Compile with the most recent compiler available.
|
|
4
|
-
* @file lib.c
|
|
5
|
-
*/
|
|
6
|
-
#define SIMSIMD_DYNAMIC_DISPATCH 1
|
|
7
|
-
#define SIMSIMD_NATIVE_F16 0
|
|
8
|
-
#define SIMSIMD_NATIVE_BF16 0
|
|
9
|
-
|
|
10
|
-
/* Override the primary serial operations to avoid the LibC dependency.
|
|
11
|
-
*/
|
|
12
|
-
#define SIMSIMD_SQRT(x) simsimd_approximate_square_root(x)
|
|
13
|
-
#define SIMSIMD_RSQRT(x) simsimd_approximate_inverse_square_root(x)
|
|
14
|
-
#define SIMSIMD_LOG(x) simsimd_approximate_log(x)
|
|
15
|
-
|
|
16
|
-
/* Depending on the Operating System, the following intrinsics are available
|
|
17
|
-
* on recent compiler toolchains:
|
|
18
|
-
*
|
|
19
|
-
* - Linux: everything is available in GCC 12+ and Clang 16+.
|
|
20
|
-
* - Windows - MSVC: everything except Sapphire Rapids and ARM SVE.
|
|
21
|
-
* - macOS - Apple Clang: only Arm NEON and x86 AVX2 Haswell extensions are available.
|
|
22
|
-
*/
|
|
23
|
-
#if !defined(SIMSIMD_TARGET_NEON) && (defined(__APPLE__) || defined(__linux__))
|
|
24
|
-
#define SIMSIMD_TARGET_NEON 1
|
|
25
|
-
#endif
|
|
26
|
-
#if !defined(SIMSIMD_TARGET_SVE) && (defined(__linux__))
|
|
27
|
-
#define SIMSIMD_TARGET_SVE 1
|
|
28
|
-
#endif
|
|
29
|
-
#if !defined(SIMSIMD_TARGET_SVE2) && (defined(__linux__))
|
|
30
|
-
#define SIMSIMD_TARGET_SVE2 1
|
|
31
|
-
#endif
|
|
32
|
-
#if !defined(SIMSIMD_TARGET_HASWELL) && (defined(_MSC_VER) || defined(__APPLE__) || defined(__linux__))
|
|
33
|
-
#define SIMSIMD_TARGET_HASWELL 1
|
|
34
|
-
#endif
|
|
35
|
-
#if !defined(SIMSIMD_TARGET_SKYLAKE) && (defined(_MSC_VER) || defined(__linux__))
|
|
36
|
-
#define SIMSIMD_TARGET_SKYLAKE 1
|
|
37
|
-
#endif
|
|
38
|
-
#if !defined(SIMSIMD_TARGET_ICE) && (defined(_MSC_VER) || defined(__linux__))
|
|
39
|
-
#define SIMSIMD_TARGET_ICE 1
|
|
40
|
-
#endif
|
|
41
|
-
#if !defined(SIMSIMD_TARGET_GENOA) && (defined(__linux__))
|
|
42
|
-
#define SIMSIMD_TARGET_GENOA 1
|
|
43
|
-
#endif
|
|
44
|
-
#if !defined(SIMSIMD_TARGET_SAPPHIRE) && (defined(__linux__))
|
|
45
|
-
#define SIMSIMD_TARGET_SAPPHIRE 1
|
|
46
|
-
#endif
|
|
47
|
-
#if !defined(SIMSIMD_TARGET_TURIN) && (defined(__linux__))
|
|
48
|
-
#define SIMSIMD_TARGET_TURIN 1
|
|
49
|
-
#endif
|
|
50
|
-
#if !defined(SIMSIMD_TARGET_SIERRA) && (defined(__linux__)) && 0 // TODO: Add target spec to GCC & Clang
|
|
51
|
-
#define SIMSIMD_TARGET_SIERRA 1
|
|
52
|
-
#endif
|
|
53
|
-
|
|
54
|
-
#include <simsimd/simsimd.h>
|
|
55
|
-
|
|
56
|
-
#ifdef __cplusplus
|
|
57
|
-
extern "C" {
|
|
58
|
-
#endif
|
|
59
|
-
|
|
60
|
-
// Every time a function is called, it checks if the metric is already loaded. If not, it fetches it.
|
|
61
|
-
// If no metric is found, it returns NaN. We can obtain NaN by dividing 0.0 by 0.0, but that annoys
|
|
62
|
-
// the MSVC compiler. Instead we can directly write-in the signaling NaN (0x7FF0000000000001)
|
|
63
|
-
// or the qNaN (0x7FF8000000000000).
|
|
64
|
-
#define SIMSIMD_DECLARATION_DENSE(name, extension) \
|
|
65
|
-
SIMSIMD_DYNAMIC void simsimd_##name##_##extension(simsimd_##extension##_t const *a, \
|
|
66
|
-
simsimd_##extension##_t const *b, simsimd_size_t n, \
|
|
67
|
-
simsimd_distance_t *results) { \
|
|
68
|
-
static simsimd_metric_dense_punned_t metric = 0; \
|
|
69
|
-
if (metric == 0) { \
|
|
70
|
-
simsimd_capability_t used_capability; \
|
|
71
|
-
simsimd_find_kernel_punned(simsimd_metric_##name##_k, simsimd_datatype_##extension##_k, \
|
|
72
|
-
simsimd_capabilities(), simsimd_cap_any_k, (simsimd_kernel_punned_t *)&metric, \
|
|
73
|
-
&used_capability); \
|
|
74
|
-
if (!metric) { \
|
|
75
|
-
*(simsimd_u64_t *)results = 0x7FF0000000000001ull; \
|
|
76
|
-
return; \
|
|
77
|
-
} \
|
|
78
|
-
} \
|
|
79
|
-
metric(a, b, n, results); \
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
#define SIMSIMD_DECLARATION_SPARSE(name, extension, type) \
|
|
83
|
-
SIMSIMD_DYNAMIC void simsimd_##name##_##extension(simsimd_##type##_t const *a, simsimd_##type##_t const *b, \
|
|
84
|
-
simsimd_size_t a_length, simsimd_size_t b_length, \
|
|
85
|
-
simsimd_distance_t *result) { \
|
|
86
|
-
static simsimd_metric_sparse_punned_t metric = 0; \
|
|
87
|
-
if (metric == 0) { \
|
|
88
|
-
simsimd_capability_t used_capability; \
|
|
89
|
-
simsimd_find_kernel_punned(simsimd_metric_##name##_k, simsimd_datatype_##extension##_k, \
|
|
90
|
-
simsimd_capabilities(), simsimd_cap_any_k, \
|
|
91
|
-
(simsimd_kernel_punned_t *)(&metric), &used_capability); \
|
|
92
|
-
if (!metric) { \
|
|
93
|
-
*(simsimd_u64_t *)result = 0x7FF0000000000001ull; \
|
|
94
|
-
return; \
|
|
95
|
-
} \
|
|
96
|
-
} \
|
|
97
|
-
metric(a, b, a_length, b_length, result); \
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
#define SIMSIMD_DECLARATION_CURVED(name, extension) \
|
|
101
|
-
SIMSIMD_DYNAMIC void simsimd_##name##_##extension( \
|
|
102
|
-
simsimd_##extension##_t const *a, simsimd_##extension##_t const *b, simsimd_##extension##_t const *c, \
|
|
103
|
-
simsimd_size_t n, simsimd_distance_t *result) { \
|
|
104
|
-
static simsimd_metric_curved_punned_t metric = 0; \
|
|
105
|
-
if (metric == 0) { \
|
|
106
|
-
simsimd_capability_t used_capability; \
|
|
107
|
-
simsimd_find_kernel_punned(simsimd_metric_##name##_k, simsimd_datatype_##extension##_k, \
|
|
108
|
-
simsimd_capabilities(), simsimd_cap_any_k, \
|
|
109
|
-
(simsimd_kernel_punned_t *)(&metric), &used_capability); \
|
|
110
|
-
if (!metric) { \
|
|
111
|
-
*(simsimd_u64_t *)result = 0x7FF0000000000001ull; \
|
|
112
|
-
return; \
|
|
113
|
-
} \
|
|
114
|
-
} \
|
|
115
|
-
metric(a, b, c, n, result); \
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
#define SIMSIMD_DECLARATION_FMA(name, extension) \
|
|
119
|
-
SIMSIMD_DYNAMIC void simsimd_##name##_##extension( \
|
|
120
|
-
simsimd_##extension##_t const *a, simsimd_##extension##_t const *b, simsimd_##extension##_t const *c, \
|
|
121
|
-
simsimd_size_t n, simsimd_distance_t alpha, simsimd_distance_t beta, simsimd_##extension##_t *result) { \
|
|
122
|
-
static simsimd_kernel_fma_punned_t metric = 0; \
|
|
123
|
-
if (metric == 0) { \
|
|
124
|
-
simsimd_capability_t used_capability; \
|
|
125
|
-
simsimd_find_kernel_punned(simsimd_metric_##name##_k, simsimd_datatype_##extension##_k, \
|
|
126
|
-
simsimd_capabilities(), simsimd_cap_any_k, \
|
|
127
|
-
(simsimd_kernel_punned_t *)(&metric), &used_capability); \
|
|
128
|
-
} \
|
|
129
|
-
metric(a, b, c, n, alpha, beta, result); \
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
#define SIMSIMD_DECLARATION_WSUM(name, extension) \
|
|
133
|
-
SIMSIMD_DYNAMIC void simsimd_##name##_##extension( \
|
|
134
|
-
simsimd_##extension##_t const *a, simsimd_##extension##_t const *b, simsimd_size_t n, \
|
|
135
|
-
simsimd_distance_t alpha, simsimd_distance_t beta, simsimd_##extension##_t *result) { \
|
|
136
|
-
static simsimd_kernel_wsum_punned_t metric = 0; \
|
|
137
|
-
if (metric == 0) { \
|
|
138
|
-
simsimd_capability_t used_capability; \
|
|
139
|
-
simsimd_find_kernel_punned(simsimd_metric_##name##_k, simsimd_datatype_##extension##_k, \
|
|
140
|
-
simsimd_capabilities(), simsimd_cap_any_k, \
|
|
141
|
-
(simsimd_kernel_punned_t *)(&metric), &used_capability); \
|
|
142
|
-
} \
|
|
143
|
-
metric(a, b, n, alpha, beta, result); \
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// Dot products
|
|
147
|
-
SIMSIMD_DECLARATION_DENSE(dot, i8)
|
|
148
|
-
SIMSIMD_DECLARATION_DENSE(dot, u8)
|
|
149
|
-
SIMSIMD_DECLARATION_DENSE(dot, f16)
|
|
150
|
-
SIMSIMD_DECLARATION_DENSE(dot, bf16)
|
|
151
|
-
SIMSIMD_DECLARATION_DENSE(dot, f32)
|
|
152
|
-
SIMSIMD_DECLARATION_DENSE(dot, f64)
|
|
153
|
-
SIMSIMD_DECLARATION_DENSE(dot, f16c)
|
|
154
|
-
SIMSIMD_DECLARATION_DENSE(dot, bf16c)
|
|
155
|
-
SIMSIMD_DECLARATION_DENSE(dot, f32c)
|
|
156
|
-
SIMSIMD_DECLARATION_DENSE(dot, f64c)
|
|
157
|
-
SIMSIMD_DECLARATION_DENSE(vdot, f16c)
|
|
158
|
-
SIMSIMD_DECLARATION_DENSE(vdot, bf16c)
|
|
159
|
-
SIMSIMD_DECLARATION_DENSE(vdot, f32c)
|
|
160
|
-
SIMSIMD_DECLARATION_DENSE(vdot, f64c)
|
|
161
|
-
|
|
162
|
-
// Spatial distances
|
|
163
|
-
SIMSIMD_DECLARATION_DENSE(cos, i8)
|
|
164
|
-
SIMSIMD_DECLARATION_DENSE(cos, u8)
|
|
165
|
-
SIMSIMD_DECLARATION_DENSE(cos, f16)
|
|
166
|
-
SIMSIMD_DECLARATION_DENSE(cos, bf16)
|
|
167
|
-
SIMSIMD_DECLARATION_DENSE(cos, f32)
|
|
168
|
-
SIMSIMD_DECLARATION_DENSE(cos, f64)
|
|
169
|
-
SIMSIMD_DECLARATION_DENSE(l2sq, i8)
|
|
170
|
-
SIMSIMD_DECLARATION_DENSE(l2sq, u8)
|
|
171
|
-
SIMSIMD_DECLARATION_DENSE(l2sq, f16)
|
|
172
|
-
SIMSIMD_DECLARATION_DENSE(l2sq, bf16)
|
|
173
|
-
SIMSIMD_DECLARATION_DENSE(l2sq, f32)
|
|
174
|
-
SIMSIMD_DECLARATION_DENSE(l2sq, f64)
|
|
175
|
-
SIMSIMD_DECLARATION_DENSE(l2, i8)
|
|
176
|
-
SIMSIMD_DECLARATION_DENSE(l2, u8)
|
|
177
|
-
SIMSIMD_DECLARATION_DENSE(l2, f16)
|
|
178
|
-
SIMSIMD_DECLARATION_DENSE(l2, bf16)
|
|
179
|
-
SIMSIMD_DECLARATION_DENSE(l2, f32)
|
|
180
|
-
SIMSIMD_DECLARATION_DENSE(l2, f64)
|
|
181
|
-
|
|
182
|
-
// Binary distances
|
|
183
|
-
SIMSIMD_DECLARATION_DENSE(hamming, b8)
|
|
184
|
-
SIMSIMD_DECLARATION_DENSE(jaccard, b8)
|
|
185
|
-
|
|
186
|
-
// Probability distributions
|
|
187
|
-
SIMSIMD_DECLARATION_DENSE(kl, f16)
|
|
188
|
-
SIMSIMD_DECLARATION_DENSE(kl, bf16)
|
|
189
|
-
SIMSIMD_DECLARATION_DENSE(kl, f32)
|
|
190
|
-
SIMSIMD_DECLARATION_DENSE(kl, f64)
|
|
191
|
-
SIMSIMD_DECLARATION_DENSE(js, f16)
|
|
192
|
-
SIMSIMD_DECLARATION_DENSE(js, bf16)
|
|
193
|
-
SIMSIMD_DECLARATION_DENSE(js, f32)
|
|
194
|
-
SIMSIMD_DECLARATION_DENSE(js, f64)
|
|
195
|
-
|
|
196
|
-
// Sparse sets
|
|
197
|
-
SIMSIMD_DECLARATION_SPARSE(intersect, u16, u16)
|
|
198
|
-
SIMSIMD_DECLARATION_SPARSE(intersect, u32, u32)
|
|
199
|
-
|
|
200
|
-
// Curved spaces
|
|
201
|
-
SIMSIMD_DECLARATION_CURVED(bilinear, f64)
|
|
202
|
-
SIMSIMD_DECLARATION_CURVED(bilinear, f64c)
|
|
203
|
-
SIMSIMD_DECLARATION_CURVED(mahalanobis, f64)
|
|
204
|
-
SIMSIMD_DECLARATION_CURVED(bilinear, f32)
|
|
205
|
-
SIMSIMD_DECLARATION_CURVED(bilinear, f32c)
|
|
206
|
-
SIMSIMD_DECLARATION_CURVED(mahalanobis, f32)
|
|
207
|
-
SIMSIMD_DECLARATION_CURVED(bilinear, f16)
|
|
208
|
-
SIMSIMD_DECLARATION_CURVED(bilinear, f16c)
|
|
209
|
-
SIMSIMD_DECLARATION_CURVED(mahalanobis, f16)
|
|
210
|
-
SIMSIMD_DECLARATION_CURVED(bilinear, bf16)
|
|
211
|
-
SIMSIMD_DECLARATION_CURVED(bilinear, bf16c)
|
|
212
|
-
SIMSIMD_DECLARATION_CURVED(mahalanobis, bf16)
|
|
213
|
-
|
|
214
|
-
// Element-wise operations
|
|
215
|
-
SIMSIMD_DECLARATION_FMA(fma, f64)
|
|
216
|
-
SIMSIMD_DECLARATION_FMA(fma, f32)
|
|
217
|
-
SIMSIMD_DECLARATION_FMA(fma, f16)
|
|
218
|
-
SIMSIMD_DECLARATION_FMA(fma, bf16)
|
|
219
|
-
SIMSIMD_DECLARATION_FMA(fma, i8)
|
|
220
|
-
SIMSIMD_DECLARATION_FMA(fma, u8)
|
|
221
|
-
SIMSIMD_DECLARATION_WSUM(wsum, f64)
|
|
222
|
-
SIMSIMD_DECLARATION_WSUM(wsum, f32)
|
|
223
|
-
SIMSIMD_DECLARATION_WSUM(wsum, f16)
|
|
224
|
-
SIMSIMD_DECLARATION_WSUM(wsum, bf16)
|
|
225
|
-
SIMSIMD_DECLARATION_WSUM(wsum, i8)
|
|
226
|
-
SIMSIMD_DECLARATION_WSUM(wsum, u8)
|
|
227
|
-
|
|
228
|
-
SIMSIMD_DYNAMIC int simsimd_uses_neon(void) { return (simsimd_capabilities() & simsimd_cap_neon_k) != 0; }
|
|
229
|
-
SIMSIMD_DYNAMIC int simsimd_uses_neon_f16(void) { return (simsimd_capabilities() & simsimd_cap_neon_f16_k) != 0; }
|
|
230
|
-
SIMSIMD_DYNAMIC int simsimd_uses_neon_bf16(void) { return (simsimd_capabilities() & simsimd_cap_neon_bf16_k) != 0; }
|
|
231
|
-
SIMSIMD_DYNAMIC int simsimd_uses_neon_i8(void) { return (simsimd_capabilities() & simsimd_cap_neon_i8_k) != 0; }
|
|
232
|
-
SIMSIMD_DYNAMIC int simsimd_uses_sve(void) { return (simsimd_capabilities() & simsimd_cap_sve_k) != 0; }
|
|
233
|
-
SIMSIMD_DYNAMIC int simsimd_uses_sve_f16(void) { return (simsimd_capabilities() & simsimd_cap_sve_f16_k) != 0; }
|
|
234
|
-
SIMSIMD_DYNAMIC int simsimd_uses_sve_bf16(void) { return (simsimd_capabilities() & simsimd_cap_sve_bf16_k) != 0; }
|
|
235
|
-
SIMSIMD_DYNAMIC int simsimd_uses_sve_i8(void) { return (simsimd_capabilities() & simsimd_cap_sve_i8_k) != 0; }
|
|
236
|
-
SIMSIMD_DYNAMIC int simsimd_uses_haswell(void) { return (simsimd_capabilities() & simsimd_cap_haswell_k) != 0; }
|
|
237
|
-
SIMSIMD_DYNAMIC int simsimd_uses_skylake(void) { return (simsimd_capabilities() & simsimd_cap_skylake_k) != 0; }
|
|
238
|
-
SIMSIMD_DYNAMIC int simsimd_uses_ice(void) { return (simsimd_capabilities() & simsimd_cap_ice_k) != 0; }
|
|
239
|
-
SIMSIMD_DYNAMIC int simsimd_uses_genoa(void) { return (simsimd_capabilities() & simsimd_cap_genoa_k) != 0; }
|
|
240
|
-
SIMSIMD_DYNAMIC int simsimd_uses_sapphire(void) { return (simsimd_capabilities() & simsimd_cap_sapphire_k) != 0; }
|
|
241
|
-
SIMSIMD_DYNAMIC int simsimd_uses_turin(void) { return (simsimd_capabilities() & simsimd_cap_turin_k) != 0; }
|
|
242
|
-
SIMSIMD_DYNAMIC int simsimd_uses_sierra(void) { return (simsimd_capabilities() & simsimd_cap_sierra_k) != 0; }
|
|
243
|
-
SIMSIMD_DYNAMIC int simsimd_uses_dynamic_dispatch(void) { return 1; }
|
|
244
|
-
SIMSIMD_DYNAMIC int simsimd_flush_denormals(void) { return _simsimd_flush_denormals(); }
|
|
245
|
-
|
|
246
|
-
SIMSIMD_DYNAMIC simsimd_f32_t simsimd_f16_to_f32(simsimd_f16_t const *x_ptr) {
|
|
247
|
-
return simsimd_f16_to_f32_implementation(x_ptr);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
SIMSIMD_DYNAMIC void simsimd_f32_to_f16(simsimd_f32_t x, simsimd_f16_t *result_ptr) {
|
|
251
|
-
simsimd_f32_to_f16_implementation(x, result_ptr);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
SIMSIMD_DYNAMIC simsimd_f32_t simsimd_bf16_to_f32(simsimd_bf16_t const *x_ptr) {
|
|
255
|
-
return simsimd_bf16_to_f32_implementation(x_ptr);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
SIMSIMD_DYNAMIC void simsimd_f32_to_bf16(simsimd_f32_t x, simsimd_bf16_t *result_ptr) {
|
|
259
|
-
simsimd_f32_to_bf16_implementation(x, result_ptr);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
SIMSIMD_DYNAMIC simsimd_capability_t simsimd_capabilities(void) {
|
|
263
|
-
//! The latency of the CPUID instruction can be over 100 cycles, so we cache the result.
|
|
264
|
-
static simsimd_capability_t static_capabilities = simsimd_cap_any_k;
|
|
265
|
-
if (static_capabilities != simsimd_cap_any_k) return static_capabilities;
|
|
266
|
-
|
|
267
|
-
static_capabilities = _simsimd_capabilities_implementation();
|
|
268
|
-
|
|
269
|
-
// In multithreaded applications we need to ensure that the function pointers are pre-initialized,
|
|
270
|
-
// so the first time we are probing for capabilities, we should also probe all of our metrics
|
|
271
|
-
// with dummy inputs:
|
|
272
|
-
simsimd_distance_t dummy_results_buffer[2];
|
|
273
|
-
simsimd_distance_t *dummy_results = &dummy_results_buffer[0];
|
|
274
|
-
|
|
275
|
-
// Passing `NULL` as `x` will trigger all kinds of `nonull` warnings on GCC.
|
|
276
|
-
typedef double largest_scalar_t;
|
|
277
|
-
largest_scalar_t dummy_input[1];
|
|
278
|
-
void *x = &dummy_input[0];
|
|
279
|
-
|
|
280
|
-
// Dense:
|
|
281
|
-
simsimd_dot_i8((simsimd_i8_t *)x, (simsimd_i8_t *)x, 0, dummy_results);
|
|
282
|
-
simsimd_dot_u8((simsimd_u8_t *)x, (simsimd_u8_t *)x, 0, dummy_results);
|
|
283
|
-
simsimd_dot_f16((simsimd_f16_t *)x, (simsimd_f16_t *)x, 0, dummy_results);
|
|
284
|
-
simsimd_dot_bf16((simsimd_bf16_t *)x, (simsimd_bf16_t *)x, 0, dummy_results);
|
|
285
|
-
simsimd_dot_f32((simsimd_f32_t *)x, (simsimd_f32_t *)x, 0, dummy_results);
|
|
286
|
-
simsimd_dot_f64((simsimd_f64_t *)x, (simsimd_f64_t *)x, 0, dummy_results);
|
|
287
|
-
|
|
288
|
-
simsimd_dot_f16c((simsimd_f16c_t *)x, (simsimd_f16c_t *)x, 0, dummy_results);
|
|
289
|
-
simsimd_dot_bf16c((simsimd_bf16c_t *)x, (simsimd_bf16c_t *)x, 0, dummy_results);
|
|
290
|
-
simsimd_dot_f32c((simsimd_f32c_t *)x, (simsimd_f32c_t *)x, 0, dummy_results);
|
|
291
|
-
simsimd_dot_f64c((simsimd_f64c_t *)x, (simsimd_f64c_t *)x, 0, dummy_results);
|
|
292
|
-
simsimd_vdot_f16c((simsimd_f16c_t *)x, (simsimd_f16c_t *)x, 0, dummy_results);
|
|
293
|
-
simsimd_vdot_bf16c((simsimd_bf16c_t *)x, (simsimd_bf16c_t *)x, 0, dummy_results);
|
|
294
|
-
simsimd_vdot_f32c((simsimd_f32c_t *)x, (simsimd_f32c_t *)x, 0, dummy_results);
|
|
295
|
-
simsimd_vdot_f64c((simsimd_f64c_t *)x, (simsimd_f64c_t *)x, 0, dummy_results);
|
|
296
|
-
|
|
297
|
-
simsimd_cos_i8((simsimd_i8_t *)x, (simsimd_i8_t *)x, 0, dummy_results);
|
|
298
|
-
simsimd_cos_u8((simsimd_u8_t *)x, (simsimd_u8_t *)x, 0, dummy_results);
|
|
299
|
-
simsimd_cos_f16((simsimd_f16_t *)x, (simsimd_f16_t *)x, 0, dummy_results);
|
|
300
|
-
simsimd_cos_bf16((simsimd_bf16_t *)x, (simsimd_bf16_t *)x, 0, dummy_results);
|
|
301
|
-
simsimd_cos_f32((simsimd_f32_t *)x, (simsimd_f32_t *)x, 0, dummy_results);
|
|
302
|
-
simsimd_cos_f64((simsimd_f64_t *)x, (simsimd_f64_t *)x, 0, dummy_results);
|
|
303
|
-
|
|
304
|
-
simsimd_l2sq_i8((simsimd_i8_t *)x, (simsimd_i8_t *)x, 0, dummy_results);
|
|
305
|
-
simsimd_l2sq_u8((simsimd_u8_t *)x, (simsimd_u8_t *)x, 0, dummy_results);
|
|
306
|
-
simsimd_l2sq_f16((simsimd_f16_t *)x, (simsimd_f16_t *)x, 0, dummy_results);
|
|
307
|
-
simsimd_l2sq_bf16((simsimd_bf16_t *)x, (simsimd_bf16_t *)x, 0, dummy_results);
|
|
308
|
-
simsimd_l2sq_f32((simsimd_f32_t *)x, (simsimd_f32_t *)x, 0, dummy_results);
|
|
309
|
-
simsimd_l2sq_f64((simsimd_f64_t *)x, (simsimd_f64_t *)x, 0, dummy_results);
|
|
310
|
-
|
|
311
|
-
simsimd_l2_i8((simsimd_i8_t *)x, (simsimd_i8_t *)x, 0, dummy_results);
|
|
312
|
-
simsimd_l2_i8((simsimd_i8_t *)x, (simsimd_i8_t *)x, 0, dummy_results);
|
|
313
|
-
simsimd_l2_u8((simsimd_u8_t *)x, (simsimd_u8_t *)x, 0, dummy_results);
|
|
314
|
-
simsimd_l2_f16((simsimd_f16_t *)x, (simsimd_f16_t *)x, 0, dummy_results);
|
|
315
|
-
simsimd_l2_bf16((simsimd_bf16_t *)x, (simsimd_bf16_t *)x, 0, dummy_results);
|
|
316
|
-
simsimd_l2_f32((simsimd_f32_t *)x, (simsimd_f32_t *)x, 0, dummy_results);
|
|
317
|
-
simsimd_l2_f64((simsimd_f64_t *)x, (simsimd_f64_t *)x, 0, dummy_results);
|
|
318
|
-
|
|
319
|
-
simsimd_hamming_b8((simsimd_b8_t *)x, (simsimd_b8_t *)x, 0, dummy_results);
|
|
320
|
-
simsimd_jaccard_b8((simsimd_b8_t *)x, (simsimd_b8_t *)x, 0, dummy_results);
|
|
321
|
-
|
|
322
|
-
simsimd_kl_f16((simsimd_f16_t *)x, (simsimd_f16_t *)x, 0, dummy_results);
|
|
323
|
-
simsimd_kl_bf16((simsimd_bf16_t *)x, (simsimd_bf16_t *)x, 0, dummy_results);
|
|
324
|
-
simsimd_kl_f32((simsimd_f32_t *)x, (simsimd_f32_t *)x, 0, dummy_results);
|
|
325
|
-
simsimd_kl_f64((simsimd_f64_t *)x, (simsimd_f64_t *)x, 0, dummy_results);
|
|
326
|
-
simsimd_js_f16((simsimd_f16_t *)x, (simsimd_f16_t *)x, 0, dummy_results);
|
|
327
|
-
simsimd_js_bf16((simsimd_bf16_t *)x, (simsimd_bf16_t *)x, 0, dummy_results);
|
|
328
|
-
simsimd_js_f32((simsimd_f32_t *)x, (simsimd_f32_t *)x, 0, dummy_results);
|
|
329
|
-
simsimd_js_f64((simsimd_f64_t *)x, (simsimd_f64_t *)x, 0, dummy_results);
|
|
330
|
-
|
|
331
|
-
// Sparse
|
|
332
|
-
simsimd_intersect_u16((simsimd_u16_t *)x, (simsimd_u16_t *)x, 0, 0, dummy_results);
|
|
333
|
-
simsimd_intersect_u32((simsimd_u32_t *)x, (simsimd_u32_t *)x, 0, 0, dummy_results);
|
|
334
|
-
|
|
335
|
-
// Curved:
|
|
336
|
-
simsimd_bilinear_f64((simsimd_f64_t *)x, (simsimd_f64_t *)x, (simsimd_f64_t *)x, 0, dummy_results);
|
|
337
|
-
simsimd_mahalanobis_f64((simsimd_f64_t *)x, (simsimd_f64_t *)x, (simsimd_f64_t *)x, 0, dummy_results);
|
|
338
|
-
simsimd_bilinear_f32((simsimd_f32_t *)x, (simsimd_f32_t *)x, (simsimd_f32_t *)x, 0, dummy_results);
|
|
339
|
-
simsimd_mahalanobis_f32((simsimd_f32_t *)x, (simsimd_f32_t *)x, (simsimd_f32_t *)x, 0, dummy_results);
|
|
340
|
-
simsimd_bilinear_f16((simsimd_f16_t *)x, (simsimd_f16_t *)x, (simsimd_f16_t *)x, 0, dummy_results);
|
|
341
|
-
simsimd_mahalanobis_f16((simsimd_f16_t *)x, (simsimd_f16_t *)x, (simsimd_f16_t *)x, 0, dummy_results);
|
|
342
|
-
simsimd_bilinear_bf16((simsimd_bf16_t *)x, (simsimd_bf16_t *)x, (simsimd_bf16_t *)x, 0, dummy_results);
|
|
343
|
-
simsimd_mahalanobis_bf16((simsimd_bf16_t *)x, (simsimd_bf16_t *)x, (simsimd_bf16_t *)x, 0, dummy_results);
|
|
344
|
-
|
|
345
|
-
// Elementwise
|
|
346
|
-
simsimd_wsum_f64((simsimd_f64_t *)x, (simsimd_f64_t *)x, 0, 0, 0, (simsimd_f64_t *)x);
|
|
347
|
-
simsimd_wsum_f32((simsimd_f32_t *)x, (simsimd_f32_t *)x, 0, 0, 0, (simsimd_f32_t *)x);
|
|
348
|
-
simsimd_wsum_f16((simsimd_f16_t *)x, (simsimd_f16_t *)x, 0, 0, 0, (simsimd_f16_t *)x);
|
|
349
|
-
simsimd_wsum_bf16((simsimd_bf16_t *)x, (simsimd_bf16_t *)x, 0, 0, 0, (simsimd_bf16_t *)x);
|
|
350
|
-
simsimd_wsum_i8((simsimd_i8_t *)x, (simsimd_i8_t *)x, 0, 0, 0, (simsimd_i8_t *)x);
|
|
351
|
-
simsimd_wsum_u8((simsimd_u8_t *)x, (simsimd_u8_t *)x, 0, 0, 0, (simsimd_u8_t *)x);
|
|
352
|
-
simsimd_fma_f64((simsimd_f64_t *)x, (simsimd_f64_t *)x, (simsimd_f64_t *)x, 0, 0, 0, (simsimd_f64_t *)x);
|
|
353
|
-
simsimd_fma_f32((simsimd_f32_t *)x, (simsimd_f32_t *)x, (simsimd_f32_t *)x, 0, 0, 0, (simsimd_f32_t *)x);
|
|
354
|
-
simsimd_fma_f16((simsimd_f16_t *)x, (simsimd_f16_t *)x, (simsimd_f16_t *)x, 0, 0, 0, (simsimd_f16_t *)x);
|
|
355
|
-
simsimd_fma_bf16((simsimd_bf16_t *)x, (simsimd_bf16_t *)x, (simsimd_bf16_t *)x, 0, 0, 0, (simsimd_bf16_t *)x);
|
|
356
|
-
simsimd_fma_i8((simsimd_i8_t *)x, (simsimd_i8_t *)x, (simsimd_i8_t *)x, 0, 0, 0, (simsimd_i8_t *)x);
|
|
357
|
-
simsimd_fma_u8((simsimd_u8_t *)x, (simsimd_u8_t *)x, (simsimd_u8_t *)x, 0, 0, 0, (simsimd_u8_t *)x);
|
|
358
|
-
|
|
359
|
-
return static_capabilities;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
SIMSIMD_DYNAMIC void simsimd_find_kernel_punned( //
|
|
363
|
-
simsimd_metric_kind_t kind, //
|
|
364
|
-
simsimd_datatype_t datatype, //
|
|
365
|
-
simsimd_capability_t supported, //
|
|
366
|
-
simsimd_capability_t allowed, //
|
|
367
|
-
simsimd_kernel_punned_t *kernel_output, //
|
|
368
|
-
simsimd_capability_t *capability_output) {
|
|
369
|
-
_simsimd_find_kernel_punned_implementation(kind, datatype, supported, allowed, kernel_output, capability_output);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
#ifdef __cplusplus
|
|
373
|
-
}
|
|
374
|
-
#endif
|