react-native-executorch 0.10.5 → 0.10.7

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.
Files changed (251) hide show
  1. package/README.md +10 -1
  2. package/android/build.gradle.kts +4 -3
  3. package/ios/RnExecutorch.mm +15 -17
  4. package/lib/module/fetcher/fetcher.js +35 -122
  5. package/lib/module/fetcher/fetcher.js.map +1 -1
  6. package/lib/module/fetcher/telemetry.js +1 -1
  7. package/lib/module/index.js +12 -13
  8. package/lib/module/index.js.map +1 -1
  9. package/lib/module/models.js +4 -2
  10. package/lib/module/models.js.map +1 -1
  11. package/lib/typescript/src/fetcher/fetcher.d.ts +3 -7
  12. package/lib/typescript/src/fetcher/fetcher.d.ts.map +1 -1
  13. package/lib/typescript/src/models.d.ts.map +1 -1
  14. package/package.json +9 -7
  15. package/react-native-executorch.podspec +6 -2
  16. package/src/fetcher/fetcher.ts +38 -131
  17. package/src/fetcher/telemetry.ts +1 -1
  18. package/src/models.ts +6 -1
  19. package/third-party/common/phonemis/CMakeLists.txt +70 -14
  20. package/third-party/common/phonemis/README.md +183 -33
  21. package/third-party/common/phonemis/THIRD_PARTY_NOTICES.md +57 -0
  22. package/third-party/common/phonemis/knowledge/code_style.md +642 -0
  23. package/third-party/common/phonemis/licenses/Unicode-3.0.txt +39 -0
  24. package/third-party/common/phonemis/licenses/misaki-Apache-2.0.txt +201 -0
  25. package/third-party/common/phonemis/licenses/nlohmann-json-MIT.txt +21 -0
  26. package/third-party/common/phonemis/licenses/xsimd-BSD-3-Clause.txt +29 -0
  27. package/third-party/common/phonemis/src/phonemis/base/config.h +6 -0
  28. package/third-party/common/phonemis/src/phonemis/base/ipipeline.cpp +75 -0
  29. package/third-party/common/phonemis/src/phonemis/base/ipipeline.h +21 -0
  30. package/third-party/common/phonemis/src/phonemis/base/phonemizer/constants.h +2 -5
  31. package/third-party/common/phonemis/src/phonemis/base/phonemizer/lexicon_phonemizer.cpp +3 -4
  32. package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/neural_phonemizer.cpp +17 -8
  33. package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/neural_phonemizer.h +4 -0
  34. package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/tokenizer.cpp +21 -6
  35. package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/tokenizer.h +13 -4
  36. package/third-party/common/phonemis/src/phonemis/base/pipeline.cpp +8 -0
  37. package/third-party/common/phonemis/src/phonemis/base/pipeline.h +19 -0
  38. package/third-party/common/phonemis/src/phonemis/base/processor/common/conditions.cpp +37 -0
  39. package/third-party/common/phonemis/src/phonemis/base/processor/common/conditions.h +45 -0
  40. package/third-party/common/phonemis/src/phonemis/base/processor/common/constants.h +10 -0
  41. package/third-party/common/phonemis/src/phonemis/base/processor/common/context.cpp +105 -0
  42. package/third-party/common/phonemis/src/phonemis/base/processor/common/context.h +49 -0
  43. package/third-party/common/phonemis/src/phonemis/base/processor/common/document.cpp +173 -0
  44. package/third-party/common/phonemis/src/phonemis/base/processor/common/document.h +67 -0
  45. package/third-party/common/phonemis/src/phonemis/base/processor/common/text.cpp +75 -0
  46. package/third-party/common/phonemis/src/phonemis/base/processor/common/text.h +60 -0
  47. package/third-party/common/phonemis/src/phonemis/base/processor/common/types.h +18 -0
  48. package/third-party/common/phonemis/src/phonemis/base/processor/config.h +53 -0
  49. package/third-party/common/phonemis/src/phonemis/base/processor/layer.h +9 -7
  50. package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/constants.h +20 -0
  51. package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/layer.cpp +89 -0
  52. package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/layer.h +35 -0
  53. package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/types.h +16 -0
  54. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/kind.h +40 -0
  55. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/layer.h +382 -0
  56. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/notation.h +30 -0
  57. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/numerals.cpp +51 -0
  58. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/numerals.h +31 -0
  59. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/pattern.h +30 -0
  60. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/pattern_set.cpp +17 -0
  61. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/pattern_set.h +31 -0
  62. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/patterns.cpp +811 -0
  63. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/patterns.h +285 -0
  64. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/primitives.cpp +64 -0
  65. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/primitives.h +23 -0
  66. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/types.h +94 -0
  67. package/third-party/common/phonemis/src/phonemis/base/processor/layers/sanitizer/layer.cpp +19 -0
  68. package/third-party/common/phonemis/src/phonemis/base/processor/{sanitizer_layer.h → layers/sanitizer/layer.h} +8 -8
  69. package/third-party/common/phonemis/src/phonemis/base/processor/layers/sym2word/layer.cpp +65 -0
  70. package/third-party/common/phonemis/src/phonemis/base/processor/layers/sym2word/layer.h +29 -0
  71. package/third-party/common/phonemis/src/phonemis/base/processor/layers/term2word/layer.cpp +170 -0
  72. package/third-party/common/phonemis/src/phonemis/base/processor/layers/term2word/layer.h +40 -0
  73. package/third-party/common/phonemis/src/phonemis/base/processor/layers/term2word/types.h +25 -0
  74. package/third-party/common/phonemis/src/phonemis/base/processor/layers/trim/layer.cpp +47 -0
  75. package/third-party/common/phonemis/src/phonemis/base/processor/layers/trim/layer.h +19 -0
  76. package/third-party/common/phonemis/src/phonemis/base/processor/preprocessor.cpp +60 -0
  77. package/third-party/common/phonemis/src/phonemis/base/processor/preprocessor.h +45 -0
  78. package/third-party/common/phonemis/src/phonemis/base/processor/processor.cpp +6 -7
  79. package/third-party/common/phonemis/src/phonemis/base/processor/processor.h +14 -10
  80. package/third-party/common/phonemis/src/phonemis/base/tagger/hmm_tagger.cpp +89 -52
  81. package/third-party/common/phonemis/src/phonemis/base/tagger/hmm_tagger.h +16 -9
  82. package/third-party/common/phonemis/src/phonemis/base/tokenizer/tokenizer.cpp +13 -12
  83. package/third-party/common/phonemis/src/phonemis/lang/de/constants.h +183 -19
  84. package/third-party/common/phonemis/src/phonemis/lang/de/num2word.cpp +355 -309
  85. package/third-party/common/phonemis/src/phonemis/lang/de/num2word.h +42 -17
  86. package/third-party/common/phonemis/src/phonemis/lang/de/patterns.cpp +56 -0
  87. package/third-party/common/phonemis/src/phonemis/lang/de/patterns.h +15 -0
  88. package/third-party/common/phonemis/src/phonemis/lang/de/pipeline.h +3 -3
  89. package/third-party/common/phonemis/src/phonemis/lang/en/constants.h +181 -30
  90. package/third-party/common/phonemis/src/phonemis/lang/en/hmm_tagger.cpp +5 -7
  91. package/third-party/common/phonemis/src/phonemis/lang/en/num2word.cpp +232 -135
  92. package/third-party/common/phonemis/src/phonemis/lang/en/num2word.h +41 -16
  93. package/third-party/common/phonemis/src/phonemis/lang/en/pipeline.h +3 -10
  94. package/third-party/common/phonemis/src/phonemis/lang/es/constants.h +182 -60
  95. package/third-party/common/phonemis/src/phonemis/lang/es/num2word.cpp +247 -212
  96. package/third-party/common/phonemis/src/phonemis/lang/es/num2word.h +38 -18
  97. package/third-party/common/phonemis/src/phonemis/lang/es/patterns.cpp +50 -0
  98. package/third-party/common/phonemis/src/phonemis/lang/es/patterns.h +15 -0
  99. package/third-party/common/phonemis/src/phonemis/lang/es/pipeline.h +3 -3
  100. package/third-party/common/phonemis/src/phonemis/lang/fr/constants.h +152 -26
  101. package/third-party/common/phonemis/src/phonemis/lang/fr/num2word.cpp +252 -179
  102. package/third-party/common/phonemis/src/phonemis/lang/fr/num2word.h +38 -15
  103. package/third-party/common/phonemis/src/phonemis/lang/fr/patterns.cpp +83 -0
  104. package/third-party/common/phonemis/src/phonemis/lang/fr/patterns.h +15 -0
  105. package/third-party/common/phonemis/src/phonemis/lang/fr/pipeline.h +3 -3
  106. package/third-party/common/phonemis/src/phonemis/lang/hi/constants.h +62 -10
  107. package/third-party/common/phonemis/src/phonemis/lang/hi/num2word.cpp +74 -123
  108. package/third-party/common/phonemis/src/phonemis/lang/hi/num2word.h +27 -16
  109. package/third-party/common/phonemis/src/phonemis/lang/hi/pipeline.h +5 -3
  110. package/third-party/common/phonemis/src/phonemis/lang/it/constants.h +122 -42
  111. package/third-party/common/phonemis/src/phonemis/lang/it/num2word.cpp +200 -207
  112. package/third-party/common/phonemis/src/phonemis/lang/it/num2word.h +30 -18
  113. package/third-party/common/phonemis/src/phonemis/lang/it/patterns.cpp +25 -0
  114. package/third-party/common/phonemis/src/phonemis/lang/it/patterns.h +15 -0
  115. package/third-party/common/phonemis/src/phonemis/lang/it/pipeline.h +3 -3
  116. package/third-party/common/phonemis/src/phonemis/lang/pl/constants.h +346 -77
  117. package/third-party/common/phonemis/src/phonemis/lang/pl/num2word.cpp +631 -246
  118. package/third-party/common/phonemis/src/phonemis/lang/pl/num2word.h +47 -15
  119. package/third-party/common/phonemis/src/phonemis/lang/pl/pipeline.h +6 -6
  120. package/third-party/common/phonemis/src/phonemis/lang/pt/constants.h +201 -0
  121. package/third-party/common/phonemis/src/phonemis/lang/pt/num2word.cpp +365 -0
  122. package/third-party/common/phonemis/src/phonemis/lang/pt/num2word.h +53 -0
  123. package/third-party/common/phonemis/src/phonemis/lang/pt/pipeline.h +4 -2
  124. package/third-party/common/phonemis/src/phonemis/main.cpp +42 -11
  125. package/third-party/common/phonemis/src/phonemis/protophone/meta.h +24 -0
  126. package/third-party/common/phonemis/src/phonemis/protophone/numeric.h +26 -0
  127. package/third-party/common/phonemis/src/phonemis/protophone/protophone.cpp +525 -0
  128. package/third-party/common/phonemis/src/phonemis/protophone/protophone.h +80 -0
  129. package/third-party/common/phonemis/src/phonemis/protophone/tensor.h +76 -0
  130. package/third-party/common/phonemis/src/phonemis/protophone/tensor_utils.h +89 -0
  131. package/third-party/common/phonemis/src/phonemis/protophone/tensor_view.h +125 -0
  132. package/third-party/common/phonemis/src/phonemis/protophone/types.h +43 -0
  133. package/third-party/common/phonemis/src/phonemis/utils/strings.h +20 -14
  134. package/third-party/common/phonemis/src/phonemis/utils/unicode.h +15 -1
  135. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_arithmetic.hpp +267 -0
  136. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_bit.hpp +232 -0
  137. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_cast.hpp +43 -0
  138. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_complex.hpp +112 -0
  139. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_details.hpp +386 -0
  140. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_logical.hpp +240 -0
  141. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_math.hpp +2601 -0
  142. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_memory.hpp +1006 -0
  143. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_rounding.hpp +72 -0
  144. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_swizzle.hpp +260 -0
  145. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_trigo.hpp +996 -0
  146. package/third-party/common/phonemis/src/third-party/xsimd/arch/utils/shifts.hpp +82 -0
  147. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx.hpp +2111 -0
  148. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx2.hpp +1591 -0
  149. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx2_128.hpp +170 -0
  150. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512bw.hpp +724 -0
  151. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512cd.hpp +28 -0
  152. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512dq.hpp +270 -0
  153. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512er.hpp +17 -0
  154. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512f.hpp +2919 -0
  155. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512ifma.hpp +17 -0
  156. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512pf.hpp +17 -0
  157. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vbmi.hpp +76 -0
  158. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vbmi2.hpp +130 -0
  159. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vnni_avx512bw.hpp +17 -0
  160. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vnni_avx512vbmi2.hpp +17 -0
  161. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx_128.hpp +164 -0
  162. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avxvnni.hpp +17 -0
  163. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_common.hpp +26 -0
  164. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_common_fwd.hpp +127 -0
  165. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_constants.hpp +393 -0
  166. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_emulated.hpp +787 -0
  167. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma3_avx.hpp +93 -0
  168. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma3_avx2.hpp +46 -0
  169. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma3_sse.hpp +97 -0
  170. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma4.hpp +92 -0
  171. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_i8mm_neon64.hpp +17 -0
  172. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_isa.hpp +148 -0
  173. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_neon.hpp +3580 -0
  174. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_neon64.hpp +1614 -0
  175. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_rvv.hpp +1515 -0
  176. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_scalar.hpp +1210 -0
  177. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse2.hpp +2333 -0
  178. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse3.hpp +66 -0
  179. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse4_1.hpp +510 -0
  180. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse4_2.hpp +44 -0
  181. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_ssse3.hpp +186 -0
  182. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sve.hpp +1186 -0
  183. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_vsx.hpp +947 -0
  184. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_vxe.hpp +787 -0
  185. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_wasm.hpp +1819 -0
  186. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_arch.hpp +242 -0
  187. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_config.hpp +633 -0
  188. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features.hpp +50 -0
  189. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_arm.hpp +132 -0
  190. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_ppc.hpp +54 -0
  191. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_riscv.hpp +95 -0
  192. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_s390x.hpp +56 -0
  193. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_x86.hpp +1121 -0
  194. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpuid.hpp +144 -0
  195. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_getauxval.hpp +159 -0
  196. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_macros.hpp +78 -0
  197. package/third-party/common/phonemis/src/third-party/xsimd/math/xsimd_rem_pio2.hpp +707 -0
  198. package/third-party/common/phonemis/src/third-party/xsimd/memory/xsimd_aligned_allocator.hpp +349 -0
  199. package/third-party/common/phonemis/src/third-party/xsimd/memory/xsimd_alignment.hpp +102 -0
  200. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_all_registers.hpp +57 -0
  201. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_api.hpp +3106 -0
  202. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx2_register.hpp +57 -0
  203. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512bw_register.hpp +51 -0
  204. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512cd_register.hpp +51 -0
  205. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512dq_register.hpp +51 -0
  206. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512er_register.hpp +51 -0
  207. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512f_register.hpp +77 -0
  208. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512ifma_register.hpp +51 -0
  209. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512pf_register.hpp +51 -0
  210. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vbmi2_register.hpp +51 -0
  211. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vbmi_register.hpp +51 -0
  212. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vnni_avx512bw_register.hpp +54 -0
  213. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vnni_avx512vbmi2_register.hpp +53 -0
  214. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx_register.hpp +79 -0
  215. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avxvnni_register.hpp +44 -0
  216. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_batch.hpp +1666 -0
  217. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_batch_constant.hpp +572 -0
  218. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_batch_fwd.hpp +41 -0
  219. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_common_arch.hpp +49 -0
  220. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_emulated_register.hpp +80 -0
  221. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma3_avx2_register.hpp +50 -0
  222. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma3_avx_register.hpp +50 -0
  223. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma3_sse_register.hpp +50 -0
  224. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma4_register.hpp +50 -0
  225. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_i8mm_neon64_register.hpp +55 -0
  226. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_neon64_register.hpp +55 -0
  227. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_neon_register.hpp +130 -0
  228. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_register.hpp +96 -0
  229. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_rvv_register.hpp +491 -0
  230. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse2_register.hpp +59 -0
  231. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse3_register.hpp +49 -0
  232. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse4_1_register.hpp +48 -0
  233. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse4_2_register.hpp +48 -0
  234. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_ssse3_register.hpp +48 -0
  235. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sve_register.hpp +216 -0
  236. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_traits.hpp +409 -0
  237. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_utils.hpp +462 -0
  238. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_vsx_register.hpp +84 -0
  239. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_vxe_register.hpp +86 -0
  240. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_wasm_register.hpp +59 -0
  241. package/third-party/common/phonemis/src/third-party/xsimd/utils/bits.hpp +122 -0
  242. package/third-party/common/phonemis/src/third-party/xsimd/utils/xsimd_type_traits.hpp +145 -0
  243. package/third-party/common/phonemis/src/third-party/xsimd/xsimd.hpp +43 -0
  244. package/third-party/common/phonemis/src/phonemis/base/processor/constants.h +0 -11
  245. package/third-party/common/phonemis/src/phonemis/base/processor/num2word/config.h +0 -16
  246. package/third-party/common/phonemis/src/phonemis/base/processor/num2word/layer.cpp +0 -271
  247. package/third-party/common/phonemis/src/phonemis/base/processor/num2word/layer.h +0 -45
  248. package/third-party/common/phonemis/src/phonemis/base/processor/num2word/types.h +0 -29
  249. package/third-party/common/phonemis/src/phonemis/base/processor/sanitizer_layer.cpp +0 -22
  250. package/third-party/common/phonemis/src/phonemis/base/processor/trim_layer.cpp +0 -40
  251. package/third-party/common/phonemis/src/phonemis/base/processor/trim_layer.h +0 -22
@@ -0,0 +1,572 @@
1
+ /***************************************************************************
2
+ * Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
3
+ * Martin Renou *
4
+ * Copyright (c) QuantStack *
5
+ * Copyright (c) Serge Guelton *
6
+ * *
7
+ * Distributed under the terms of the BSD 3-Clause License. *
8
+ * *
9
+ * The full license is in the file LICENSE, distributed with this software. *
10
+ ****************************************************************************/
11
+
12
+ #ifndef XSIMD_BATCH_CONSTANT_HPP
13
+ #define XSIMD_BATCH_CONSTANT_HPP
14
+
15
+ #include <cstddef>
16
+ #include <functional>
17
+ #include <utility>
18
+
19
+ #include "../config/xsimd_config.hpp"
20
+ #include "./xsimd_batch.hpp"
21
+ #include "./xsimd_utils.hpp"
22
+
23
+ namespace xsimd
24
+ {
25
+ /**
26
+ * @brief batch of boolean constant
27
+ *
28
+ * Abstract representation of a batch of boolean constants.
29
+ *
30
+ * @tparam batch_type the type of the associated batch values.
31
+ * @tparam Values boolean constant represented by this batch
32
+ **/
33
+ template <typename T, class A, bool... Values>
34
+ struct batch_bool_constant
35
+ {
36
+ using batch_type = batch_bool<T, A>;
37
+ static constexpr std::size_t size = sizeof...(Values);
38
+ using value_type = bool;
39
+ using operand_type = T;
40
+ static_assert(sizeof...(Values) == batch_type::size, "consistent batch size");
41
+
42
+ public:
43
+ /**
44
+ * @brief Generate a batch of @p batch_type from this @p batch_bool_constant
45
+ */
46
+ constexpr batch_type as_batch_bool() const noexcept { return { Values... }; }
47
+
48
+ /**
49
+ * @brief Generate a batch of @p integers from this @p batch_bool_constant
50
+ */
51
+ constexpr batch<as_integer_t<T>, A> as_batch() const noexcept { return { -as_integer_t<T>(Values)... }; } // the minus is important!
52
+ /**
53
+ * @brief Generate a batch of @p batch_type from this @p batch_bool_constant
54
+ */
55
+ constexpr operator batch_type() const noexcept { return as_batch_bool(); }
56
+
57
+ constexpr bool get(std::size_t i) const noexcept
58
+ {
59
+ return std::array<value_type, size> { { Values... } }[i];
60
+ }
61
+
62
+ static constexpr int mask() noexcept
63
+ {
64
+ return mask_helper(0, static_cast<int>(Values)...);
65
+ }
66
+
67
+ static constexpr bool none() noexcept
68
+ {
69
+ return truncated_mask() == 0u;
70
+ }
71
+
72
+ static constexpr bool any() noexcept
73
+ {
74
+ return !none();
75
+ }
76
+
77
+ static constexpr bool all() noexcept
78
+ {
79
+ return truncated_mask() == low_mask(size);
80
+ }
81
+
82
+ static constexpr std::size_t countr_zero() noexcept
83
+ {
84
+ return countr_zero_impl(truncated_mask(), size);
85
+ }
86
+
87
+ static constexpr std::size_t countl_zero() noexcept
88
+ {
89
+ return countl_zero_impl(truncated_mask(), size);
90
+ }
91
+
92
+ static constexpr std::size_t countr_one() noexcept
93
+ {
94
+ return countr_one_impl(truncated_mask(), size);
95
+ }
96
+
97
+ static constexpr std::size_t countl_one() noexcept
98
+ {
99
+ return countl_one_impl(truncated_mask(), size);
100
+ }
101
+
102
+ private:
103
+ static constexpr int mask_helper(int acc) noexcept { return acc; }
104
+
105
+ template <class... Tys>
106
+ static constexpr int mask_helper(int acc, int mask, Tys... masks) noexcept
107
+ {
108
+ return mask_helper(acc | mask, (masks << 1)...);
109
+ }
110
+
111
+ struct logical_or
112
+ {
113
+ constexpr bool operator()(bool x, bool y) const { return x || y; }
114
+ };
115
+ struct logical_and
116
+ {
117
+ constexpr bool operator()(bool x, bool y) const { return x && y; }
118
+ };
119
+ struct logical_xor
120
+ {
121
+ constexpr bool operator()(bool x, bool y) const { return x ^ y; }
122
+ };
123
+
124
+ template <class F, class SelfPack, class OtherPack, std::size_t... Indices>
125
+ static constexpr batch_bool_constant<T, A, F()(std::tuple_element<Indices, SelfPack>::type::value, std::tuple_element<Indices, OtherPack>::type::value)...>
126
+ apply(std::index_sequence<Indices...>)
127
+ {
128
+ return {};
129
+ }
130
+
131
+ template <class F, bool... OtherValues>
132
+ static constexpr auto apply(batch_bool_constant<T, A, Values...>, batch_bool_constant<T, A, OtherValues...>)
133
+ {
134
+ static_assert(sizeof...(Values) == sizeof...(OtherValues), "compatible constant batches");
135
+ return apply<F, std::tuple<std::integral_constant<bool, Values>...>, std::tuple<std::integral_constant<bool, OtherValues>...>>(std::make_index_sequence<sizeof...(Values)>());
136
+ }
137
+
138
+ public:
139
+ #define MAKE_BINARY_OP(OP, NAME) \
140
+ template <bool... OtherValues> \
141
+ constexpr auto operator OP(batch_bool_constant<T, A, OtherValues...> other) const \
142
+ { \
143
+ return apply<NAME>(*this, other); \
144
+ }
145
+
146
+ MAKE_BINARY_OP(|, logical_or)
147
+ MAKE_BINARY_OP(||, logical_or)
148
+ MAKE_BINARY_OP(&, logical_and)
149
+ MAKE_BINARY_OP(&&, logical_and)
150
+ MAKE_BINARY_OP(^, logical_xor)
151
+
152
+ #undef MAKE_BINARY_OP
153
+
154
+ constexpr batch_bool_constant<T, A, !Values...> operator!() const
155
+ {
156
+ return {};
157
+ }
158
+
159
+ constexpr batch_bool_constant<T, A, !Values...> operator~() const
160
+ {
161
+ return {};
162
+ }
163
+
164
+ private:
165
+ // Build a 64-bit mask from Values... (LSB = index 0)
166
+ template <std::size_t I, bool... Remaining>
167
+ struct build_bits_helper;
168
+
169
+ template <std::size_t I>
170
+ struct build_bits_helper<I>
171
+ {
172
+ static constexpr uint64_t value = 0u;
173
+ };
174
+
175
+ template <std::size_t I, bool Current, bool... Remaining>
176
+ struct build_bits_helper<I, Current, Remaining...>
177
+ {
178
+ static constexpr uint64_t value = (Current ? (uint64_t(1) << I) : 0u)
179
+ | build_bits_helper<I + 1, Remaining...>::value;
180
+ };
181
+
182
+ static constexpr uint64_t bits() noexcept
183
+ {
184
+ return build_bits_helper<0, Values...>::value;
185
+ }
186
+ static constexpr uint64_t low_mask(std::size_t k) noexcept
187
+ {
188
+ return (k >= 64u) ? ~uint64_t(0) : ((uint64_t(1) << k) - 1u);
189
+ }
190
+ static constexpr uint64_t truncated_mask() noexcept
191
+ {
192
+ return bits() & low_mask(size);
193
+ }
194
+ static constexpr std::size_t countr_zero_impl(uint64_t v, std::size_t n) noexcept
195
+ {
196
+ return (n == 0 || (v & 1u) != 0u) ? 0u : (1u + countr_zero_impl(v >> 1, n - 1));
197
+ }
198
+ static constexpr std::size_t countr_one_impl(uint64_t v, std::size_t n) noexcept
199
+ {
200
+ return (n == 0 || (v & 1u) == 0u) ? 0u : (1u + countr_one_impl(v >> 1, n - 1));
201
+ }
202
+ static constexpr std::size_t countl_zero_impl(uint64_t v, std::size_t n) noexcept
203
+ {
204
+ return (n == 0) ? 0u : ((((v >> (n - 1)) & 1u) != 0u) ? 0u : (1u + countl_zero_impl(v, n - 1)));
205
+ }
206
+ static constexpr std::size_t countl_one_impl(uint64_t v, std::size_t n) noexcept
207
+ {
208
+ return (n == 0) ? 0u : ((((v >> (n - 1)) & 1u) == 0u) ? 0u : (1u + countl_one_impl(v, n - 1)));
209
+ }
210
+ };
211
+
212
+ namespace detail
213
+ {
214
+ template <class A2, std::size_t BeginIdx, typename T, class A, bool... Values, std::size_t... Is>
215
+ XSIMD_INLINE constexpr batch_bool_constant<
216
+ T, A2,
217
+ std::tuple_element<BeginIdx + Is,
218
+ std::tuple<std::integral_constant<bool, Values>...>>::type::value...>
219
+ splice_impl(std::index_sequence<Is...>) noexcept
220
+ {
221
+ return {};
222
+ }
223
+
224
+ template <class A2, std::size_t Begin, std::size_t End,
225
+ typename T, class A, bool... Values,
226
+ std::size_t N = (End >= Begin ? (End - Begin) : 0)>
227
+ XSIMD_INLINE constexpr auto splice(batch_bool_constant<T, A, Values...>) noexcept
228
+ {
229
+ static_assert(Begin <= End, "splice: Begin must be <= End");
230
+ static_assert(End <= sizeof...(Values), "splice: End must be <= size");
231
+ static_assert(N == batch_bool<T, A2>::size, "splice: target arch size must match submask length");
232
+ return splice_impl<A2, Begin, T, A, Values...>(std::make_index_sequence<N>());
233
+ }
234
+
235
+ template <class A2, typename T, class A, bool... Values>
236
+ XSIMD_INLINE constexpr auto lower_half(batch_bool_constant<T, A, Values...>) noexcept
237
+ {
238
+ static_assert(sizeof...(Values) % 2 == 0, "lower_half requires even size");
239
+ static_assert(batch_bool<T, A2>::size == sizeof...(Values) / 2,
240
+ "lower_half: target arch size must match submask length");
241
+ return splice_impl<A2, 0, T, A, Values...>(std::make_index_sequence<sizeof...(Values) / 2>());
242
+ }
243
+
244
+ template <class A2, typename T, class A, bool... Values>
245
+ XSIMD_INLINE constexpr auto upper_half(batch_bool_constant<T, A, Values...>) noexcept
246
+ {
247
+ static_assert(sizeof...(Values) % 2 == 0, "upper_half requires even size");
248
+ static_assert(batch_bool<T, A2>::size == sizeof...(Values) / 2,
249
+ "upper_half: target arch size must match submask length");
250
+ return splice_impl<A2, sizeof...(Values) / 2, T, A, Values...>(std::make_index_sequence<sizeof...(Values) / 2>());
251
+ }
252
+ } // namespace detail
253
+
254
+ /**
255
+ * @brief batch of integral constants
256
+ *
257
+ * Abstract representation of a batch of integral constants.
258
+ *
259
+ * @tparam batch_type the type of the associated batch values.
260
+ * @tparam Values constants represented by this batch
261
+ **/
262
+ template <typename T, class A, T... Values>
263
+ struct batch_constant
264
+ {
265
+ static constexpr std::size_t size = sizeof...(Values);
266
+ using batch_type = batch<T, A>;
267
+ using value_type = typename batch_type::value_type;
268
+ static_assert(sizeof...(Values) == batch_type::size, "consistent batch size");
269
+
270
+ /**
271
+ * @brief Generate a batch of @p batch_type from this @p batch_constant
272
+ */
273
+ XSIMD_INLINE batch_type as_batch() const noexcept { return { Values... }; }
274
+
275
+ /**
276
+ * @brief Generate a batch of @p batch_type from this @p batch_constant
277
+ */
278
+ XSIMD_INLINE operator batch_type() const noexcept { return as_batch(); }
279
+
280
+ /**
281
+ * @brief Get the @p i th element of this @p batch_constant
282
+ */
283
+ constexpr T get(std::size_t i) const noexcept
284
+ {
285
+ return get(i, std::array<T, size> { Values... });
286
+ }
287
+
288
+ private:
289
+ constexpr T get(std::size_t i, std::array<T, size> const& values) const noexcept
290
+ {
291
+ return values[i];
292
+ }
293
+
294
+ template <typename = void>
295
+ struct binary_rshift
296
+ {
297
+ constexpr T operator()(T x, T y) const { return x >> y; }
298
+ };
299
+ template <typename = void>
300
+ struct binary_lshift
301
+ {
302
+ constexpr T operator()(T x, T y) const { return x << y; }
303
+ };
304
+
305
+ template <class F, class SelfPack, class OtherPack, std::size_t... Indices>
306
+ static constexpr batch_constant<T, A, F()(std::tuple_element<Indices, SelfPack>::type::value, std::tuple_element<Indices, OtherPack>::type::value)...>
307
+ apply(std::index_sequence<Indices...>)
308
+ {
309
+ return {};
310
+ }
311
+
312
+ template <class F, T... OtherValues>
313
+ static constexpr auto apply(batch_constant<T, A, Values...>, batch_constant<T, A, OtherValues...>)
314
+ {
315
+ static_assert(sizeof...(Values) == sizeof...(OtherValues), "compatible constant batches");
316
+ return apply<F, std::tuple<std::integral_constant<T, Values>...>, std::tuple<std::integral_constant<T, OtherValues>...>>(std::make_index_sequence<sizeof...(Values)>());
317
+ }
318
+
319
+ public:
320
+ #define MAKE_BINARY_OP(OP, NAME) \
321
+ template <T... OtherValues> \
322
+ constexpr auto operator OP(batch_constant<T, A, OtherValues...> other) const \
323
+ { \
324
+ return apply<NAME<void>>(*this, other); \
325
+ } \
326
+ template <T OtherValue> \
327
+ constexpr batch_constant<T, A, (Values OP OtherValue)...> operator OP(std::integral_constant<T, OtherValue>) const \
328
+ { \
329
+ return {}; \
330
+ }
331
+
332
+ MAKE_BINARY_OP(+, std::plus)
333
+ MAKE_BINARY_OP(-, std::minus)
334
+ MAKE_BINARY_OP(*, std::multiplies)
335
+ MAKE_BINARY_OP(/, std::divides)
336
+ MAKE_BINARY_OP(%, std::modulus)
337
+ MAKE_BINARY_OP(&, std::bit_and)
338
+ MAKE_BINARY_OP(|, std::bit_or)
339
+ MAKE_BINARY_OP(^, std::bit_xor)
340
+ MAKE_BINARY_OP(<<, binary_lshift)
341
+ MAKE_BINARY_OP(>>, binary_rshift)
342
+
343
+ #undef MAKE_BINARY_OP
344
+
345
+ template <class F, class SelfPack, class OtherPack, std::size_t... Indices>
346
+ static constexpr batch_bool_constant<T, A, F()(std::tuple_element<Indices, SelfPack>::type::value, std::tuple_element<Indices, OtherPack>::type::value)...>
347
+ apply_bool(std::index_sequence<Indices...>)
348
+ {
349
+ return {};
350
+ }
351
+
352
+ template <class F, T... OtherValues>
353
+ static constexpr auto apply_bool(batch_constant<T, A, Values...>, batch_constant<T, A, OtherValues...>)
354
+ {
355
+ static_assert(sizeof...(Values) == sizeof...(OtherValues), "compatible constant batches");
356
+ return apply_bool<F, std::tuple<std::integral_constant<T, Values>...>, std::tuple<std::integral_constant<T, OtherValues>...>>(std::make_index_sequence<sizeof...(Values)>());
357
+ }
358
+
359
+ #define MAKE_BINARY_BOOL_OP(OP, NAME) \
360
+ template <T... OtherValues> \
361
+ constexpr auto operator OP(batch_constant<T, A, OtherValues...> other) const \
362
+ { \
363
+ return apply_bool<NAME<void>>(*this, other); \
364
+ } \
365
+ template <T OtherValue> \
366
+ constexpr batch_bool_constant<T, A, (Values OP OtherValue)...> operator OP(std::integral_constant<T, OtherValue>) const \
367
+ { \
368
+ return {}; \
369
+ }
370
+
371
+ MAKE_BINARY_BOOL_OP(==, std::equal_to)
372
+ MAKE_BINARY_BOOL_OP(!=, std::not_equal_to)
373
+ MAKE_BINARY_BOOL_OP(<, std::less)
374
+ MAKE_BINARY_BOOL_OP(<=, std::less_equal)
375
+ MAKE_BINARY_BOOL_OP(>, std::greater)
376
+ MAKE_BINARY_BOOL_OP(>=, std::greater_equal)
377
+
378
+ #undef MAKE_BINARY_BOOL_OP
379
+
380
+ constexpr batch_constant<T, A, (T)-Values...> operator-() const
381
+ {
382
+ return {};
383
+ }
384
+
385
+ constexpr batch_constant<T, A, (T) + Values...> operator+() const
386
+ {
387
+ return {};
388
+ }
389
+
390
+ constexpr batch_constant<T, A, (T)~Values...> operator~() const
391
+ {
392
+ return {};
393
+ }
394
+ };
395
+
396
+ namespace detail
397
+ {
398
+ template <typename T, class G, class A, std::size_t... Is>
399
+ XSIMD_INLINE constexpr batch_constant<T, A, (T)G::get(Is, sizeof...(Is))...>
400
+ make_batch_constant(std::index_sequence<Is...>) noexcept
401
+ {
402
+ return {};
403
+ }
404
+
405
+ template <typename T, T Val, class A, std::size_t... Is>
406
+ XSIMD_INLINE constexpr batch_constant<T, A, (static_cast<T>(0 * Is) + Val)...>
407
+ make_batch_constant(std::index_sequence<Is...>) noexcept
408
+ {
409
+ return {};
410
+ }
411
+
412
+ #if XSIMD_CPP_VERSION >= 202002L
413
+ template <std::array Arr, class A, std::size_t... Is>
414
+ XSIMD_INLINE constexpr batch_constant<typename decltype(Arr)::value_type, A, Arr[Is]...>
415
+ make_batch_constant(std::index_sequence<Is...>) noexcept
416
+ {
417
+ return {};
418
+ }
419
+ #endif
420
+
421
+ template <typename T, class G, class A, std::size_t... Is>
422
+ XSIMD_INLINE constexpr batch_bool_constant<T, A, G::get(Is, sizeof...(Is))...>
423
+ make_batch_bool_constant(std::index_sequence<Is...>) noexcept
424
+ {
425
+ return {};
426
+ }
427
+
428
+ template <typename T, bool Val, class A, std::size_t... Is>
429
+ XSIMD_INLINE constexpr batch_bool_constant<T, A, ((static_cast<bool>(Is) | true) & Val)...>
430
+ make_batch_bool_constant(std::index_sequence<Is...>) noexcept
431
+ {
432
+ return {};
433
+ }
434
+
435
+ #if XSIMD_CPP_VERSION >= 202002L
436
+ template <typename T, std::array Arr, class A, std::size_t... Is>
437
+ XSIMD_INLINE constexpr batch_bool_constant<T, A, Arr[Is]...>
438
+ make_batch_bool_constant(std::index_sequence<Is...>) noexcept
439
+ {
440
+ return {};
441
+ }
442
+ #endif
443
+
444
+ } // namespace detail
445
+
446
+ /**
447
+ * @brief Build a @c batch_constant out of a generator function
448
+ *
449
+ * @tparam batch_type type of the (non-constant) batch to build
450
+ * @tparam G type used to generate that batch. That type must have a static
451
+ * member @c get that's used to generate the batch constant. Conversely, the
452
+ * generated batch_constant has value `{G::get(0, batch_size), ... , G::get(batch_size - 1, batch_size)}`
453
+ *
454
+ * The following generator produces a batch of `(n - 1, 0, 1, ... n-2)`
455
+ *
456
+ * @code
457
+ * struct Rot
458
+ * {
459
+ * static constexpr unsigned get(unsigned i, unsigned n)
460
+ * {
461
+ * return (i + n - 1) % n;
462
+ * }
463
+ * };
464
+ * @endcode
465
+ */
466
+ template <typename T, class G, class A = default_arch>
467
+ XSIMD_INLINE constexpr decltype(detail::make_batch_constant<T, G, A>(std::make_index_sequence<batch<T, A>::size>()))
468
+ make_batch_constant() noexcept
469
+ {
470
+ return {};
471
+ }
472
+
473
+ /**
474
+ * @brief Build a @c batch_bool_constant out of a generator function
475
+ *
476
+ * Similar to @c make_batch_constant for @c batch_bool_constant
477
+ */
478
+ template <typename T, class G, class A = default_arch>
479
+ XSIMD_INLINE constexpr decltype(detail::make_batch_bool_constant<T, G, A>(std::make_index_sequence<batch<T, A>::size>()))
480
+ make_batch_bool_constant() noexcept
481
+ {
482
+ return {};
483
+ }
484
+
485
+ // FIXME: Skipping those for doxygen because of bad interaction with breathe.
486
+ #ifndef DOXYGEN_SHOULD_SKIP_THIS
487
+ /**
488
+ * @brief Build a @c batch_constant with a single repeated value.
489
+ *
490
+ * @tparam T type of the data held in the batch.
491
+ * @tparam Val The value to repeat.
492
+ * @tparam A Architecture that will be used when converting to a regular batch.
493
+ */
494
+ template <typename T, T Val, class A = default_arch>
495
+ XSIMD_INLINE constexpr decltype(detail::make_batch_constant<T, Val, A>(std::make_index_sequence<batch<T, A>::size>()))
496
+ make_batch_constant() noexcept
497
+ {
498
+ return {};
499
+ }
500
+
501
+ #if XSIMD_CPP_VERSION >= 202002L
502
+ /**
503
+ * @brief Build a @c batch_constant from a std::array (C++20)
504
+ *
505
+ * @tparam Arr The std::array containing the values (non type template argument).
506
+ * @tparam A Architecture that will be used when converting to a regular batch.
507
+ */
508
+ template <std::array Arr, class A = default_arch>
509
+ requires(Arr.size() == batch<typename decltype(Arr)::value_type, A>::size)
510
+ XSIMD_INLINE constexpr auto make_batch_constant() noexcept
511
+ {
512
+ return detail::make_batch_constant<Arr, A>(std::make_index_sequence<Arr.size()>());
513
+ }
514
+ #endif
515
+
516
+ /*
517
+ * @brief Build a @c batch_bool_constant with a single repeated value.
518
+ *
519
+ * Similar to @c make_batch_constant for @c batch_bool_constant
520
+ */
521
+ template <typename T, bool Val, class A = default_arch>
522
+ XSIMD_INLINE constexpr decltype(detail::make_batch_bool_constant<T, Val, A>(std::make_index_sequence<batch<T, A>::size>()))
523
+ make_batch_bool_constant() noexcept
524
+ {
525
+ return {};
526
+ }
527
+
528
+ #if XSIMD_CPP_VERSION >= 202002L
529
+ /**
530
+ * @brief Build a @c batch_constant from a std::array of boolean (C++20)
531
+ *
532
+ * @tparam Arr The std::array containing the boolean values (non type template argument).
533
+ * @tparam A Architecture that will be used when converting to a regular batch.
534
+ */
535
+ template <typename T, std::array Arr, class A = default_arch>
536
+ requires(
537
+ (Arr.size() == batch_bool<T, A>::size)
538
+ && std::is_same_v<typename decltype(Arr)::value_type, bool>)
539
+ XSIMD_INLINE constexpr auto make_batch_bool_constant() noexcept
540
+ {
541
+ return detail::make_batch_bool_constant<T, Arr, A>(std::make_index_sequence<Arr.size()>());
542
+ }
543
+ #endif
544
+
545
+ #endif
546
+
547
+ namespace generator
548
+ {
549
+ template <class T>
550
+ struct iota
551
+ {
552
+ static constexpr T get(size_t index, size_t)
553
+ {
554
+ return static_cast<T>(index);
555
+ }
556
+ };
557
+ }
558
+ /**
559
+ * @brief Build a @c batch_constant as an enumerated range
560
+ *
561
+ * @tparam T type of the data held in the batch.
562
+ * @tparam A Architecture that will be used when converting to a regular batch.
563
+ */
564
+ template <typename T, class A = default_arch>
565
+ XSIMD_INLINE constexpr auto make_iota_batch_constant() noexcept
566
+ {
567
+ return make_batch_constant<T, generator::iota<T>, A>();
568
+ }
569
+
570
+ } // namespace xsimd
571
+
572
+ #endif
@@ -0,0 +1,41 @@
1
+ /***************************************************************************
2
+ * Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
3
+ * Martin Renou *
4
+ * Copyright (c) QuantStack *
5
+ * Copyright (c) Serge Guelton *
6
+ * *
7
+ * Distributed under the terms of the BSD 3-Clause License. *
8
+ * *
9
+ * The full license is in the file LICENSE, distributed with this software. *
10
+ ****************************************************************************/
11
+
12
+ #ifndef XSIMD_BATCH_FWD_HPP
13
+ #define XSIMD_BATCH_FWD_HPP
14
+
15
+ #include "../config/xsimd_config.hpp"
16
+
17
+ // TODO this is somehow redundant with XSIMD_DEFAULT_ARCH but is only supported
18
+ // when an architecture is defined.
19
+ #if defined(XSIMD_NO_SUPPORTED_ARCHITECTURE)
20
+ #define XSIMD_BATCH_DEFAULT_ARCH_IMPL void
21
+ #else
22
+ #include "../config/xsimd_arch.hpp"
23
+ #define XSIMD_BATCH_DEFAULT_ARCH_IMPL default_arch
24
+ #endif // XSIMD_NO_SUPPORTED_ARCHITECTURE
25
+
26
+ namespace xsimd
27
+ {
28
+ template <class T, class A = XSIMD_BATCH_DEFAULT_ARCH_IMPL>
29
+ class batch_bool;
30
+
31
+ template <typename T, class A, bool... Values>
32
+ struct batch_bool_constant;
33
+
34
+ template <class T, class A = XSIMD_BATCH_DEFAULT_ARCH_IMPL>
35
+ class batch;
36
+
37
+ template <typename T, class A, T... Values>
38
+ struct batch_constant;
39
+ }
40
+
41
+ #endif
@@ -0,0 +1,49 @@
1
+ /***************************************************************************
2
+ * Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
3
+ * Martin Renou *
4
+ * Copyright (c) QuantStack *
5
+ * Copyright (c) Serge Guelton *
6
+ * *
7
+ * Distributed under the terms of the BSD 3-Clause License. *
8
+ * *
9
+ * The full license is in the file LICENSE, distributed with this software. *
10
+ ****************************************************************************/
11
+
12
+ #ifndef XSIMD_COMMON_ARCH_HPP
13
+ #define XSIMD_COMMON_ARCH_HPP
14
+
15
+ #include <cstddef>
16
+
17
+ #include "../config/xsimd_config.hpp"
18
+
19
+ /**
20
+ * @defgroup architectures Architecture description
21
+ * */
22
+ namespace xsimd
23
+ {
24
+ /**
25
+ * @ingroup architectures
26
+ *
27
+ * Base class for all architectures.
28
+ */
29
+ struct common
30
+ {
31
+ /// Whether this architecture is supported at compile-time.
32
+ static constexpr bool supported() noexcept { return true; }
33
+ /// Whether this architecture is available at run-time.
34
+ static constexpr bool available() noexcept { return true; }
35
+ /// If this architectures supports aligned memory accesses, the required
36
+ /// alignment.
37
+ static constexpr std::size_t alignment() noexcept { return 0; }
38
+ /// Whether this architecture requires aligned memory access.
39
+ static constexpr bool requires_alignment() noexcept { return false; }
40
+ /// Name of the architecture.
41
+ static constexpr char const* name() noexcept { return "common"; }
42
+ };
43
+
44
+ struct unsupported
45
+ {
46
+ };
47
+ }
48
+
49
+ #endif