react-native-executorch 0.5.1 → 0.5.3

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 (595) hide show
  1. package/android/CMakeLists.txt +24 -0
  2. package/android/build.gradle +1 -0
  3. package/android/src/main/cpp/CMakeLists.txt +25 -0
  4. package/android/src/main/java/com/swmansion/rnexecutorch/RnExecutorchPackage.kt +1 -13
  5. package/common/rnexecutorch/RnExecutorchInstaller.cpp +52 -18
  6. package/common/rnexecutorch/RnExecutorchInstaller.h +0 -25
  7. package/common/rnexecutorch/TokenizerModule.cpp +1 -1
  8. package/common/rnexecutorch/TokenizerModule.h +4 -1
  9. package/common/rnexecutorch/data_processing/FileUtils.h +2 -2
  10. package/common/rnexecutorch/data_processing/ImageProcessing.cpp +5 -5
  11. package/common/rnexecutorch/data_processing/ImageProcessing.h +2 -2
  12. package/common/rnexecutorch/data_processing/Numerical.cpp +13 -0
  13. package/common/rnexecutorch/host_objects/JsiConversions.h +43 -62
  14. package/common/rnexecutorch/host_objects/ModelHostObject.h +43 -24
  15. package/common/rnexecutorch/metaprogramming/ConstructorHelpers.h +8 -6
  16. package/common/rnexecutorch/metaprogramming/FunctionHelpers.h +1 -1
  17. package/common/rnexecutorch/models/BaseModel.cpp +2 -2
  18. package/common/rnexecutorch/models/BaseModel.h +5 -0
  19. package/common/rnexecutorch/models/EncoderDecoderBase.cpp +2 -2
  20. package/common/rnexecutorch/models/EncoderDecoderBase.h +2 -2
  21. package/common/rnexecutorch/models/classification/Classification.cpp +6 -6
  22. package/common/rnexecutorch/models/classification/Classification.h +5 -0
  23. package/common/rnexecutorch/models/classification/Constants.h +3 -3
  24. package/common/rnexecutorch/models/embeddings/BaseEmbeddings.cpp +2 -2
  25. package/common/rnexecutorch/models/embeddings/BaseEmbeddings.h +2 -2
  26. package/common/rnexecutorch/models/embeddings/image/ImageEmbeddings.cpp +3 -3
  27. package/common/rnexecutorch/models/embeddings/image/ImageEmbeddings.h +5 -0
  28. package/common/rnexecutorch/models/embeddings/text/TextEmbeddings.cpp +2 -2
  29. package/common/rnexecutorch/models/embeddings/text/TextEmbeddings.h +6 -1
  30. package/common/rnexecutorch/models/image_segmentation/Constants.h +3 -3
  31. package/common/rnexecutorch/models/image_segmentation/ImageSegmentation.cpp +6 -5
  32. package/common/rnexecutorch/models/image_segmentation/ImageSegmentation.h +8 -1
  33. package/common/rnexecutorch/models/llm/LLM.cpp +58 -0
  34. package/common/rnexecutorch/models/llm/LLM.h +35 -0
  35. package/common/rnexecutorch/models/object_detection/Constants.h +3 -3
  36. package/common/rnexecutorch/models/object_detection/ObjectDetection.cpp +8 -8
  37. package/common/rnexecutorch/models/object_detection/ObjectDetection.h +11 -5
  38. package/common/rnexecutorch/models/object_detection/Types.h +13 -0
  39. package/common/rnexecutorch/models/object_detection/Utils.cpp +13 -11
  40. package/common/rnexecutorch/models/object_detection/Utils.h +7 -13
  41. package/common/rnexecutorch/models/ocr/CTCLabelConverter.cpp +2 -2
  42. package/common/rnexecutorch/models/ocr/CTCLabelConverter.h +2 -2
  43. package/common/rnexecutorch/models/ocr/Constants.h +33 -26
  44. package/common/rnexecutorch/models/ocr/Detector.cpp +20 -22
  45. package/common/rnexecutorch/models/ocr/Detector.h +4 -4
  46. package/common/rnexecutorch/models/ocr/OCR.cpp +9 -8
  47. package/common/rnexecutorch/models/ocr/OCR.h +11 -3
  48. package/common/rnexecutorch/models/ocr/RecognitionHandler.cpp +20 -19
  49. package/common/rnexecutorch/models/ocr/RecognitionHandler.h +9 -7
  50. package/common/rnexecutorch/models/ocr/Recognizer.cpp +7 -7
  51. package/common/rnexecutorch/models/ocr/Recognizer.h +2 -2
  52. package/common/rnexecutorch/models/ocr/Types.h +4 -6
  53. package/common/rnexecutorch/models/ocr/{DetectorUtils.cpp → utils/DetectorUtils.cpp} +70 -63
  54. package/common/rnexecutorch/models/ocr/{DetectorUtils.h → utils/DetectorUtils.h} +12 -11
  55. package/common/rnexecutorch/models/ocr/{RecognitionHandlerUtils.cpp → utils/RecognitionHandlerUtils.cpp} +14 -11
  56. package/common/rnexecutorch/models/ocr/{RecognitionHandlerUtils.h → utils/RecognitionHandlerUtils.h} +5 -5
  57. package/common/rnexecutorch/models/ocr/{RecognizerUtils.cpp → utils/RecognizerUtils.cpp} +28 -26
  58. package/common/rnexecutorch/models/ocr/{RecognizerUtils.h → utils/RecognizerUtils.h} +15 -14
  59. package/common/rnexecutorch/models/speech_to_text/SpeechToText.cpp +2 -2
  60. package/common/rnexecutorch/models/speech_to_text/SpeechToText.h +9 -2
  61. package/common/rnexecutorch/models/speech_to_text/SpeechToTextStrategy.h +2 -2
  62. package/common/rnexecutorch/models/speech_to_text/WhisperStrategy.cpp +2 -2
  63. package/common/rnexecutorch/models/speech_to_text/WhisperStrategy.h +2 -2
  64. package/common/rnexecutorch/models/style_transfer/StyleTransfer.cpp +5 -5
  65. package/common/rnexecutorch/models/style_transfer/StyleTransfer.h +6 -0
  66. package/common/rnexecutorch/models/vertical_ocr/VerticalDetector.cpp +23 -22
  67. package/common/rnexecutorch/models/vertical_ocr/VerticalDetector.h +4 -4
  68. package/common/rnexecutorch/models/vertical_ocr/VerticalOCR.cpp +34 -34
  69. package/common/rnexecutorch/models/vertical_ocr/VerticalOCR.h +27 -20
  70. package/{third-party/ios/ExecutorchLib/ExecutorchLib/sampler → common/runner}/sampler.cpp +3 -2
  71. package/{third-party/ios/ExecutorchLib/ExecutorchLib/sampler → common/runner}/sampler.h +3 -2
  72. package/ios/libs/executorch/libbackend_coreml_ios.a +0 -0
  73. package/ios/libs/executorch/libbackend_coreml_simulator.a +0 -0
  74. package/{third-party/ios/ExecutorchLib/frameworks/backend_mps.xcframework/ios-arm64 → ios/libs/executorch}/libbackend_mps_ios.a +0 -0
  75. package/{third-party/ios/ExecutorchLib/frameworks/backend_mps.xcframework/ios-arm64-simulator → ios/libs/executorch}/libbackend_mps_simulator.a +0 -0
  76. package/ios/libs/executorch/libbackend_xnnpack_ios.a +0 -0
  77. package/ios/libs/executorch/libbackend_xnnpack_simulator.a +0 -0
  78. package/ios/libs/executorch/libexecutorch_ios.a +0 -0
  79. package/ios/libs/executorch/libexecutorch_simulator.a +0 -0
  80. package/ios/libs/executorch/libkernels_custom_ios.a +0 -0
  81. package/ios/libs/executorch/libkernels_custom_simulator.a +0 -0
  82. package/ios/libs/executorch/libkernels_optimized_ios.a +0 -0
  83. package/ios/libs/executorch/libkernels_optimized_simulator.a +0 -0
  84. package/ios/libs/executorch/libkernels_portable_ios.a +0 -0
  85. package/ios/libs/executorch/libkernels_portable_simulator.a +0 -0
  86. package/ios/libs/executorch/libkernels_quantized_ios.a +0 -0
  87. package/ios/libs/executorch/libkernels_quantized_simulator.a +0 -0
  88. package/ios/libs/tokenizers-cpp/physical-arm64-release/libsentencepiece.a +0 -0
  89. package/ios/{ExecutorchLib.xcframework/ios-arm64-simulator/ExecutorchLib.framework/ExecutorchLib → libs/tokenizers-cpp/physical-arm64-release/libtokenizers_c.a} +0 -0
  90. package/ios/libs/tokenizers-cpp/physical-arm64-release/libtokenizers_cpp.a +0 -0
  91. package/ios/libs/tokenizers-cpp/simulator-arm64-debug/libsentencepiece.a +0 -0
  92. package/ios/{ExecutorchLib.xcframework/ios-arm64/ExecutorchLib.framework/ExecutorchLib → libs/tokenizers-cpp/simulator-arm64-debug/libtokenizers_c.a} +0 -0
  93. package/ios/libs/tokenizers-cpp/simulator-arm64-debug/libtokenizers_cpp.a +0 -0
  94. package/lib/Error.js +53 -0
  95. package/lib/ThreadPool.d.ts +10 -0
  96. package/lib/ThreadPool.js +28 -0
  97. package/lib/common/Logger.d.ts +8 -0
  98. package/lib/common/Logger.js +19 -0
  99. package/lib/constants/directories.js +2 -0
  100. package/lib/constants/llmDefaults.d.ts +6 -0
  101. package/lib/constants/llmDefaults.js +16 -0
  102. package/lib/constants/modelUrls.d.ts +223 -0
  103. package/lib/constants/modelUrls.js +322 -0
  104. package/lib/constants/ocr/models.d.ts +882 -0
  105. package/lib/constants/ocr/models.js +182 -0
  106. package/lib/constants/ocr/symbols.js +139 -0
  107. package/lib/constants/sttDefaults.d.ts +28 -0
  108. package/lib/constants/sttDefaults.js +68 -0
  109. package/lib/controllers/LLMController.d.ts +47 -0
  110. package/lib/controllers/LLMController.js +213 -0
  111. package/lib/controllers/OCRController.js +67 -0
  112. package/lib/controllers/SpeechToTextController.d.ts +56 -0
  113. package/lib/controllers/SpeechToTextController.js +349 -0
  114. package/lib/controllers/VerticalOCRController.js +70 -0
  115. package/lib/hooks/computer_vision/useClassification.d.ts +15 -0
  116. package/lib/hooks/computer_vision/useClassification.js +7 -0
  117. package/lib/hooks/computer_vision/useImageEmbeddings.d.ts +15 -0
  118. package/lib/hooks/computer_vision/useImageEmbeddings.js +7 -0
  119. package/lib/hooks/computer_vision/useImageSegmentation.d.ts +38 -0
  120. package/lib/hooks/computer_vision/useImageSegmentation.js +7 -0
  121. package/lib/hooks/computer_vision/useOCR.d.ts +20 -0
  122. package/lib/hooks/computer_vision/useOCR.js +41 -0
  123. package/lib/hooks/computer_vision/useObjectDetection.d.ts +15 -0
  124. package/lib/hooks/computer_vision/useObjectDetection.js +7 -0
  125. package/lib/hooks/computer_vision/useStyleTransfer.d.ts +15 -0
  126. package/lib/hooks/computer_vision/useStyleTransfer.js +7 -0
  127. package/lib/hooks/computer_vision/useVerticalOCR.d.ts +21 -0
  128. package/lib/hooks/computer_vision/useVerticalOCR.js +43 -0
  129. package/lib/hooks/general/useExecutorchModule.d.ts +13 -0
  130. package/lib/hooks/general/useExecutorchModule.js +7 -0
  131. package/lib/hooks/natural_language_processing/useLLM.d.ts +10 -0
  132. package/lib/hooks/natural_language_processing/useLLM.js +78 -0
  133. package/lib/hooks/natural_language_processing/useSpeechToText.d.ts +27 -0
  134. package/lib/hooks/natural_language_processing/useSpeechToText.js +49 -0
  135. package/lib/hooks/natural_language_processing/useTextEmbeddings.d.ts +16 -0
  136. package/lib/hooks/natural_language_processing/useTextEmbeddings.js +7 -0
  137. package/lib/hooks/natural_language_processing/useTokenizer.d.ts +17 -0
  138. package/lib/hooks/natural_language_processing/useTokenizer.js +52 -0
  139. package/lib/hooks/useModule.js +45 -0
  140. package/lib/hooks/useNonStaticModule.d.ts +20 -0
  141. package/lib/hooks/useNonStaticModule.js +49 -0
  142. package/lib/index.d.ts +48 -0
  143. package/lib/index.js +58 -0
  144. package/lib/module/controllers/LLMController.js +6 -10
  145. package/lib/module/controllers/LLMController.js.map +1 -1
  146. package/lib/module/hooks/computer_vision/useClassification.js +2 -2
  147. package/lib/module/hooks/computer_vision/useClassification.js.map +1 -1
  148. package/lib/module/hooks/computer_vision/useImageEmbeddings.js +2 -2
  149. package/lib/module/hooks/computer_vision/useImageEmbeddings.js.map +1 -1
  150. package/lib/module/hooks/computer_vision/useImageSegmentation.js +2 -2
  151. package/lib/module/hooks/computer_vision/useImageSegmentation.js.map +1 -1
  152. package/lib/module/hooks/computer_vision/useObjectDetection.js +2 -2
  153. package/lib/module/hooks/computer_vision/useObjectDetection.js.map +1 -1
  154. package/lib/module/hooks/computer_vision/useStyleTransfer.js +2 -2
  155. package/lib/module/hooks/computer_vision/useStyleTransfer.js.map +1 -1
  156. package/lib/module/hooks/general/useExecutorchModule.js +2 -2
  157. package/lib/module/hooks/general/useExecutorchModule.js.map +1 -1
  158. package/lib/module/hooks/natural_language_processing/useTextEmbeddings.js +2 -2
  159. package/lib/module/hooks/natural_language_processing/useTextEmbeddings.js.map +1 -1
  160. package/lib/module/hooks/useModule.js +13 -9
  161. package/lib/module/hooks/useModule.js.map +1 -1
  162. package/lib/module/index.js +1 -1
  163. package/lib/module/index.js.map +1 -1
  164. package/lib/module/modules/BaseModule.js +9 -17
  165. package/lib/module/modules/BaseModule.js.map +1 -1
  166. package/lib/module/modules/computer_vision/ClassificationModule.js +2 -2
  167. package/lib/module/modules/computer_vision/ClassificationModule.js.map +1 -1
  168. package/lib/module/modules/computer_vision/ImageEmbeddingsModule.js +2 -2
  169. package/lib/module/modules/computer_vision/ImageEmbeddingsModule.js.map +1 -1
  170. package/lib/module/modules/computer_vision/ImageSegmentationModule.js +2 -2
  171. package/lib/module/modules/computer_vision/ImageSegmentationModule.js.map +1 -1
  172. package/lib/module/modules/computer_vision/ObjectDetectionModule.js +2 -2
  173. package/lib/module/modules/computer_vision/ObjectDetectionModule.js.map +1 -1
  174. package/lib/module/modules/computer_vision/StyleTransferModule.js +2 -2
  175. package/lib/module/modules/computer_vision/StyleTransferModule.js.map +1 -1
  176. package/lib/module/modules/general/ExecutorchModule.js +2 -2
  177. package/lib/module/modules/general/ExecutorchModule.js.map +1 -1
  178. package/lib/module/modules/natural_language_processing/TextEmbeddingsModule.js +2 -2
  179. package/lib/module/modules/natural_language_processing/TextEmbeddingsModule.js.map +1 -1
  180. package/lib/module/native/RnExecutorchModules.js +1 -2
  181. package/lib/module/native/RnExecutorchModules.js.map +1 -1
  182. package/lib/module/utils/ResourceFetcher.js +6 -8
  183. package/lib/module/utils/ResourceFetcher.js.map +1 -1
  184. package/lib/module/utils/ResourceFetcherUtils.js +20 -20
  185. package/lib/module/utils/ResourceFetcherUtils.js.map +1 -1
  186. package/lib/module/utils/SpeechToTextModule/ASR.js +3 -3
  187. package/lib/module/utils/SpeechToTextModule/ASR.js.map +1 -1
  188. package/lib/modules/BaseModule.js +25 -0
  189. package/lib/modules/BaseNonStaticModule.js +14 -0
  190. package/lib/modules/computer_vision/ClassificationModule.d.ts +8 -0
  191. package/lib/modules/computer_vision/ClassificationModule.js +17 -0
  192. package/lib/modules/computer_vision/ImageEmbeddingsModule.d.ts +8 -0
  193. package/lib/modules/computer_vision/ImageEmbeddingsModule.js +17 -0
  194. package/lib/modules/computer_vision/ImageSegmentationModule.d.ts +11 -0
  195. package/lib/modules/computer_vision/ImageSegmentationModule.js +27 -0
  196. package/lib/modules/computer_vision/OCRModule.d.ts +14 -0
  197. package/lib/modules/computer_vision/OCRModule.js +17 -0
  198. package/lib/modules/computer_vision/ObjectDetectionModule.d.ts +9 -0
  199. package/lib/modules/computer_vision/ObjectDetectionModule.js +17 -0
  200. package/lib/modules/computer_vision/StyleTransferModule.d.ts +8 -0
  201. package/lib/modules/computer_vision/StyleTransferModule.js +17 -0
  202. package/lib/modules/computer_vision/VerticalOCRModule.d.ts +14 -0
  203. package/lib/modules/computer_vision/VerticalOCRModule.js +19 -0
  204. package/lib/modules/general/ExecutorchModule.d.ts +7 -0
  205. package/lib/modules/general/ExecutorchModule.js +14 -0
  206. package/lib/modules/natural_language_processing/LLMModule.d.ts +28 -0
  207. package/lib/modules/natural_language_processing/LLMModule.js +45 -0
  208. package/lib/modules/natural_language_processing/SpeechToTextModule.d.ts +24 -0
  209. package/lib/modules/natural_language_processing/SpeechToTextModule.js +36 -0
  210. package/lib/modules/natural_language_processing/TextEmbeddingsModule.d.ts +9 -0
  211. package/lib/modules/natural_language_processing/TextEmbeddingsModule.js +21 -0
  212. package/lib/modules/natural_language_processing/TokenizerModule.d.ts +12 -0
  213. package/lib/modules/natural_language_processing/TokenizerModule.js +30 -0
  214. package/lib/native/NativeETInstaller.js +2 -0
  215. package/lib/native/NativeOCR.js +2 -0
  216. package/lib/native/NativeVerticalOCR.js +2 -0
  217. package/lib/native/RnExecutorchModules.d.ts +7 -0
  218. package/lib/native/RnExecutorchModules.js +18 -0
  219. package/lib/tsconfig.tsbuildinfo +1 -1
  220. package/lib/types/common.d.ts +32 -0
  221. package/lib/types/common.js +25 -0
  222. package/lib/types/imageSegmentation.js +26 -0
  223. package/lib/types/llm.d.ts +46 -0
  224. package/lib/types/llm.js +9 -0
  225. package/lib/types/objectDetection.js +94 -0
  226. package/lib/types/ocr.js +1 -0
  227. package/lib/types/stt.d.ts +94 -0
  228. package/lib/types/stt.js +85 -0
  229. package/lib/typescript/controllers/LLMController.d.ts +1 -1
  230. package/lib/typescript/controllers/LLMController.d.ts.map +1 -1
  231. package/lib/typescript/hooks/useModule.d.ts +8 -5
  232. package/lib/typescript/hooks/useModule.d.ts.map +1 -1
  233. package/lib/typescript/index.d.ts +1 -0
  234. package/lib/typescript/index.d.ts.map +1 -1
  235. package/lib/typescript/modules/BaseModule.d.ts +7 -6
  236. package/lib/typescript/modules/BaseModule.d.ts.map +1 -1
  237. package/lib/typescript/modules/computer_vision/ClassificationModule.d.ts +2 -2
  238. package/lib/typescript/modules/computer_vision/ClassificationModule.d.ts.map +1 -1
  239. package/lib/typescript/modules/computer_vision/ImageEmbeddingsModule.d.ts +2 -2
  240. package/lib/typescript/modules/computer_vision/ImageEmbeddingsModule.d.ts.map +1 -1
  241. package/lib/typescript/modules/computer_vision/ImageSegmentationModule.d.ts +2 -2
  242. package/lib/typescript/modules/computer_vision/ImageSegmentationModule.d.ts.map +1 -1
  243. package/lib/typescript/modules/computer_vision/ObjectDetectionModule.d.ts +2 -2
  244. package/lib/typescript/modules/computer_vision/ObjectDetectionModule.d.ts.map +1 -1
  245. package/lib/typescript/modules/computer_vision/StyleTransferModule.d.ts +2 -2
  246. package/lib/typescript/modules/computer_vision/StyleTransferModule.d.ts.map +1 -1
  247. package/lib/typescript/modules/general/ExecutorchModule.d.ts +2 -2
  248. package/lib/typescript/modules/general/ExecutorchModule.d.ts.map +1 -1
  249. package/lib/typescript/modules/natural_language_processing/TextEmbeddingsModule.d.ts +2 -2
  250. package/lib/typescript/modules/natural_language_processing/TextEmbeddingsModule.d.ts.map +1 -1
  251. package/lib/typescript/native/RnExecutorchModules.d.ts +1 -3
  252. package/lib/typescript/native/RnExecutorchModules.d.ts.map +1 -1
  253. package/lib/typescript/utils/ResourceFetcher.d.ts.map +1 -1
  254. package/lib/typescript/utils/ResourceFetcherUtils.d.ts.map +1 -1
  255. package/lib/utils/ResourceFetcher.d.ts +24 -0
  256. package/lib/utils/ResourceFetcher.js +305 -0
  257. package/lib/utils/ResourceFetcherUtils.d.ts +54 -0
  258. package/lib/utils/ResourceFetcherUtils.js +127 -0
  259. package/lib/utils/llm.d.ts +6 -0
  260. package/lib/utils/llm.js +72 -0
  261. package/lib/utils/stt.js +21 -0
  262. package/package.json +1 -2
  263. package/react-native-executorch.podspec +47 -44
  264. package/src/controllers/LLMController.ts +8 -13
  265. package/src/hooks/computer_vision/useClassification.ts +2 -2
  266. package/src/hooks/computer_vision/useImageEmbeddings.ts +2 -2
  267. package/src/hooks/computer_vision/useImageSegmentation.ts +2 -2
  268. package/src/hooks/computer_vision/useObjectDetection.ts +2 -2
  269. package/src/hooks/computer_vision/useStyleTransfer.ts +2 -2
  270. package/src/hooks/general/useExecutorchModule.ts +2 -2
  271. package/src/hooks/natural_language_processing/useTextEmbeddings.ts +2 -2
  272. package/src/hooks/useModule.ts +23 -13
  273. package/src/index.ts +3 -2
  274. package/src/modules/BaseModule.ts +17 -28
  275. package/src/modules/computer_vision/ClassificationModule.ts +2 -2
  276. package/src/modules/computer_vision/ImageEmbeddingsModule.ts +2 -2
  277. package/src/modules/computer_vision/ImageSegmentationModule.ts +2 -2
  278. package/src/modules/computer_vision/ObjectDetectionModule.ts +2 -2
  279. package/src/modules/computer_vision/StyleTransferModule.ts +2 -2
  280. package/src/modules/general/ExecutorchModule.ts +2 -2
  281. package/src/modules/natural_language_processing/TextEmbeddingsModule.ts +2 -2
  282. package/src/native/RnExecutorchModules.ts +1 -5
  283. package/src/utils/ResourceFetcher.ts +9 -7
  284. package/src/utils/ResourceFetcherUtils.ts +15 -17
  285. package/src/utils/SpeechToTextModule/ASR.ts +4 -4
  286. package/third-party/android/libs/cpuinfo/arm64-v8a/libcpuinfo.so +0 -0
  287. package/third-party/android/libs/pthreadpool/arm64-v8a/libpthreadpool.so +0 -0
  288. package/third-party/include/cpuinfo/cpuinfo.h +2305 -0
  289. package/third-party/include/executorch/extension/threadpool/cpuinfo_utils.h +26 -0
  290. package/third-party/include/executorch/extension/threadpool/threadpool.h +94 -0
  291. package/third-party/include/pthreadpool/pthreadpool.h +2236 -0
  292. package/android/src/main/java/com/swmansion/rnexecutorch/LLM.kt +0 -63
  293. package/ios/ExecutorchLib.xcframework/Info.plist +0 -43
  294. package/ios/ExecutorchLib.xcframework/ios-arm64/ExecutorchLib.framework/Headers/ETModel.h +0 -27
  295. package/ios/ExecutorchLib.xcframework/ios-arm64/ExecutorchLib.framework/Headers/HuggingFaceTokenizer.h +0 -14
  296. package/ios/ExecutorchLib.xcframework/ios-arm64/ExecutorchLib.framework/Headers/LLaMARunner.h +0 -32
  297. package/ios/ExecutorchLib.xcframework/ios-arm64/ExecutorchLib.framework/Info.plist +0 -0
  298. package/ios/ExecutorchLib.xcframework/ios-arm64-simulator/ExecutorchLib.framework/Headers/ETModel.h +0 -27
  299. package/ios/ExecutorchLib.xcframework/ios-arm64-simulator/ExecutorchLib.framework/Headers/HuggingFaceTokenizer.h +0 -14
  300. package/ios/ExecutorchLib.xcframework/ios-arm64-simulator/ExecutorchLib.framework/Headers/LLaMARunner.h +0 -32
  301. package/ios/ExecutorchLib.xcframework/ios-arm64-simulator/ExecutorchLib.framework/Info.plist +0 -0
  302. package/ios/RnExecutorch/LLM.h +0 -5
  303. package/ios/RnExecutorch/LLM.mm +0 -78
  304. package/ios/RnExecutorch.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  305. package/ios/RnExecutorch.xcodeproj/project.xcworkspace/xcuserdata/jakubchmura.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  306. package/ios/RnExecutorch.xcodeproj/xcuserdata/jakubchmura.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  307. package/lib/module/modules/BaseNonStaticModule.js +0 -17
  308. package/lib/module/modules/BaseNonStaticModule.js.map +0 -1
  309. package/lib/module/native/NativeLLM.js +0 -5
  310. package/lib/module/native/NativeLLM.js.map +0 -1
  311. package/lib/typescript/modules/BaseNonStaticModule.d.ts +0 -10
  312. package/lib/typescript/modules/BaseNonStaticModule.d.ts.map +0 -1
  313. package/lib/typescript/native/NativeLLM.d.ts +0 -12
  314. package/lib/typescript/native/NativeLLM.d.ts.map +0 -1
  315. package/src/modules/BaseNonStaticModule.ts +0 -26
  316. package/src/native/NativeLLM.ts +0 -14
  317. package/third-party/include/tokenizers-cpp/tokenizers_c.h +0 -61
  318. package/third-party/ios/ExecutorchLib/ExecutorchLib/Exported/ETModel.h +0 -27
  319. package/third-party/ios/ExecutorchLib/ExecutorchLib/Exported/ETModel.mm +0 -249
  320. package/third-party/ios/ExecutorchLib/ExecutorchLib/Exported/HuggingFaceTokenizer.h +0 -14
  321. package/third-party/ios/ExecutorchLib/ExecutorchLib/Exported/HuggingFaceTokenizer.mm +0 -80
  322. package/third-party/ios/ExecutorchLib/ExecutorchLib/Exported/LLaMARunner.h +0 -32
  323. package/third-party/ios/ExecutorchLib/ExecutorchLib/Exported/LLaMARunner.mm +0 -95
  324. package/third-party/ios/ExecutorchLib/ExecutorchLib/InputType.h +0 -12
  325. package/third-party/ios/ExecutorchLib/ExecutorchLib/Utils.hpp +0 -217
  326. package/third-party/ios/ExecutorchLib/ExecutorchLib/model/Model.cpp +0 -11
  327. package/third-party/ios/ExecutorchLib/ExecutorchLib/model/Model.h +0 -11
  328. package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/base64.h +0 -202
  329. package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/bpe_tokenizer.cpp +0 -313
  330. package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/bpe_tokenizer.h +0 -57
  331. package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/llama_tiktoken.cpp +0 -78
  332. package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/llama_tiktoken.h +0 -23
  333. package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/tiktoken.cpp +0 -427
  334. package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/tiktoken.h +0 -87
  335. package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/tokenizer.h +0 -76
  336. package/third-party/ios/ExecutorchLib/ExecutorchLib.xcodeproj/project.pbxproj +0 -683
  337. package/third-party/ios/ExecutorchLib/ExecutorchLib.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  338. package/third-party/ios/ExecutorchLib/ExecutorchLib.xcodeproj/project.xcworkspace/xcuserdata/jakubchmura.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  339. package/third-party/ios/ExecutorchLib/ExecutorchLib.xcodeproj/xcuserdata/jakubchmura.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  340. package/third-party/ios/ExecutorchLib/build.sh +0 -44
  341. package/third-party/ios/ExecutorchLib/frameworks/backend_coreml.xcframework/Info.plist +0 -43
  342. package/third-party/ios/ExecutorchLib/frameworks/backend_coreml.xcframework/ios-arm64/libbackend_coreml_ios.a +0 -0
  343. package/third-party/ios/ExecutorchLib/frameworks/backend_coreml.xcframework/ios-arm64-simulator/libbackend_coreml_simulator.a +0 -0
  344. package/third-party/ios/ExecutorchLib/frameworks/backend_mps.xcframework/Info.plist +0 -43
  345. package/third-party/ios/ExecutorchLib/frameworks/backend_xnnpack.xcframework/Info.plist +0 -43
  346. package/third-party/ios/ExecutorchLib/frameworks/backend_xnnpack.xcframework/ios-arm64/libbackend_xnnpack_ios.a +0 -0
  347. package/third-party/ios/ExecutorchLib/frameworks/backend_xnnpack.xcframework/ios-arm64-simulator/libbackend_xnnpack_simulator.a +0 -0
  348. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/Info.plist +0 -47
  349. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/macros/Export.h +0 -163
  350. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/macros/Macros.h +0 -497
  351. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/BFloat16-inl.h +0 -342
  352. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/BFloat16-math.h +0 -266
  353. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/BFloat16.h +0 -125
  354. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/Half-inl.h +0 -347
  355. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/Half.h +0 -416
  356. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/TypeSafeSignMath.h +0 -133
  357. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/bit_cast.h +0 -43
  358. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/floating_point_utils.h +0 -33
  359. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/irange.h +0 -107
  360. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/ExecuTorch.h +0 -13
  361. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/ExecuTorchError.h +0 -16
  362. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/ExecuTorchLog.h +0 -76
  363. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/ExecuTorchModule.h +0 -286
  364. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/ExecuTorchTensor.h +0 -742
  365. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/ExecuTorchValue.h +0 -219
  366. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/extension/module/module.h +0 -492
  367. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/extension/tensor/tensor.h +0 -13
  368. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/extension/tensor/tensor_accessor.h +0 -190
  369. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/extension/tensor/tensor_ptr.h +0 -347
  370. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/extension/tensor/tensor_ptr_maker.h +0 -653
  371. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/backend/backend_execution_context.h +0 -71
  372. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/backend/backend_init_context.h +0 -72
  373. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/backend/interface.h +0 -166
  374. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/array_ref.h +0 -235
  375. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/data_loader.h +0 -136
  376. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/defines.h +0 -20
  377. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/error.h +0 -229
  378. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/evalue.h +0 -521
  379. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/event_tracer.h +0 -565
  380. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/event_tracer_hooks.h +0 -323
  381. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/event_tracer_hooks_delegate.h +0 -197
  382. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/exec_aten/exec_aten.h +0 -147
  383. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/exec_aten/util/dim_order_util.h +0 -263
  384. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/exec_aten/util/scalar_type_util.h +0 -1331
  385. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/exec_aten/util/tensor_dimension_limit.h +0 -21
  386. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/exec_aten/util/tensor_shape_to_c_string.h +0 -69
  387. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/exec_aten/util/tensor_util.h +0 -1250
  388. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/freeable_buffer.h +0 -107
  389. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/hierarchical_allocator.h +0 -107
  390. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/memory_allocator.h +0 -198
  391. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/named_data_map.h +0 -86
  392. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/bfloat16.h +0 -27
  393. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/bfloat16_math.h +0 -14
  394. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/bits_types.h +0 -83
  395. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/macros/Export.h +0 -163
  396. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/macros/Macros.h +0 -497
  397. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/BFloat16-inl.h +0 -342
  398. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/BFloat16-math.h +0 -266
  399. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/BFloat16.h +0 -125
  400. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/Half-inl.h +0 -347
  401. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/Half.h +0 -416
  402. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/TypeSafeSignMath.h +0 -133
  403. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/bit_cast.h +0 -43
  404. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/floating_point_utils.h +0 -33
  405. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/irange.h +0 -107
  406. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/complex.h +0 -44
  407. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/device.h +0 -70
  408. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/half.h +0 -27
  409. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/optional.h +0 -36
  410. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/qint_types.h +0 -83
  411. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/scalar.h +0 -110
  412. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/scalar_type.h +0 -154
  413. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/string_view.h +0 -29
  414. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/tensor.h +0 -142
  415. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/tensor_impl.h +0 -261
  416. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/tensor_options.h +0 -60
  417. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/result.h +0 -258
  418. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/span.h +0 -93
  419. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/tag.h +0 -71
  420. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/tensor_layout.h +0 -79
  421. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/tensor_shape_dynamism.h +0 -39
  422. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/executor/memory_manager.h +0 -113
  423. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/executor/method.h +0 -387
  424. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/executor/method_meta.h +0 -251
  425. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/executor/program.h +0 -320
  426. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/executor/pte_data_map.h +0 -144
  427. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/executor/tensor_parser.h +0 -156
  428. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/kernel/kernel_runtime_context.h +0 -122
  429. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/kernel/operator_registry.h +0 -278
  430. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/abort.h +0 -36
  431. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/assert.h +0 -119
  432. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/clock.h +0 -43
  433. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/compat_unistd.h +0 -75
  434. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/compiler.h +0 -191
  435. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/log.h +0 -177
  436. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/platform.h +0 -133
  437. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/profiler.h +0 -292
  438. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/runtime.h +0 -35
  439. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/system.h +0 -49
  440. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/types.h +0 -24
  441. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/schema/extended_header.h +0 -76
  442. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/module.modulemap +0 -5
  443. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/libexecutorch_ios.a +0 -0
  444. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/macros/Export.h +0 -163
  445. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/macros/Macros.h +0 -497
  446. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/BFloat16-inl.h +0 -342
  447. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/BFloat16-math.h +0 -266
  448. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/BFloat16.h +0 -125
  449. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/Half-inl.h +0 -347
  450. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/Half.h +0 -416
  451. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/TypeSafeSignMath.h +0 -133
  452. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/bit_cast.h +0 -43
  453. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/floating_point_utils.h +0 -33
  454. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/irange.h +0 -107
  455. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/ExecuTorch.h +0 -13
  456. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/ExecuTorchError.h +0 -16
  457. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/ExecuTorchLog.h +0 -76
  458. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/ExecuTorchModule.h +0 -286
  459. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/ExecuTorchTensor.h +0 -742
  460. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/ExecuTorchValue.h +0 -219
  461. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/extension/module/module.h +0 -492
  462. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/extension/tensor/tensor.h +0 -13
  463. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/extension/tensor/tensor_accessor.h +0 -190
  464. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/extension/tensor/tensor_ptr.h +0 -347
  465. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/extension/tensor/tensor_ptr_maker.h +0 -653
  466. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/backend/backend_execution_context.h +0 -71
  467. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/backend/backend_init_context.h +0 -72
  468. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/backend/interface.h +0 -166
  469. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/array_ref.h +0 -235
  470. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/data_loader.h +0 -136
  471. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/defines.h +0 -20
  472. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/error.h +0 -229
  473. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/evalue.h +0 -521
  474. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/event_tracer.h +0 -565
  475. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/event_tracer_hooks.h +0 -323
  476. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/event_tracer_hooks_delegate.h +0 -197
  477. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/exec_aten/exec_aten.h +0 -147
  478. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/exec_aten/util/dim_order_util.h +0 -263
  479. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/exec_aten/util/scalar_type_util.h +0 -1331
  480. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/exec_aten/util/tensor_dimension_limit.h +0 -21
  481. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/exec_aten/util/tensor_shape_to_c_string.h +0 -69
  482. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/exec_aten/util/tensor_util.h +0 -1250
  483. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/freeable_buffer.h +0 -107
  484. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/hierarchical_allocator.h +0 -107
  485. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/memory_allocator.h +0 -198
  486. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/named_data_map.h +0 -86
  487. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/bfloat16.h +0 -27
  488. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/bfloat16_math.h +0 -14
  489. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/bits_types.h +0 -83
  490. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/macros/Export.h +0 -163
  491. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/macros/Macros.h +0 -497
  492. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/BFloat16-inl.h +0 -342
  493. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/BFloat16-math.h +0 -266
  494. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/BFloat16.h +0 -125
  495. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/Half-inl.h +0 -347
  496. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/Half.h +0 -416
  497. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/TypeSafeSignMath.h +0 -133
  498. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/bit_cast.h +0 -43
  499. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/floating_point_utils.h +0 -33
  500. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/irange.h +0 -107
  501. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/complex.h +0 -44
  502. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/device.h +0 -70
  503. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/half.h +0 -27
  504. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/optional.h +0 -36
  505. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/qint_types.h +0 -83
  506. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/scalar.h +0 -110
  507. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/scalar_type.h +0 -154
  508. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/string_view.h +0 -29
  509. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/tensor.h +0 -142
  510. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/tensor_impl.h +0 -261
  511. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/tensor_options.h +0 -60
  512. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/result.h +0 -258
  513. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/span.h +0 -93
  514. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/tag.h +0 -71
  515. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/tensor_layout.h +0 -79
  516. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/tensor_shape_dynamism.h +0 -39
  517. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/executor/memory_manager.h +0 -113
  518. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/executor/method.h +0 -387
  519. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/executor/method_meta.h +0 -251
  520. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/executor/program.h +0 -320
  521. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/executor/pte_data_map.h +0 -144
  522. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/executor/tensor_parser.h +0 -156
  523. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/kernel/kernel_runtime_context.h +0 -122
  524. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/kernel/operator_registry.h +0 -278
  525. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/abort.h +0 -36
  526. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/assert.h +0 -119
  527. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/clock.h +0 -43
  528. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/compat_unistd.h +0 -75
  529. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/compiler.h +0 -191
  530. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/log.h +0 -177
  531. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/platform.h +0 -133
  532. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/profiler.h +0 -292
  533. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/runtime.h +0 -35
  534. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/system.h +0 -49
  535. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/types.h +0 -24
  536. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/schema/extended_header.h +0 -76
  537. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/module.modulemap +0 -5
  538. package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/libexecutorch_simulator.a +0 -0
  539. package/third-party/ios/ExecutorchLib/frameworks/kernels_custom.xcframework/Info.plist +0 -43
  540. package/third-party/ios/ExecutorchLib/frameworks/kernels_custom.xcframework/ios-arm64/libkernels_custom_ios.a +0 -0
  541. package/third-party/ios/ExecutorchLib/frameworks/kernels_custom.xcframework/ios-arm64-simulator/libkernels_custom_simulator.a +0 -0
  542. package/third-party/ios/ExecutorchLib/frameworks/kernels_optimized.xcframework/Info.plist +0 -43
  543. package/third-party/ios/ExecutorchLib/frameworks/kernels_optimized.xcframework/ios-arm64/libkernels_optimized_ios.a +0 -0
  544. package/third-party/ios/ExecutorchLib/frameworks/kernels_optimized.xcframework/ios-arm64-simulator/libkernels_optimized_simulator.a +0 -0
  545. package/third-party/ios/ExecutorchLib/frameworks/kernels_portable.xcframework/Info.plist +0 -43
  546. package/third-party/ios/ExecutorchLib/frameworks/kernels_portable.xcframework/ios-arm64/libkernels_portable_ios.a +0 -0
  547. package/third-party/ios/ExecutorchLib/frameworks/kernels_portable.xcframework/ios-arm64-simulator/libkernels_portable_simulator.a +0 -0
  548. package/third-party/ios/ExecutorchLib/frameworks/kernels_quantized.xcframework/Info.plist +0 -43
  549. package/third-party/ios/ExecutorchLib/frameworks/kernels_quantized.xcframework/ios-arm64/libkernels_quantized_ios.a +0 -0
  550. package/third-party/ios/ExecutorchLib/frameworks/kernels_quantized.xcframework/ios-arm64-simulator/libkernels_quantized_simulator.a +0 -0
  551. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/Info.plist +0 -43
  552. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/bitmap256.h +0 -82
  553. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/filtered_re2.h +0 -111
  554. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/pod_array.h +0 -43
  555. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/prefilter.h +0 -130
  556. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/prefilter_tree.h +0 -139
  557. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/prog.h +0 -483
  558. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/re2.h +0 -994
  559. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/regexp.h +0 -692
  560. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/set.h +0 -85
  561. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/sparse_array.h +0 -367
  562. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/sparse_set.h +0 -241
  563. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/stringpiece.h +0 -205
  564. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/unicode_casefold.h +0 -78
  565. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/unicode_groups.h +0 -64
  566. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/walker-inl.h +0 -235
  567. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Info.plist +0 -26
  568. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/re2 +0 -0
  569. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/bitmap256.h +0 -82
  570. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/filtered_re2.h +0 -111
  571. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/pod_array.h +0 -43
  572. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/prefilter.h +0 -130
  573. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/prefilter_tree.h +0 -139
  574. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/prog.h +0 -483
  575. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/re2.h +0 -994
  576. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/regexp.h +0 -692
  577. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/set.h +0 -85
  578. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/sparse_array.h +0 -367
  579. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/sparse_set.h +0 -241
  580. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/stringpiece.h +0 -205
  581. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/unicode_casefold.h +0 -78
  582. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/unicode_groups.h +0 -64
  583. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/walker-inl.h +0 -235
  584. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Info.plist +0 -26
  585. package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/re2 +0 -0
  586. /package/{third-party/ios/ExecutorchLib/ExecutorchLib → common}/runner/irunner.h +0 -0
  587. /package/{third-party/ios/ExecutorchLib/ExecutorchLib → common}/runner/runner.cpp +0 -0
  588. /package/{third-party/ios/ExecutorchLib/ExecutorchLib → common}/runner/runner.h +0 -0
  589. /package/{third-party/ios/ExecutorchLib/ExecutorchLib → common}/runner/stats.h +0 -0
  590. /package/{third-party/ios/ExecutorchLib/ExecutorchLib → common}/runner/text_decoder_runner.cpp +0 -0
  591. /package/{third-party/ios/ExecutorchLib/ExecutorchLib → common}/runner/text_decoder_runner.h +0 -0
  592. /package/{third-party/ios/ExecutorchLib/ExecutorchLib → common}/runner/text_prefiller.cpp +0 -0
  593. /package/{third-party/ios/ExecutorchLib/ExecutorchLib → common}/runner/text_prefiller.h +0 -0
  594. /package/{third-party/ios/ExecutorchLib/ExecutorchLib → common}/runner/text_token_generator.h +0 -0
  595. /package/{third-party/ios/ExecutorchLib/ExecutorchLib → common}/runner/util.h +0 -0
@@ -0,0 +1,2305 @@
1
+ #pragma once
2
+ #ifndef CPUINFO_H
3
+ #define CPUINFO_H
4
+
5
+ #ifndef __cplusplus
6
+ #include <stdbool.h>
7
+ #endif
8
+
9
+ #ifdef __APPLE__
10
+ #include <TargetConditionals.h>
11
+ #endif
12
+
13
+ #include <stdint.h>
14
+
15
+ /* Identify architecture and define corresponding macro */
16
+
17
+ #if defined(__i386__) || defined(__i486__) || defined(__i586__) || \
18
+ defined(__i686__) || defined(_M_IX86)
19
+ #define CPUINFO_ARCH_X86 1
20
+ #endif
21
+
22
+ #if defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || \
23
+ defined(_M_AMD64)
24
+ #define CPUINFO_ARCH_X86_64 1
25
+ #endif
26
+
27
+ #if defined(__arm__) || defined(_M_ARM)
28
+ #define CPUINFO_ARCH_ARM 1
29
+ #endif
30
+
31
+ #if defined(__aarch64__) || defined(_M_ARM64)
32
+ #define CPUINFO_ARCH_ARM64 1
33
+ #endif
34
+
35
+ #if defined(__PPC64__) || defined(__powerpc64__) || defined(_ARCH_PPC64)
36
+ #define CPUINFO_ARCH_PPC64 1
37
+ #endif
38
+
39
+ #if defined(__asmjs__)
40
+ #define CPUINFO_ARCH_ASMJS 1
41
+ #endif
42
+
43
+ #if defined(__wasm__)
44
+ #if defined(__wasm_simd128__)
45
+ #define CPUINFO_ARCH_WASMSIMD 1
46
+ #else
47
+ #define CPUINFO_ARCH_WASM 1
48
+ #endif
49
+ #endif
50
+
51
+ #if defined(__riscv)
52
+ #if (__riscv_xlen == 32)
53
+ #define CPUINFO_ARCH_RISCV32 1
54
+ #elif (__riscv_xlen == 64)
55
+ #define CPUINFO_ARCH_RISCV64 1
56
+ #endif
57
+ #endif
58
+
59
+ /* Define other architecture-specific macros as 0 */
60
+
61
+ #ifndef CPUINFO_ARCH_X86
62
+ #define CPUINFO_ARCH_X86 0
63
+ #endif
64
+
65
+ #ifndef CPUINFO_ARCH_X86_64
66
+ #define CPUINFO_ARCH_X86_64 0
67
+ #endif
68
+
69
+ #ifndef CPUINFO_ARCH_ARM
70
+ #define CPUINFO_ARCH_ARM 0
71
+ #endif
72
+
73
+ #ifndef CPUINFO_ARCH_ARM64
74
+ #define CPUINFO_ARCH_ARM64 0
75
+ #endif
76
+
77
+ #ifndef CPUINFO_ARCH_PPC64
78
+ #define CPUINFO_ARCH_PPC64 0
79
+ #endif
80
+
81
+ #ifndef CPUINFO_ARCH_ASMJS
82
+ #define CPUINFO_ARCH_ASMJS 0
83
+ #endif
84
+
85
+ #ifndef CPUINFO_ARCH_WASM
86
+ #define CPUINFO_ARCH_WASM 0
87
+ #endif
88
+
89
+ #ifndef CPUINFO_ARCH_WASMSIMD
90
+ #define CPUINFO_ARCH_WASMSIMD 0
91
+ #endif
92
+
93
+ #ifndef CPUINFO_ARCH_RISCV32
94
+ #define CPUINFO_ARCH_RISCV32 0
95
+ #endif
96
+
97
+ #ifndef CPUINFO_ARCH_RISCV64
98
+ #define CPUINFO_ARCH_RISCV64 0
99
+ #endif
100
+
101
+ #if CPUINFO_ARCH_X86 && defined(_MSC_VER)
102
+ #define CPUINFO_ABI __cdecl
103
+ #elif CPUINFO_ARCH_X86 && defined(__GNUC__)
104
+ #define CPUINFO_ABI __attribute__((__cdecl__))
105
+ #else
106
+ #define CPUINFO_ABI
107
+ #endif
108
+
109
+ #define CPUINFO_CACHE_UNIFIED 0x00000001
110
+ #define CPUINFO_CACHE_INCLUSIVE 0x00000002
111
+ #define CPUINFO_CACHE_COMPLEX_INDEXING 0x00000004
112
+
113
+ struct cpuinfo_cache {
114
+ /** Cache size in bytes */
115
+ uint32_t size;
116
+ /** Number of ways of associativity */
117
+ uint32_t associativity;
118
+ /** Number of sets */
119
+ uint32_t sets;
120
+ /** Number of partitions */
121
+ uint32_t partitions;
122
+ /** Line size in bytes */
123
+ uint32_t line_size;
124
+ /**
125
+ * Binary characteristics of the cache (unified cache, inclusive cache,
126
+ * cache with complex indexing).
127
+ *
128
+ * @see CPUINFO_CACHE_UNIFIED, CPUINFO_CACHE_INCLUSIVE,
129
+ * CPUINFO_CACHE_COMPLEX_INDEXING
130
+ */
131
+ uint32_t flags;
132
+ /** Index of the first logical processor that shares this cache */
133
+ uint32_t processor_start;
134
+ /** Number of logical processors that share this cache */
135
+ uint32_t processor_count;
136
+ };
137
+
138
+ struct cpuinfo_trace_cache {
139
+ uint32_t uops;
140
+ uint32_t associativity;
141
+ };
142
+
143
+ #define CPUINFO_PAGE_SIZE_4KB 0x1000
144
+ #define CPUINFO_PAGE_SIZE_1MB 0x100000
145
+ #define CPUINFO_PAGE_SIZE_2MB 0x200000
146
+ #define CPUINFO_PAGE_SIZE_4MB 0x400000
147
+ #define CPUINFO_PAGE_SIZE_16MB 0x1000000
148
+ #define CPUINFO_PAGE_SIZE_1GB 0x40000000
149
+
150
+ struct cpuinfo_tlb {
151
+ uint32_t entries;
152
+ uint32_t associativity;
153
+ uint64_t pages;
154
+ };
155
+
156
+ /** Vendor of processor core design */
157
+ enum cpuinfo_vendor {
158
+ /** Processor vendor is not known to the library, or the library failed
159
+ to get vendor information from the OS. */
160
+ cpuinfo_vendor_unknown = 0,
161
+
162
+ /* Active vendors of modern CPUs */
163
+
164
+ /**
165
+ * Intel Corporation. Vendor of x86, x86-64, IA64, and ARM processor
166
+ * microarchitectures.
167
+ *
168
+ * Sold its ARM design subsidiary in 2006. The last ARM processor design
169
+ * was released in 2004.
170
+ */
171
+ cpuinfo_vendor_intel = 1,
172
+ /** Advanced Micro Devices, Inc. Vendor of x86 and x86-64 processor
173
+ microarchitectures. */
174
+ cpuinfo_vendor_amd = 2,
175
+ /** ARM Holdings plc. Vendor of ARM and ARM64 processor
176
+ microarchitectures. */
177
+ cpuinfo_vendor_arm = 3,
178
+ /** Qualcomm Incorporated. Vendor of ARM and ARM64 processor
179
+ microarchitectures. */
180
+ cpuinfo_vendor_qualcomm = 4,
181
+ /** Apple Inc. Vendor of ARM and ARM64 processor microarchitectures. */
182
+ cpuinfo_vendor_apple = 5,
183
+ /** Samsung Electronics Co., Ltd. Vendir if ARM64 processor
184
+ microarchitectures. */
185
+ cpuinfo_vendor_samsung = 6,
186
+ /** Nvidia Corporation. Vendor of ARM64-compatible processor
187
+ microarchitectures. */
188
+ cpuinfo_vendor_nvidia = 7,
189
+ /** MIPS Technologies, Inc. Vendor of MIPS processor microarchitectures.
190
+ */
191
+ cpuinfo_vendor_mips = 8,
192
+ /** International Business Machines Corporation. Vendor of PowerPC
193
+ processor microarchitectures. */
194
+ cpuinfo_vendor_ibm = 9,
195
+ /** Ingenic Semiconductor. Vendor of MIPS processor microarchitectures.
196
+ */
197
+ cpuinfo_vendor_ingenic = 10,
198
+ /**
199
+ * VIA Technologies, Inc. Vendor of x86 and x86-64 processor
200
+ * microarchitectures.
201
+ *
202
+ * Processors are designed by Centaur Technology, a subsidiary of VIA
203
+ * Technologies.
204
+ */
205
+ cpuinfo_vendor_via = 11,
206
+ /** Cavium, Inc. Vendor of ARM64 processor microarchitectures. */
207
+ cpuinfo_vendor_cavium = 12,
208
+ /** Broadcom, Inc. Vendor of ARM processor microarchitectures. */
209
+ cpuinfo_vendor_broadcom = 13,
210
+ /** Applied Micro Circuits Corporation (APM). Vendor of ARM64 processor
211
+ microarchitectures. */
212
+ cpuinfo_vendor_apm = 14,
213
+ /**
214
+ * Huawei Technologies Co., Ltd. Vendor of ARM64 processor
215
+ * microarchitectures.
216
+ *
217
+ * Processors are designed by HiSilicon, a subsidiary of Huawei.
218
+ */
219
+ cpuinfo_vendor_huawei = 15,
220
+ /**
221
+ * Hygon (Chengdu Haiguang Integrated Circuit Design Co., Ltd), Vendor
222
+ * of x86-64 processor microarchitectures.
223
+ *
224
+ * Processors are variants of AMD cores.
225
+ */
226
+ cpuinfo_vendor_hygon = 16,
227
+ /** SiFive, Inc. Vendor of RISC-V processor microarchitectures. */
228
+ cpuinfo_vendor_sifive = 17,
229
+
230
+ /* Active vendors of embedded CPUs */
231
+
232
+ /** Texas Instruments Inc. Vendor of ARM processor microarchitectures.
233
+ */
234
+ cpuinfo_vendor_texas_instruments = 30,
235
+ /** Marvell Technology Group Ltd. Vendor of ARM processor
236
+ * microarchitectures.
237
+ */
238
+ cpuinfo_vendor_marvell = 31,
239
+ /** RDC Semiconductor Co., Ltd. Vendor of x86 processor
240
+ microarchitectures. */
241
+ cpuinfo_vendor_rdc = 32,
242
+ /** DM&P Electronics Inc. Vendor of x86 processor microarchitectures. */
243
+ cpuinfo_vendor_dmp = 33,
244
+ /** Motorola, Inc. Vendor of PowerPC and ARM processor
245
+ microarchitectures. */
246
+ cpuinfo_vendor_motorola = 34,
247
+
248
+ /* Defunct CPU vendors */
249
+
250
+ /**
251
+ * Transmeta Corporation. Vendor of x86 processor microarchitectures.
252
+ *
253
+ * Now defunct. The last processor design was released in 2004.
254
+ * Transmeta processors implemented VLIW ISA and used binary translation
255
+ * to execute x86 code.
256
+ */
257
+ cpuinfo_vendor_transmeta = 50,
258
+ /**
259
+ * Cyrix Corporation. Vendor of x86 processor microarchitectures.
260
+ *
261
+ * Now defunct. The last processor design was released in 1996.
262
+ */
263
+ cpuinfo_vendor_cyrix = 51,
264
+ /**
265
+ * Rise Technology. Vendor of x86 processor microarchitectures.
266
+ *
267
+ * Now defunct. The last processor design was released in 1999.
268
+ */
269
+ cpuinfo_vendor_rise = 52,
270
+ /**
271
+ * National Semiconductor. Vendor of x86 processor microarchitectures.
272
+ *
273
+ * Sold its x86 design subsidiary in 1999. The last processor design was
274
+ * released in 1998.
275
+ */
276
+ cpuinfo_vendor_nsc = 53,
277
+ /**
278
+ * Silicon Integrated Systems. Vendor of x86 processor
279
+ * microarchitectures.
280
+ *
281
+ * Sold its x86 design subsidiary in 2001. The last processor design was
282
+ * released in 2001.
283
+ */
284
+ cpuinfo_vendor_sis = 54,
285
+ /**
286
+ * NexGen. Vendor of x86 processor microarchitectures.
287
+ *
288
+ * Now defunct. The last processor design was released in 1994.
289
+ * NexGen designed the first x86 microarchitecture which decomposed x86
290
+ * instructions into simple microoperations.
291
+ */
292
+ cpuinfo_vendor_nexgen = 55,
293
+ /**
294
+ * United Microelectronics Corporation. Vendor of x86 processor
295
+ * microarchitectures.
296
+ *
297
+ * Ceased x86 in the early 1990s. The last processor design was released
298
+ * in 1991. Designed U5C and U5D processors. Both are 486 level.
299
+ */
300
+ cpuinfo_vendor_umc = 56,
301
+ /**
302
+ * Digital Equipment Corporation. Vendor of ARM processor
303
+ * microarchitecture.
304
+ *
305
+ * Sold its ARM designs in 1997. The last processor design was released
306
+ * in 1997.
307
+ */
308
+ cpuinfo_vendor_dec = 57,
309
+ };
310
+
311
+ /**
312
+ * Processor microarchitecture
313
+ *
314
+ * Processors with different microarchitectures often have different instruction
315
+ * performance characteristics, and may have dramatically different pipeline
316
+ * organization.
317
+ */
318
+ enum cpuinfo_uarch {
319
+ /** Microarchitecture is unknown, or the library failed to get
320
+ information about the microarchitecture from OS */
321
+ cpuinfo_uarch_unknown = 0,
322
+
323
+ /** Pentium and Pentium MMX microarchitecture. */
324
+ cpuinfo_uarch_p5 = 0x00100100,
325
+ /** Intel Quark microarchitecture. */
326
+ cpuinfo_uarch_quark = 0x00100101,
327
+
328
+ /** Pentium Pro, Pentium II, and Pentium III. */
329
+ cpuinfo_uarch_p6 = 0x00100200,
330
+ /** Pentium M. */
331
+ cpuinfo_uarch_dothan = 0x00100201,
332
+ /** Intel Core microarchitecture. */
333
+ cpuinfo_uarch_yonah = 0x00100202,
334
+ /** Intel Core 2 microarchitecture on 65 nm process. */
335
+ cpuinfo_uarch_conroe = 0x00100203,
336
+ /** Intel Core 2 microarchitecture on 45 nm process. */
337
+ cpuinfo_uarch_penryn = 0x00100204,
338
+ /** Intel Nehalem and Westmere microarchitectures (Core i3/i5/i7 1st
339
+ gen). */
340
+ cpuinfo_uarch_nehalem = 0x00100205,
341
+ /** Intel Sandy Bridge microarchitecture (Core i3/i5/i7 2nd gen). */
342
+ cpuinfo_uarch_sandy_bridge = 0x00100206,
343
+ /** Intel Ivy Bridge microarchitecture (Core i3/i5/i7 3rd gen). */
344
+ cpuinfo_uarch_ivy_bridge = 0x00100207,
345
+ /** Intel Haswell microarchitecture (Core i3/i5/i7 4th gen). */
346
+ cpuinfo_uarch_haswell = 0x00100208,
347
+ /** Intel Broadwell microarchitecture. */
348
+ cpuinfo_uarch_broadwell = 0x00100209,
349
+ /** Intel Sky Lake microarchitecture (14 nm, including
350
+ Kaby/Coffee/Whiskey/Amber/Comet/Cascade/Cooper Lake). */
351
+ cpuinfo_uarch_sky_lake = 0x0010020A,
352
+ /** DEPRECATED (Intel Kaby Lake microarchitecture). */
353
+ cpuinfo_uarch_kaby_lake = 0x0010020A,
354
+ /** Intel Palm Cove microarchitecture (10 nm, Cannon Lake). */
355
+ cpuinfo_uarch_palm_cove = 0x0010020B,
356
+ /** Intel Sunny Cove microarchitecture (10 nm, Ice Lake). */
357
+ cpuinfo_uarch_sunny_cove = 0x0010020C,
358
+
359
+ /** Pentium 4 with Willamette, Northwood, or Foster cores. */
360
+ cpuinfo_uarch_willamette = 0x00100300,
361
+ /** Pentium 4 with Prescott and later cores. */
362
+ cpuinfo_uarch_prescott = 0x00100301,
363
+
364
+ /** Intel Atom on 45 nm process. */
365
+ cpuinfo_uarch_bonnell = 0x00100400,
366
+ /** Intel Atom on 32 nm process. */
367
+ cpuinfo_uarch_saltwell = 0x00100401,
368
+ /** Intel Silvermont microarchitecture (22 nm out-of-order Atom). */
369
+ cpuinfo_uarch_silvermont = 0x00100402,
370
+ /** Intel Airmont microarchitecture (14 nm out-of-order Atom). */
371
+ cpuinfo_uarch_airmont = 0x00100403,
372
+ /** Intel Goldmont microarchitecture (Denverton, Apollo Lake). */
373
+ cpuinfo_uarch_goldmont = 0x00100404,
374
+ /** Intel Goldmont Plus microarchitecture (Gemini Lake). */
375
+ cpuinfo_uarch_goldmont_plus = 0x00100405,
376
+
377
+ /** Intel Knights Ferry HPC boards. */
378
+ cpuinfo_uarch_knights_ferry = 0x00100500,
379
+ /** Intel Knights Corner HPC boards (aka Xeon Phi). */
380
+ cpuinfo_uarch_knights_corner = 0x00100501,
381
+ /** Intel Knights Landing microarchitecture (second-gen MIC). */
382
+ cpuinfo_uarch_knights_landing = 0x00100502,
383
+ /** Intel Knights Hill microarchitecture (third-gen MIC). */
384
+ cpuinfo_uarch_knights_hill = 0x00100503,
385
+ /** Intel Knights Mill Xeon Phi. */
386
+ cpuinfo_uarch_knights_mill = 0x00100504,
387
+
388
+ /** Intel/Marvell XScale series. */
389
+ cpuinfo_uarch_xscale = 0x00100600,
390
+
391
+ /** AMD K5. */
392
+ cpuinfo_uarch_k5 = 0x00200100,
393
+ /** AMD K6 and alike. */
394
+ cpuinfo_uarch_k6 = 0x00200101,
395
+ /** AMD Athlon and Duron. */
396
+ cpuinfo_uarch_k7 = 0x00200102,
397
+ /** AMD Athlon 64, Opteron 64. */
398
+ cpuinfo_uarch_k8 = 0x00200103,
399
+ /** AMD Family 10h (Barcelona, Istambul, Magny-Cours). */
400
+ cpuinfo_uarch_k10 = 0x00200104,
401
+ /**
402
+ * AMD Bulldozer microarchitecture
403
+ * Zambezi FX-series CPUs, Zurich, Valencia and Interlagos Opteron CPUs.
404
+ */
405
+ cpuinfo_uarch_bulldozer = 0x00200105,
406
+ /**
407
+ * AMD Piledriver microarchitecture
408
+ * Vishera FX-series CPUs, Trinity and Richland APUs, Delhi, Seoul, Abu
409
+ * Dhabi Opteron CPUs.
410
+ */
411
+ cpuinfo_uarch_piledriver = 0x00200106,
412
+ /** AMD Steamroller microarchitecture (Kaveri APUs). */
413
+ cpuinfo_uarch_steamroller = 0x00200107,
414
+ /** AMD Excavator microarchitecture (Carizzo APUs). */
415
+ cpuinfo_uarch_excavator = 0x00200108,
416
+ /** AMD Zen microarchitecture (12/14 nm Ryzen and EPYC CPUs). */
417
+ cpuinfo_uarch_zen = 0x00200109,
418
+ /** AMD Zen 2 microarchitecture (7 nm Ryzen and EPYC CPUs). */
419
+ cpuinfo_uarch_zen2 = 0x0020010A,
420
+ /** AMD Zen 3 microarchitecture. */
421
+ cpuinfo_uarch_zen3 = 0x0020010B,
422
+ /** AMD Zen 4 microarchitecture. */
423
+ cpuinfo_uarch_zen4 = 0x0020010C,
424
+
425
+ /** NSC Geode and AMD Geode GX and LX. */
426
+ cpuinfo_uarch_geode = 0x00200200,
427
+ /** AMD Bobcat mobile microarchitecture. */
428
+ cpuinfo_uarch_bobcat = 0x00200201,
429
+ /** AMD Jaguar mobile microarchitecture. */
430
+ cpuinfo_uarch_jaguar = 0x00200202,
431
+ /** AMD Puma mobile microarchitecture. */
432
+ cpuinfo_uarch_puma = 0x00200203,
433
+
434
+ /** ARM7 series. */
435
+ cpuinfo_uarch_arm7 = 0x00300100,
436
+ /** ARM9 series. */
437
+ cpuinfo_uarch_arm9 = 0x00300101,
438
+ /** ARM 1136, ARM 1156, ARM 1176, or ARM 11MPCore. */
439
+ cpuinfo_uarch_arm11 = 0x00300102,
440
+
441
+ /** ARM Cortex-A5. */
442
+ cpuinfo_uarch_cortex_a5 = 0x00300205,
443
+ /** ARM Cortex-A7. */
444
+ cpuinfo_uarch_cortex_a7 = 0x00300207,
445
+ /** ARM Cortex-A8. */
446
+ cpuinfo_uarch_cortex_a8 = 0x00300208,
447
+ /** ARM Cortex-A9. */
448
+ cpuinfo_uarch_cortex_a9 = 0x00300209,
449
+ /** ARM Cortex-A12. */
450
+ cpuinfo_uarch_cortex_a12 = 0x00300212,
451
+ /** ARM Cortex-A15. */
452
+ cpuinfo_uarch_cortex_a15 = 0x00300215,
453
+ /** ARM Cortex-A17. */
454
+ cpuinfo_uarch_cortex_a17 = 0x00300217,
455
+
456
+ /** ARM Cortex-A32. */
457
+ cpuinfo_uarch_cortex_a32 = 0x00300332,
458
+ /** ARM Cortex-A35. */
459
+ cpuinfo_uarch_cortex_a35 = 0x00300335,
460
+ /** ARM Cortex-A53. */
461
+ cpuinfo_uarch_cortex_a53 = 0x00300353,
462
+ /** ARM Cortex-A55 revision 0 (restricted dual-issue capabilities
463
+ compared to revision 1+). */
464
+ cpuinfo_uarch_cortex_a55r0 = 0x00300354,
465
+ /** ARM Cortex-A55. */
466
+ cpuinfo_uarch_cortex_a55 = 0x00300355,
467
+ /** ARM Cortex-A57. */
468
+ cpuinfo_uarch_cortex_a57 = 0x00300357,
469
+ /** ARM Cortex-A65. */
470
+ cpuinfo_uarch_cortex_a65 = 0x00300365,
471
+ /** ARM Cortex-A72. */
472
+ cpuinfo_uarch_cortex_a72 = 0x00300372,
473
+ /** ARM Cortex-A73. */
474
+ cpuinfo_uarch_cortex_a73 = 0x00300373,
475
+ /** ARM Cortex-A75. */
476
+ cpuinfo_uarch_cortex_a75 = 0x00300375,
477
+ /** ARM Cortex-A76. */
478
+ cpuinfo_uarch_cortex_a76 = 0x00300376,
479
+ /** ARM Cortex-A77. */
480
+ cpuinfo_uarch_cortex_a77 = 0x00300377,
481
+ /** ARM Cortex-A78. */
482
+ cpuinfo_uarch_cortex_a78 = 0x00300378,
483
+
484
+ /** ARM Neoverse N1. */
485
+ cpuinfo_uarch_neoverse_n1 = 0x00300400,
486
+ /** ARM Neoverse E1. */
487
+ cpuinfo_uarch_neoverse_e1 = 0x00300401,
488
+ /** ARM Neoverse V1. */
489
+ cpuinfo_uarch_neoverse_v1 = 0x00300402,
490
+ /** ARM Neoverse N2. */
491
+ cpuinfo_uarch_neoverse_n2 = 0x00300403,
492
+ /** ARM Neoverse V2. */
493
+ cpuinfo_uarch_neoverse_v2 = 0x00300404,
494
+
495
+ /** ARM Cortex-X1. */
496
+ cpuinfo_uarch_cortex_x1 = 0x00300501,
497
+ /** ARM Cortex-X2. */
498
+ cpuinfo_uarch_cortex_x2 = 0x00300502,
499
+ /** ARM Cortex-X3. */
500
+ cpuinfo_uarch_cortex_x3 = 0x00300503,
501
+ /** ARM Cortex-X4. */
502
+ cpuinfo_uarch_cortex_x4 = 0x00300504,
503
+
504
+ /** ARM Cortex-A510. */
505
+ cpuinfo_uarch_cortex_a510 = 0x00300551,
506
+ /** ARM Cortex-A520. */
507
+ cpuinfo_uarch_cortex_a520 = 0x00300552,
508
+ /** ARM Cortex-A710. */
509
+ cpuinfo_uarch_cortex_a710 = 0x00300571,
510
+ /** ARM Cortex-A715. */
511
+ cpuinfo_uarch_cortex_a715 = 0x00300572,
512
+ /** ARM Cortex-A720. */
513
+ cpuinfo_uarch_cortex_a720 = 0x00300573,
514
+
515
+ /** Qualcomm Scorpion. */
516
+ cpuinfo_uarch_scorpion = 0x00400100,
517
+ /** Qualcomm Krait. */
518
+ cpuinfo_uarch_krait = 0x00400101,
519
+ /** Qualcomm Kryo. */
520
+ cpuinfo_uarch_kryo = 0x00400102,
521
+ /** Qualcomm Falkor. */
522
+ cpuinfo_uarch_falkor = 0x00400103,
523
+ /** Qualcomm Saphira. */
524
+ cpuinfo_uarch_saphira = 0x00400104,
525
+
526
+ /** Nvidia Denver. */
527
+ cpuinfo_uarch_denver = 0x00500100,
528
+ /** Nvidia Denver 2. */
529
+ cpuinfo_uarch_denver2 = 0x00500101,
530
+ /** Nvidia Carmel. */
531
+ cpuinfo_uarch_carmel = 0x00500102,
532
+
533
+ /** Samsung Exynos M1 (Exynos 8890 big cores). */
534
+ cpuinfo_uarch_exynos_m1 = 0x00600100,
535
+ /** Samsung Exynos M2 (Exynos 8895 big cores). */
536
+ cpuinfo_uarch_exynos_m2 = 0x00600101,
537
+ /** Samsung Exynos M3 (Exynos 9810 big cores). */
538
+ cpuinfo_uarch_exynos_m3 = 0x00600102,
539
+ /** Samsung Exynos M4 (Exynos 9820 big cores). */
540
+ cpuinfo_uarch_exynos_m4 = 0x00600103,
541
+ /** Samsung Exynos M5 (Exynos 9830 big cores). */
542
+ cpuinfo_uarch_exynos_m5 = 0x00600104,
543
+
544
+ /* Deprecated synonym for Cortex-A76 */
545
+ cpuinfo_uarch_cortex_a76ae = 0x00300376,
546
+ /* Deprecated names for Exynos. */
547
+ cpuinfo_uarch_mongoose_m1 = 0x00600100,
548
+ cpuinfo_uarch_mongoose_m2 = 0x00600101,
549
+ cpuinfo_uarch_meerkat_m3 = 0x00600102,
550
+ cpuinfo_uarch_meerkat_m4 = 0x00600103,
551
+
552
+ /** Apple A6 and A6X processors. */
553
+ cpuinfo_uarch_swift = 0x00700100,
554
+ /** Apple A7 processor. */
555
+ cpuinfo_uarch_cyclone = 0x00700101,
556
+ /** Apple A8 and A8X processor. */
557
+ cpuinfo_uarch_typhoon = 0x00700102,
558
+ /** Apple A9 and A9X processor. */
559
+ cpuinfo_uarch_twister = 0x00700103,
560
+ /** Apple A10 and A10X processor. */
561
+ cpuinfo_uarch_hurricane = 0x00700104,
562
+ /** Apple A11 processor (big cores). */
563
+ cpuinfo_uarch_monsoon = 0x00700105,
564
+ /** Apple A11 processor (little cores). */
565
+ cpuinfo_uarch_mistral = 0x00700106,
566
+ /** Apple A12 processor (big cores). */
567
+ cpuinfo_uarch_vortex = 0x00700107,
568
+ /** Apple A12 processor (little cores). */
569
+ cpuinfo_uarch_tempest = 0x00700108,
570
+ /** Apple A13 processor (big cores). */
571
+ cpuinfo_uarch_lightning = 0x00700109,
572
+ /** Apple A13 processor (little cores). */
573
+ cpuinfo_uarch_thunder = 0x0070010A,
574
+ /** Apple A14 / M1 processor (big cores). */
575
+ cpuinfo_uarch_firestorm = 0x0070010B,
576
+ /** Apple A14 / M1 processor (little cores). */
577
+ cpuinfo_uarch_icestorm = 0x0070010C,
578
+ /** Apple A15 / M2 processor (big cores). */
579
+ cpuinfo_uarch_avalanche = 0x0070010D,
580
+ /** Apple A15 / M2 processor (little cores). */
581
+ cpuinfo_uarch_blizzard = 0x0070010E,
582
+
583
+ /** Cavium ThunderX. */
584
+ cpuinfo_uarch_thunderx = 0x00800100,
585
+ /** Cavium ThunderX2 (originally Broadcom Vulkan). */
586
+ cpuinfo_uarch_thunderx2 = 0x00800200,
587
+
588
+ /** Marvell PJ4. */
589
+ cpuinfo_uarch_pj4 = 0x00900100,
590
+
591
+ /** Broadcom Brahma B15. */
592
+ cpuinfo_uarch_brahma_b15 = 0x00A00100,
593
+ /** Broadcom Brahma B53. */
594
+ cpuinfo_uarch_brahma_b53 = 0x00A00101,
595
+
596
+ /** Applied Micro X-Gene. */
597
+ cpuinfo_uarch_xgene = 0x00B00100,
598
+
599
+ /* Hygon Dhyana (a modification of AMD Zen for Chinese market). */
600
+ cpuinfo_uarch_dhyana = 0x01000100,
601
+
602
+ /** HiSilicon TaiShan v110 (Huawei Kunpeng 920 series processors). */
603
+ cpuinfo_uarch_taishan_v110 = 0x00C00100,
604
+ };
605
+
606
+ struct cpuinfo_processor {
607
+ /** SMT (hyperthread) ID within a core */
608
+ uint32_t smt_id;
609
+ /** Core containing this logical processor */
610
+ const struct cpuinfo_core *core;
611
+ /** Cluster of cores containing this logical processor */
612
+ const struct cpuinfo_cluster *cluster;
613
+ /** Physical package containing this logical processor */
614
+ const struct cpuinfo_package *package;
615
+ #if defined(__linux__)
616
+ /**
617
+ * Linux-specific ID for the logical processor:
618
+ * - Linux kernel exposes information about this logical processor in
619
+ * /sys/devices/system/cpu/cpu<linux_id>/
620
+ * - Bit <linux_id> in the cpu_set_t identifies this logical processor
621
+ */
622
+ int linux_id;
623
+ #endif
624
+ #if defined(_WIN32) || defined(__CYGWIN__)
625
+ /** Windows-specific ID for the group containing the logical processor.
626
+ */
627
+ uint16_t windows_group_id;
628
+ /**
629
+ * Windows-specific ID of the logical processor within its group:
630
+ * - Bit <windows_processor_id> in the KAFFINITY mask identifies this
631
+ * logical processor within its group.
632
+ */
633
+ uint16_t windows_processor_id;
634
+ #endif
635
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
636
+ /** APIC ID (unique x86-specific ID of the logical processor) */
637
+ uint32_t apic_id;
638
+ #endif
639
+ struct {
640
+ /** Level 1 instruction cache */
641
+ const struct cpuinfo_cache *l1i;
642
+ /** Level 1 data cache */
643
+ const struct cpuinfo_cache *l1d;
644
+ /** Level 2 unified or data cache */
645
+ const struct cpuinfo_cache *l2;
646
+ /** Level 3 unified or data cache */
647
+ const struct cpuinfo_cache *l3;
648
+ /** Level 4 unified or data cache */
649
+ const struct cpuinfo_cache *l4;
650
+ } cache;
651
+ };
652
+
653
+ struct cpuinfo_core {
654
+ /** Index of the first logical processor on this core. */
655
+ uint32_t processor_start;
656
+ /** Number of logical processors on this core */
657
+ uint32_t processor_count;
658
+ /** Core ID within a package */
659
+ uint32_t core_id;
660
+ /** Cluster containing this core */
661
+ const struct cpuinfo_cluster *cluster;
662
+ /** Physical package containing this core. */
663
+ const struct cpuinfo_package *package;
664
+ /** Vendor of the CPU microarchitecture for this core */
665
+ enum cpuinfo_vendor vendor;
666
+ /** CPU microarchitecture for this core */
667
+ enum cpuinfo_uarch uarch;
668
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
669
+ /** Value of CPUID leaf 1 EAX register for this core */
670
+ uint32_t cpuid;
671
+ #elif CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
672
+ /** Value of Main ID Register (MIDR) for this core */
673
+ uint32_t midr;
674
+ #endif
675
+ /** Clock rate (non-Turbo) of the core, in Hz */
676
+ uint64_t frequency;
677
+ };
678
+
679
+ struct cpuinfo_cluster {
680
+ /** Index of the first logical processor in the cluster */
681
+ uint32_t processor_start;
682
+ /** Number of logical processors in the cluster */
683
+ uint32_t processor_count;
684
+ /** Index of the first core in the cluster */
685
+ uint32_t core_start;
686
+ /** Number of cores on the cluster */
687
+ uint32_t core_count;
688
+ /** Cluster ID within a package */
689
+ uint32_t cluster_id;
690
+ /** Physical package containing the cluster */
691
+ const struct cpuinfo_package *package;
692
+ /** CPU microarchitecture vendor of the cores in the cluster */
693
+ enum cpuinfo_vendor vendor;
694
+ /** CPU microarchitecture of the cores in the cluster */
695
+ enum cpuinfo_uarch uarch;
696
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
697
+ /** Value of CPUID leaf 1 EAX register of the cores in the cluster */
698
+ uint32_t cpuid;
699
+ #elif CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
700
+ /** Value of Main ID Register (MIDR) of the cores in the cluster */
701
+ uint32_t midr;
702
+ #endif
703
+ /** Clock rate (non-Turbo) of the cores in the cluster, in Hz */
704
+ uint64_t frequency;
705
+ };
706
+
707
+ #define CPUINFO_PACKAGE_NAME_MAX 48
708
+
709
+ struct cpuinfo_package {
710
+ /** SoC or processor chip model name */
711
+ char name[CPUINFO_PACKAGE_NAME_MAX];
712
+ /** Index of the first logical processor on this physical package */
713
+ uint32_t processor_start;
714
+ /** Number of logical processors on this physical package */
715
+ uint32_t processor_count;
716
+ /** Index of the first core on this physical package */
717
+ uint32_t core_start;
718
+ /** Number of cores on this physical package */
719
+ uint32_t core_count;
720
+ /** Index of the first cluster of cores on this physical package */
721
+ uint32_t cluster_start;
722
+ /** Number of clusters of cores on this physical package */
723
+ uint32_t cluster_count;
724
+ };
725
+
726
+ struct cpuinfo_uarch_info {
727
+ /** Type of CPU microarchitecture */
728
+ enum cpuinfo_uarch uarch;
729
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
730
+ /** Value of CPUID leaf 1 EAX register for the microarchitecture */
731
+ uint32_t cpuid;
732
+ #elif CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
733
+ /** Value of Main ID Register (MIDR) for the microarchitecture */
734
+ uint32_t midr;
735
+ #endif
736
+ /** Number of logical processors with the microarchitecture */
737
+ uint32_t processor_count;
738
+ /** Number of cores with the microarchitecture */
739
+ uint32_t core_count;
740
+ };
741
+
742
+ #ifdef __cplusplus
743
+ extern "C" {
744
+ #endif
745
+
746
+ bool CPUINFO_ABI cpuinfo_initialize(void);
747
+
748
+ void CPUINFO_ABI cpuinfo_deinitialize(void);
749
+
750
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
751
+ /* This structure is not a part of stable API. Use cpuinfo_has_x86_* functions
752
+ * instead. */
753
+ struct cpuinfo_x86_isa {
754
+ #if CPUINFO_ARCH_X86
755
+ bool rdtsc;
756
+ #endif
757
+ bool rdtscp;
758
+ bool rdpid;
759
+ bool sysenter;
760
+ #if CPUINFO_ARCH_X86
761
+ bool syscall;
762
+ #endif
763
+ bool msr;
764
+ bool clzero;
765
+ bool clflush;
766
+ bool clflushopt;
767
+ bool mwait;
768
+ bool mwaitx;
769
+ #if CPUINFO_ARCH_X86
770
+ bool emmx;
771
+ #endif
772
+ bool fxsave;
773
+ bool xsave;
774
+ #if CPUINFO_ARCH_X86
775
+ bool fpu;
776
+ bool mmx;
777
+ bool mmx_plus;
778
+ #endif
779
+ bool three_d_now;
780
+ bool three_d_now_plus;
781
+ #if CPUINFO_ARCH_X86
782
+ bool three_d_now_geode;
783
+ #endif
784
+ bool prefetch;
785
+ bool prefetchw;
786
+ bool prefetchwt1;
787
+ #if CPUINFO_ARCH_X86
788
+ bool daz;
789
+ bool sse;
790
+ bool sse2;
791
+ #endif
792
+ bool sse3;
793
+ bool ssse3;
794
+ bool sse4_1;
795
+ bool sse4_2;
796
+ bool sse4a;
797
+ bool misaligned_sse;
798
+ bool avx;
799
+ bool avxvnni;
800
+ bool fma3;
801
+ bool fma4;
802
+ bool xop;
803
+ bool f16c;
804
+ bool avx2;
805
+ bool avx512f;
806
+ bool avx512pf;
807
+ bool avx512er;
808
+ bool avx512cd;
809
+ bool avx512dq;
810
+ bool avx512bw;
811
+ bool avx512vl;
812
+ bool avx512ifma;
813
+ bool avx512vbmi;
814
+ bool avx512vbmi2;
815
+ bool avx512bitalg;
816
+ bool avx512vpopcntdq;
817
+ bool avx512vnni;
818
+ bool avx512bf16;
819
+ bool avx512fp16;
820
+ bool avx512vp2intersect;
821
+ bool avx512_4vnniw;
822
+ bool avx512_4fmaps;
823
+ bool amx_bf16;
824
+ bool amx_tile;
825
+ bool amx_int8;
826
+ bool amx_fp16;
827
+ bool avx_vnni_int8;
828
+ bool avx_vnni_int16;
829
+ bool avx_ne_convert;
830
+ bool hle;
831
+ bool rtm;
832
+ bool xtest;
833
+ bool mpx;
834
+ #if CPUINFO_ARCH_X86
835
+ bool cmov;
836
+ bool cmpxchg8b;
837
+ #endif
838
+ bool cmpxchg16b;
839
+ bool clwb;
840
+ bool movbe;
841
+ #if CPUINFO_ARCH_X86_64
842
+ bool lahf_sahf;
843
+ #endif
844
+ bool fs_gs_base;
845
+ bool lzcnt;
846
+ bool popcnt;
847
+ bool tbm;
848
+ bool bmi;
849
+ bool bmi2;
850
+ bool adx;
851
+ bool aes;
852
+ bool vaes;
853
+ bool pclmulqdq;
854
+ bool vpclmulqdq;
855
+ bool gfni;
856
+ bool rdrand;
857
+ bool rdseed;
858
+ bool sha;
859
+ bool rng;
860
+ bool ace;
861
+ bool ace2;
862
+ bool phe;
863
+ bool pmm;
864
+ bool lwp;
865
+ };
866
+
867
+ extern struct cpuinfo_x86_isa cpuinfo_isa;
868
+ #endif
869
+
870
+ static inline bool cpuinfo_has_x86_rdtsc(void) {
871
+ #if CPUINFO_ARCH_X86_64
872
+ return true;
873
+ #elif CPUINFO_ARCH_X86
874
+ #if defined(__ANDROID__)
875
+ return true;
876
+ #else
877
+ return cpuinfo_isa.rdtsc;
878
+ #endif
879
+ #else
880
+ return false;
881
+ #endif
882
+ }
883
+
884
+ static inline bool cpuinfo_has_x86_rdtscp(void) {
885
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
886
+ return cpuinfo_isa.rdtscp;
887
+ #else
888
+ return false;
889
+ #endif
890
+ }
891
+
892
+ static inline bool cpuinfo_has_x86_rdpid(void) {
893
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
894
+ return cpuinfo_isa.rdpid;
895
+ #else
896
+ return false;
897
+ #endif
898
+ }
899
+
900
+ static inline bool cpuinfo_has_x86_clzero(void) {
901
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
902
+ return cpuinfo_isa.clzero;
903
+ #else
904
+ return false;
905
+ #endif
906
+ }
907
+
908
+ static inline bool cpuinfo_has_x86_mwait(void) {
909
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
910
+ return cpuinfo_isa.mwait;
911
+ #else
912
+ return false;
913
+ #endif
914
+ }
915
+
916
+ static inline bool cpuinfo_has_x86_mwaitx(void) {
917
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
918
+ return cpuinfo_isa.mwaitx;
919
+ #else
920
+ return false;
921
+ #endif
922
+ }
923
+
924
+ static inline bool cpuinfo_has_x86_fxsave(void) {
925
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
926
+ return cpuinfo_isa.fxsave;
927
+ #else
928
+ return false;
929
+ #endif
930
+ }
931
+
932
+ static inline bool cpuinfo_has_x86_xsave(void) {
933
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
934
+ return cpuinfo_isa.xsave;
935
+ #else
936
+ return false;
937
+ #endif
938
+ }
939
+
940
+ static inline bool cpuinfo_has_x86_fpu(void) {
941
+ #if CPUINFO_ARCH_X86_64
942
+ return true;
943
+ #elif CPUINFO_ARCH_X86
944
+ #if defined(__ANDROID__)
945
+ return true;
946
+ #else
947
+ return cpuinfo_isa.fpu;
948
+ #endif
949
+ #else
950
+ return false;
951
+ #endif
952
+ }
953
+
954
+ static inline bool cpuinfo_has_x86_mmx(void) {
955
+ #if CPUINFO_ARCH_X86_64
956
+ return true;
957
+ #elif CPUINFO_ARCH_X86
958
+ #if defined(__ANDROID__)
959
+ return true;
960
+ #else
961
+ return cpuinfo_isa.mmx;
962
+ #endif
963
+ #else
964
+ return false;
965
+ #endif
966
+ }
967
+
968
+ static inline bool cpuinfo_has_x86_mmx_plus(void) {
969
+ #if CPUINFO_ARCH_X86_64
970
+ return true;
971
+ #elif CPUINFO_ARCH_X86
972
+ #if defined(__ANDROID__)
973
+ return true;
974
+ #else
975
+ return cpuinfo_isa.mmx_plus;
976
+ #endif
977
+ #else
978
+ return false;
979
+ #endif
980
+ }
981
+
982
+ static inline bool cpuinfo_has_x86_3dnow(void) {
983
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
984
+ return cpuinfo_isa.three_d_now;
985
+ #else
986
+ return false;
987
+ #endif
988
+ }
989
+
990
+ static inline bool cpuinfo_has_x86_3dnow_plus(void) {
991
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
992
+ return cpuinfo_isa.three_d_now_plus;
993
+ #else
994
+ return false;
995
+ #endif
996
+ }
997
+
998
+ static inline bool cpuinfo_has_x86_3dnow_geode(void) {
999
+ #if CPUINFO_ARCH_X86_64
1000
+ return false;
1001
+ #elif CPUINFO_ARCH_X86
1002
+ #if defined(__ANDROID__)
1003
+ return false;
1004
+ #else
1005
+ return cpuinfo_isa.three_d_now_geode;
1006
+ #endif
1007
+ #else
1008
+ return false;
1009
+ #endif
1010
+ }
1011
+
1012
+ static inline bool cpuinfo_has_x86_prefetch(void) {
1013
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1014
+ return cpuinfo_isa.prefetch;
1015
+ #else
1016
+ return false;
1017
+ #endif
1018
+ }
1019
+
1020
+ static inline bool cpuinfo_has_x86_prefetchw(void) {
1021
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1022
+ return cpuinfo_isa.prefetchw;
1023
+ #else
1024
+ return false;
1025
+ #endif
1026
+ }
1027
+
1028
+ static inline bool cpuinfo_has_x86_prefetchwt1(void) {
1029
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1030
+ return cpuinfo_isa.prefetchwt1;
1031
+ #else
1032
+ return false;
1033
+ #endif
1034
+ }
1035
+
1036
+ static inline bool cpuinfo_has_x86_daz(void) {
1037
+ #if CPUINFO_ARCH_X86_64
1038
+ return true;
1039
+ #elif CPUINFO_ARCH_X86
1040
+ #if defined(__ANDROID__)
1041
+ return true;
1042
+ #else
1043
+ return cpuinfo_isa.daz;
1044
+ #endif
1045
+ #else
1046
+ return false;
1047
+ #endif
1048
+ }
1049
+
1050
+ static inline bool cpuinfo_has_x86_sse(void) {
1051
+ #if CPUINFO_ARCH_X86_64
1052
+ return true;
1053
+ #elif CPUINFO_ARCH_X86
1054
+ #if defined(__ANDROID__)
1055
+ return true;
1056
+ #else
1057
+ return cpuinfo_isa.sse;
1058
+ #endif
1059
+ #else
1060
+ return false;
1061
+ #endif
1062
+ }
1063
+
1064
+ static inline bool cpuinfo_has_x86_sse2(void) {
1065
+ #if CPUINFO_ARCH_X86_64
1066
+ return true;
1067
+ #elif CPUINFO_ARCH_X86
1068
+ #if defined(__ANDROID__)
1069
+ return true;
1070
+ #else
1071
+ return cpuinfo_isa.sse2;
1072
+ #endif
1073
+ #else
1074
+ return false;
1075
+ #endif
1076
+ }
1077
+
1078
+ static inline bool cpuinfo_has_x86_sse3(void) {
1079
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1080
+ #if defined(__ANDROID__)
1081
+ return true;
1082
+ #else
1083
+ return cpuinfo_isa.sse3;
1084
+ #endif
1085
+ #else
1086
+ return false;
1087
+ #endif
1088
+ }
1089
+
1090
+ static inline bool cpuinfo_has_x86_ssse3(void) {
1091
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1092
+ #if defined(__ANDROID__)
1093
+ return true;
1094
+ #else
1095
+ return cpuinfo_isa.ssse3;
1096
+ #endif
1097
+ #else
1098
+ return false;
1099
+ #endif
1100
+ }
1101
+
1102
+ static inline bool cpuinfo_has_x86_sse4_1(void) {
1103
+ #if CPUINFO_ARCH_X86_64
1104
+ #if defined(__ANDROID__)
1105
+ return true;
1106
+ #else
1107
+ return cpuinfo_isa.sse4_1;
1108
+ #endif
1109
+ #elif CPUINFO_ARCH_X86
1110
+ return cpuinfo_isa.sse4_1;
1111
+ #else
1112
+ return false;
1113
+ #endif
1114
+ }
1115
+
1116
+ static inline bool cpuinfo_has_x86_sse4_2(void) {
1117
+ #if CPUINFO_ARCH_X86_64
1118
+ #if defined(__ANDROID__)
1119
+ return true;
1120
+ #else
1121
+ return cpuinfo_isa.sse4_2;
1122
+ #endif
1123
+ #elif CPUINFO_ARCH_X86
1124
+ return cpuinfo_isa.sse4_2;
1125
+ #else
1126
+ return false;
1127
+ #endif
1128
+ }
1129
+
1130
+ static inline bool cpuinfo_has_x86_sse4a(void) {
1131
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1132
+ return cpuinfo_isa.sse4a;
1133
+ #else
1134
+ return false;
1135
+ #endif
1136
+ }
1137
+
1138
+ static inline bool cpuinfo_has_x86_misaligned_sse(void) {
1139
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1140
+ return cpuinfo_isa.misaligned_sse;
1141
+ #else
1142
+ return false;
1143
+ #endif
1144
+ }
1145
+
1146
+ static inline bool cpuinfo_has_x86_avx(void) {
1147
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1148
+ return cpuinfo_isa.avx;
1149
+ #else
1150
+ return false;
1151
+ #endif
1152
+ }
1153
+
1154
+ static inline bool cpuinfo_has_x86_avxvnni(void) {
1155
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1156
+ return cpuinfo_isa.avxvnni;
1157
+ #else
1158
+ return false;
1159
+ #endif
1160
+ }
1161
+
1162
+ static inline bool cpuinfo_has_x86_fma3(void) {
1163
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1164
+ return cpuinfo_isa.fma3;
1165
+ #else
1166
+ return false;
1167
+ #endif
1168
+ }
1169
+
1170
+ static inline bool cpuinfo_has_x86_fma4(void) {
1171
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1172
+ return cpuinfo_isa.fma4;
1173
+ #else
1174
+ return false;
1175
+ #endif
1176
+ }
1177
+
1178
+ static inline bool cpuinfo_has_x86_xop(void) {
1179
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1180
+ return cpuinfo_isa.xop;
1181
+ #else
1182
+ return false;
1183
+ #endif
1184
+ }
1185
+
1186
+ static inline bool cpuinfo_has_x86_f16c(void) {
1187
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1188
+ return cpuinfo_isa.f16c;
1189
+ #else
1190
+ return false;
1191
+ #endif
1192
+ }
1193
+
1194
+ static inline bool cpuinfo_has_x86_avx2(void) {
1195
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1196
+ return cpuinfo_isa.avx2;
1197
+ #else
1198
+ return false;
1199
+ #endif
1200
+ }
1201
+
1202
+ static inline bool cpuinfo_has_x86_avx512f(void) {
1203
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1204
+ return cpuinfo_isa.avx512f;
1205
+ #else
1206
+ return false;
1207
+ #endif
1208
+ }
1209
+
1210
+ static inline bool cpuinfo_has_x86_avx512pf(void) {
1211
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1212
+ return cpuinfo_isa.avx512pf;
1213
+ #else
1214
+ return false;
1215
+ #endif
1216
+ }
1217
+
1218
+ static inline bool cpuinfo_has_x86_avx512er(void) {
1219
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1220
+ return cpuinfo_isa.avx512er;
1221
+ #else
1222
+ return false;
1223
+ #endif
1224
+ }
1225
+
1226
+ static inline bool cpuinfo_has_x86_avx512cd(void) {
1227
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1228
+ return cpuinfo_isa.avx512cd;
1229
+ #else
1230
+ return false;
1231
+ #endif
1232
+ }
1233
+
1234
+ static inline bool cpuinfo_has_x86_avx512dq(void) {
1235
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1236
+ return cpuinfo_isa.avx512dq;
1237
+ #else
1238
+ return false;
1239
+ #endif
1240
+ }
1241
+
1242
+ static inline bool cpuinfo_has_x86_avx512bw(void) {
1243
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1244
+ return cpuinfo_isa.avx512bw;
1245
+ #else
1246
+ return false;
1247
+ #endif
1248
+ }
1249
+
1250
+ static inline bool cpuinfo_has_x86_avx512vl(void) {
1251
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1252
+ return cpuinfo_isa.avx512vl;
1253
+ #else
1254
+ return false;
1255
+ #endif
1256
+ }
1257
+
1258
+ static inline bool cpuinfo_has_x86_avx512ifma(void) {
1259
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1260
+ return cpuinfo_isa.avx512ifma;
1261
+ #else
1262
+ return false;
1263
+ #endif
1264
+ }
1265
+
1266
+ static inline bool cpuinfo_has_x86_avx512vbmi(void) {
1267
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1268
+ return cpuinfo_isa.avx512vbmi;
1269
+ #else
1270
+ return false;
1271
+ #endif
1272
+ }
1273
+
1274
+ static inline bool cpuinfo_has_x86_avx512vbmi2(void) {
1275
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1276
+ return cpuinfo_isa.avx512vbmi2;
1277
+ #else
1278
+ return false;
1279
+ #endif
1280
+ }
1281
+
1282
+ static inline bool cpuinfo_has_x86_avx512bitalg(void) {
1283
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1284
+ return cpuinfo_isa.avx512bitalg;
1285
+ #else
1286
+ return false;
1287
+ #endif
1288
+ }
1289
+
1290
+ static inline bool cpuinfo_has_x86_avx512vpopcntdq(void) {
1291
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1292
+ return cpuinfo_isa.avx512vpopcntdq;
1293
+ #else
1294
+ return false;
1295
+ #endif
1296
+ }
1297
+
1298
+ static inline bool cpuinfo_has_x86_avx512vnni(void) {
1299
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1300
+ return cpuinfo_isa.avx512vnni;
1301
+ #else
1302
+ return false;
1303
+ #endif
1304
+ }
1305
+
1306
+ static inline bool cpuinfo_has_x86_avx512bf16(void) {
1307
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1308
+ return cpuinfo_isa.avx512bf16;
1309
+ #else
1310
+ return false;
1311
+ #endif
1312
+ }
1313
+
1314
+ static inline bool cpuinfo_has_x86_avx512fp16(void) {
1315
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1316
+ return cpuinfo_isa.avx512fp16;
1317
+ #else
1318
+ return false;
1319
+ #endif
1320
+ }
1321
+
1322
+ static inline bool cpuinfo_has_x86_avx512vp2intersect(void) {
1323
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1324
+ return cpuinfo_isa.avx512vp2intersect;
1325
+ #else
1326
+ return false;
1327
+ #endif
1328
+ }
1329
+
1330
+ static inline bool cpuinfo_has_x86_avx512_4vnniw(void) {
1331
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1332
+ return cpuinfo_isa.avx512_4vnniw;
1333
+ #else
1334
+ return false;
1335
+ #endif
1336
+ }
1337
+
1338
+ static inline bool cpuinfo_has_x86_avx512_4fmaps(void) {
1339
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1340
+ return cpuinfo_isa.avx512_4fmaps;
1341
+ #else
1342
+ return false;
1343
+ #endif
1344
+ }
1345
+
1346
+ /* [NOTE] Intel Advanced Matrix Extensions (AMX) detection
1347
+ *
1348
+ * I. AMX is a new extensions to the x86 ISA to work on matrices, consists of
1349
+ * 1) 2-dimentional registers (tiles), hold sub-matrices from larger matrices
1350
+ * in memory 2) Accelerator called Tile Matrix Multiply (TMUL), contains
1351
+ * instructions operating on tiles
1352
+ *
1353
+ * II. Platforms that supports AMX:
1354
+ * +-----------------+-----+----------+----------+----------+----------+
1355
+ * | Platforms | Gen | amx-bf16 | amx-tile | amx-int8 | amx-fp16 |
1356
+ * +-----------------+-----+----------+----------+----------+----------+
1357
+ * | Sapphire Rapids | 4th | YES | YES | YES | NO |
1358
+ * +-----------------+-----+----------+----------+----------+----------+
1359
+ * | Emerald Rapids | 5th | YES | YES | YES | NO |
1360
+ * +-----------------+-----+----------+----------+----------+----------+
1361
+ * | Granite Rapids | 6th | YES | YES | YES | YES |
1362
+ * +-----------------+-----+----------+----------+----------+----------+
1363
+ *
1364
+ * Reference: https://www.intel.com/content/www/us/en/products/docs
1365
+ * /accelerator-engines/advanced-matrix-extensions/overview.html
1366
+ */
1367
+ static inline bool cpuinfo_has_x86_amx_bf16(void) {
1368
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1369
+ return cpuinfo_isa.amx_bf16;
1370
+ #else
1371
+ return false;
1372
+ #endif
1373
+ }
1374
+
1375
+ static inline bool cpuinfo_has_x86_amx_tile(void) {
1376
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1377
+ return cpuinfo_isa.amx_tile;
1378
+ #else
1379
+ return false;
1380
+ #endif
1381
+ }
1382
+
1383
+ static inline bool cpuinfo_has_x86_amx_int8(void) {
1384
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1385
+ return cpuinfo_isa.amx_int8;
1386
+ #else
1387
+ return false;
1388
+ #endif
1389
+ }
1390
+
1391
+ static inline bool cpuinfo_has_x86_amx_fp16(void) {
1392
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1393
+ return cpuinfo_isa.amx_fp16;
1394
+ #else
1395
+ return false;
1396
+ #endif
1397
+ }
1398
+
1399
+ /*
1400
+ * Intel AVX Vector Neural Network Instructions (VNNI) INT8
1401
+ * Supported Platfroms: Sierra Forest, Arrow Lake, Lunar Lake
1402
+ */
1403
+ static inline bool cpuinfo_has_x86_avx_vnni_int8(void) {
1404
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1405
+ return cpuinfo_isa.avx_vnni_int8;
1406
+ #else
1407
+ return false;
1408
+ #endif
1409
+ }
1410
+
1411
+ /*
1412
+ * Intel AVX Vector Neural Network Instructions (VNNI) INT16
1413
+ * Supported Platfroms: Arrow Lake, Lunar Lake
1414
+ */
1415
+ static inline bool cpuinfo_has_x86_avx_vnni_int16(void) {
1416
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1417
+ return cpuinfo_isa.avx_vnni_int16;
1418
+ #else
1419
+ return false;
1420
+ #endif
1421
+ }
1422
+
1423
+ /*
1424
+ * A new set of instructions, which can convert low precision floating point
1425
+ * like BF16/FP16 to high precision floating point FP32, as well as convert FP32
1426
+ * elements to BF16. This instruction allows the platform to have improved AI
1427
+ * capabilities and better compatibility.
1428
+ *
1429
+ * Supported Platforms: Sierra Forest, Arrow Lake, Lunar Lake
1430
+ */
1431
+ static inline bool cpuinfo_has_x86_avx_ne_convert(void) {
1432
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1433
+ return cpuinfo_isa.avx_ne_convert;
1434
+ #else
1435
+ return false;
1436
+ #endif
1437
+ }
1438
+
1439
+ static inline bool cpuinfo_has_x86_hle(void) {
1440
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1441
+ return cpuinfo_isa.hle;
1442
+ #else
1443
+ return false;
1444
+ #endif
1445
+ }
1446
+
1447
+ static inline bool cpuinfo_has_x86_rtm(void) {
1448
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1449
+ return cpuinfo_isa.rtm;
1450
+ #else
1451
+ return false;
1452
+ #endif
1453
+ }
1454
+
1455
+ static inline bool cpuinfo_has_x86_xtest(void) {
1456
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1457
+ return cpuinfo_isa.xtest;
1458
+ #else
1459
+ return false;
1460
+ #endif
1461
+ }
1462
+
1463
+ static inline bool cpuinfo_has_x86_mpx(void) {
1464
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1465
+ return cpuinfo_isa.mpx;
1466
+ #else
1467
+ return false;
1468
+ #endif
1469
+ }
1470
+
1471
+ static inline bool cpuinfo_has_x86_cmov(void) {
1472
+ #if CPUINFO_ARCH_X86_64
1473
+ return true;
1474
+ #elif CPUINFO_ARCH_X86
1475
+ return cpuinfo_isa.cmov;
1476
+ #else
1477
+ return false;
1478
+ #endif
1479
+ }
1480
+
1481
+ static inline bool cpuinfo_has_x86_cmpxchg8b(void) {
1482
+ #if CPUINFO_ARCH_X86_64
1483
+ return true;
1484
+ #elif CPUINFO_ARCH_X86
1485
+ return cpuinfo_isa.cmpxchg8b;
1486
+ #else
1487
+ return false;
1488
+ #endif
1489
+ }
1490
+
1491
+ static inline bool cpuinfo_has_x86_cmpxchg16b(void) {
1492
+ #if CPUINFO_ARCH_X86_64
1493
+ return cpuinfo_isa.cmpxchg16b;
1494
+ #else
1495
+ return false;
1496
+ #endif
1497
+ }
1498
+
1499
+ static inline bool cpuinfo_has_x86_clwb(void) {
1500
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1501
+ return cpuinfo_isa.clwb;
1502
+ #else
1503
+ return false;
1504
+ #endif
1505
+ }
1506
+
1507
+ static inline bool cpuinfo_has_x86_movbe(void) {
1508
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1509
+ return cpuinfo_isa.movbe;
1510
+ #else
1511
+ return false;
1512
+ #endif
1513
+ }
1514
+
1515
+ static inline bool cpuinfo_has_x86_lahf_sahf(void) {
1516
+ #if CPUINFO_ARCH_X86
1517
+ return true;
1518
+ #elif CPUINFO_ARCH_X86_64
1519
+ return cpuinfo_isa.lahf_sahf;
1520
+ #else
1521
+ return false;
1522
+ #endif
1523
+ }
1524
+
1525
+ static inline bool cpuinfo_has_x86_lzcnt(void) {
1526
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1527
+ return cpuinfo_isa.lzcnt;
1528
+ #else
1529
+ return false;
1530
+ #endif
1531
+ }
1532
+
1533
+ static inline bool cpuinfo_has_x86_popcnt(void) {
1534
+ #if CPUINFO_ARCH_X86_64
1535
+ #if defined(__ANDROID__)
1536
+ return true;
1537
+ #else
1538
+ return cpuinfo_isa.popcnt;
1539
+ #endif
1540
+ #elif CPUINFO_ARCH_X86
1541
+ return cpuinfo_isa.popcnt;
1542
+ #else
1543
+ return false;
1544
+ #endif
1545
+ }
1546
+
1547
+ static inline bool cpuinfo_has_x86_tbm(void) {
1548
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1549
+ return cpuinfo_isa.tbm;
1550
+ #else
1551
+ return false;
1552
+ #endif
1553
+ }
1554
+
1555
+ static inline bool cpuinfo_has_x86_bmi(void) {
1556
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1557
+ return cpuinfo_isa.bmi;
1558
+ #else
1559
+ return false;
1560
+ #endif
1561
+ }
1562
+
1563
+ static inline bool cpuinfo_has_x86_bmi2(void) {
1564
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1565
+ return cpuinfo_isa.bmi2;
1566
+ #else
1567
+ return false;
1568
+ #endif
1569
+ }
1570
+
1571
+ static inline bool cpuinfo_has_x86_adx(void) {
1572
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1573
+ return cpuinfo_isa.adx;
1574
+ #else
1575
+ return false;
1576
+ #endif
1577
+ }
1578
+
1579
+ static inline bool cpuinfo_has_x86_aes(void) {
1580
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1581
+ return cpuinfo_isa.aes;
1582
+ #else
1583
+ return false;
1584
+ #endif
1585
+ }
1586
+
1587
+ static inline bool cpuinfo_has_x86_vaes(void) {
1588
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1589
+ return cpuinfo_isa.vaes;
1590
+ #else
1591
+ return false;
1592
+ #endif
1593
+ }
1594
+
1595
+ static inline bool cpuinfo_has_x86_pclmulqdq(void) {
1596
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1597
+ return cpuinfo_isa.pclmulqdq;
1598
+ #else
1599
+ return false;
1600
+ #endif
1601
+ }
1602
+
1603
+ static inline bool cpuinfo_has_x86_vpclmulqdq(void) {
1604
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1605
+ return cpuinfo_isa.vpclmulqdq;
1606
+ #else
1607
+ return false;
1608
+ #endif
1609
+ }
1610
+
1611
+ static inline bool cpuinfo_has_x86_gfni(void) {
1612
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1613
+ return cpuinfo_isa.gfni;
1614
+ #else
1615
+ return false;
1616
+ #endif
1617
+ }
1618
+
1619
+ static inline bool cpuinfo_has_x86_rdrand(void) {
1620
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1621
+ return cpuinfo_isa.rdrand;
1622
+ #else
1623
+ return false;
1624
+ #endif
1625
+ }
1626
+
1627
+ static inline bool cpuinfo_has_x86_rdseed(void) {
1628
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1629
+ return cpuinfo_isa.rdseed;
1630
+ #else
1631
+ return false;
1632
+ #endif
1633
+ }
1634
+
1635
+ static inline bool cpuinfo_has_x86_sha(void) {
1636
+ #if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
1637
+ return cpuinfo_isa.sha;
1638
+ #else
1639
+ return false;
1640
+ #endif
1641
+ }
1642
+
1643
+ #if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
1644
+ /* This structure is not a part of stable API. Use cpuinfo_has_arm_* functions
1645
+ * instead. */
1646
+ struct cpuinfo_arm_isa {
1647
+ #if CPUINFO_ARCH_ARM
1648
+ bool thumb;
1649
+ bool thumb2;
1650
+ bool thumbee;
1651
+ bool jazelle;
1652
+ bool armv5e;
1653
+ bool armv6;
1654
+ bool armv6k;
1655
+ bool armv7;
1656
+ bool armv7mp;
1657
+ bool armv8;
1658
+ bool idiv;
1659
+
1660
+ bool vfpv2;
1661
+ bool vfpv3;
1662
+ bool d32;
1663
+ bool fp16;
1664
+ bool fma;
1665
+
1666
+ bool wmmx;
1667
+ bool wmmx2;
1668
+ bool neon;
1669
+ #endif
1670
+ #if CPUINFO_ARCH_ARM64
1671
+ bool atomics;
1672
+ bool bf16;
1673
+ bool sve;
1674
+ bool sve2;
1675
+ bool i8mm;
1676
+ bool sme;
1677
+ bool sme2;
1678
+ bool sme2p1;
1679
+ bool sme_i16i32;
1680
+ bool sme_bi32i32;
1681
+ bool sme_b16b16;
1682
+ bool sme_f16f16;
1683
+ uint32_t svelen;
1684
+ #endif
1685
+ bool rdm;
1686
+ bool fp16arith;
1687
+ bool dot;
1688
+ bool jscvt;
1689
+ bool fcma;
1690
+ bool fhm;
1691
+
1692
+ bool aes;
1693
+ bool sha1;
1694
+ bool sha2;
1695
+ bool pmull;
1696
+ bool crc32;
1697
+ };
1698
+
1699
+ extern struct cpuinfo_arm_isa cpuinfo_isa;
1700
+ #endif
1701
+
1702
+ static inline bool cpuinfo_has_arm_thumb(void) {
1703
+ #if CPUINFO_ARCH_ARM
1704
+ return cpuinfo_isa.thumb;
1705
+ #else
1706
+ return false;
1707
+ #endif
1708
+ }
1709
+
1710
+ static inline bool cpuinfo_has_arm_thumb2(void) {
1711
+ #if CPUINFO_ARCH_ARM
1712
+ return cpuinfo_isa.thumb2;
1713
+ #else
1714
+ return false;
1715
+ #endif
1716
+ }
1717
+
1718
+ static inline bool cpuinfo_has_arm_v5e(void) {
1719
+ #if CPUINFO_ARCH_ARM
1720
+ return cpuinfo_isa.armv5e;
1721
+ #else
1722
+ return false;
1723
+ #endif
1724
+ }
1725
+
1726
+ static inline bool cpuinfo_has_arm_v6(void) {
1727
+ #if CPUINFO_ARCH_ARM
1728
+ return cpuinfo_isa.armv6;
1729
+ #else
1730
+ return false;
1731
+ #endif
1732
+ }
1733
+
1734
+ static inline bool cpuinfo_has_arm_v6k(void) {
1735
+ #if CPUINFO_ARCH_ARM
1736
+ return cpuinfo_isa.armv6k;
1737
+ #else
1738
+ return false;
1739
+ #endif
1740
+ }
1741
+
1742
+ static inline bool cpuinfo_has_arm_v7(void) {
1743
+ #if CPUINFO_ARCH_ARM
1744
+ return cpuinfo_isa.armv7;
1745
+ #else
1746
+ return false;
1747
+ #endif
1748
+ }
1749
+
1750
+ static inline bool cpuinfo_has_arm_v7mp(void) {
1751
+ #if CPUINFO_ARCH_ARM
1752
+ return cpuinfo_isa.armv7mp;
1753
+ #else
1754
+ return false;
1755
+ #endif
1756
+ }
1757
+
1758
+ static inline bool cpuinfo_has_arm_v8(void) {
1759
+ #if CPUINFO_ARCH_ARM64
1760
+ return true;
1761
+ #elif CPUINFO_ARCH_ARM
1762
+ return cpuinfo_isa.armv8;
1763
+ #else
1764
+ return false;
1765
+ #endif
1766
+ }
1767
+
1768
+ static inline bool cpuinfo_has_arm_idiv(void) {
1769
+ #if CPUINFO_ARCH_ARM64
1770
+ return true;
1771
+ #elif CPUINFO_ARCH_ARM
1772
+ return cpuinfo_isa.idiv;
1773
+ #else
1774
+ return false;
1775
+ #endif
1776
+ }
1777
+
1778
+ static inline bool cpuinfo_has_arm_vfpv2(void) {
1779
+ #if CPUINFO_ARCH_ARM
1780
+ return cpuinfo_isa.vfpv2;
1781
+ #else
1782
+ return false;
1783
+ #endif
1784
+ }
1785
+
1786
+ static inline bool cpuinfo_has_arm_vfpv3(void) {
1787
+ #if CPUINFO_ARCH_ARM64
1788
+ return true;
1789
+ #elif CPUINFO_ARCH_ARM
1790
+ return cpuinfo_isa.vfpv3;
1791
+ #else
1792
+ return false;
1793
+ #endif
1794
+ }
1795
+
1796
+ static inline bool cpuinfo_has_arm_vfpv3_d32(void) {
1797
+ #if CPUINFO_ARCH_ARM64
1798
+ return true;
1799
+ #elif CPUINFO_ARCH_ARM
1800
+ return cpuinfo_isa.vfpv3 && cpuinfo_isa.d32;
1801
+ #else
1802
+ return false;
1803
+ #endif
1804
+ }
1805
+
1806
+ static inline bool cpuinfo_has_arm_vfpv3_fp16(void) {
1807
+ #if CPUINFO_ARCH_ARM64
1808
+ return true;
1809
+ #elif CPUINFO_ARCH_ARM
1810
+ return cpuinfo_isa.vfpv3 && cpuinfo_isa.fp16;
1811
+ #else
1812
+ return false;
1813
+ #endif
1814
+ }
1815
+
1816
+ static inline bool cpuinfo_has_arm_vfpv3_fp16_d32(void) {
1817
+ #if CPUINFO_ARCH_ARM64
1818
+ return true;
1819
+ #elif CPUINFO_ARCH_ARM
1820
+ return cpuinfo_isa.vfpv3 && cpuinfo_isa.fp16 && cpuinfo_isa.d32;
1821
+ #else
1822
+ return false;
1823
+ #endif
1824
+ }
1825
+
1826
+ static inline bool cpuinfo_has_arm_vfpv4(void) {
1827
+ #if CPUINFO_ARCH_ARM64
1828
+ return true;
1829
+ #elif CPUINFO_ARCH_ARM
1830
+ return cpuinfo_isa.vfpv3 && cpuinfo_isa.fma;
1831
+ #else
1832
+ return false;
1833
+ #endif
1834
+ }
1835
+
1836
+ static inline bool cpuinfo_has_arm_vfpv4_d32(void) {
1837
+ #if CPUINFO_ARCH_ARM64
1838
+ return true;
1839
+ #elif CPUINFO_ARCH_ARM
1840
+ return cpuinfo_isa.vfpv3 && cpuinfo_isa.fma && cpuinfo_isa.d32;
1841
+ #else
1842
+ return false;
1843
+ #endif
1844
+ }
1845
+
1846
+ static inline bool cpuinfo_has_arm_fp16_arith(void) {
1847
+ #if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
1848
+ return cpuinfo_isa.fp16arith;
1849
+ #else
1850
+ return false;
1851
+ #endif
1852
+ }
1853
+
1854
+ static inline bool cpuinfo_has_arm_bf16(void) {
1855
+ #if CPUINFO_ARCH_ARM64
1856
+ return cpuinfo_isa.bf16;
1857
+ #else
1858
+ return false;
1859
+ #endif
1860
+ }
1861
+
1862
+ static inline bool cpuinfo_has_arm_wmmx(void) {
1863
+ #if CPUINFO_ARCH_ARM
1864
+ return cpuinfo_isa.wmmx;
1865
+ #else
1866
+ return false;
1867
+ #endif
1868
+ }
1869
+
1870
+ static inline bool cpuinfo_has_arm_wmmx2(void) {
1871
+ #if CPUINFO_ARCH_ARM
1872
+ return cpuinfo_isa.wmmx2;
1873
+ #else
1874
+ return false;
1875
+ #endif
1876
+ }
1877
+
1878
+ static inline bool cpuinfo_has_arm_neon(void) {
1879
+ #if CPUINFO_ARCH_ARM64
1880
+ return true;
1881
+ #elif CPUINFO_ARCH_ARM
1882
+ return cpuinfo_isa.neon;
1883
+ #else
1884
+ return false;
1885
+ #endif
1886
+ }
1887
+
1888
+ static inline bool cpuinfo_has_arm_neon_fp16(void) {
1889
+ #if CPUINFO_ARCH_ARM64
1890
+ return true;
1891
+ #elif CPUINFO_ARCH_ARM
1892
+ return cpuinfo_isa.neon && cpuinfo_isa.fp16;
1893
+ #else
1894
+ return false;
1895
+ #endif
1896
+ }
1897
+
1898
+ static inline bool cpuinfo_has_arm_neon_fma(void) {
1899
+ #if CPUINFO_ARCH_ARM64
1900
+ return true;
1901
+ #elif CPUINFO_ARCH_ARM
1902
+ return cpuinfo_isa.neon && cpuinfo_isa.fma;
1903
+ #else
1904
+ return false;
1905
+ #endif
1906
+ }
1907
+
1908
+ static inline bool cpuinfo_has_arm_neon_v8(void) {
1909
+ #if CPUINFO_ARCH_ARM64
1910
+ return true;
1911
+ #elif CPUINFO_ARCH_ARM
1912
+ return cpuinfo_isa.neon && cpuinfo_isa.armv8;
1913
+ #else
1914
+ return false;
1915
+ #endif
1916
+ }
1917
+
1918
+ static inline bool cpuinfo_has_arm_atomics(void) {
1919
+ #if CPUINFO_ARCH_ARM64
1920
+ return cpuinfo_isa.atomics;
1921
+ #else
1922
+ return false;
1923
+ #endif
1924
+ }
1925
+
1926
+ static inline bool cpuinfo_has_arm_neon_rdm(void) {
1927
+ #if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
1928
+ return cpuinfo_isa.rdm;
1929
+ #else
1930
+ return false;
1931
+ #endif
1932
+ }
1933
+
1934
+ static inline bool cpuinfo_has_arm_neon_fp16_arith(void) {
1935
+ #if CPUINFO_ARCH_ARM
1936
+ return cpuinfo_isa.neon && cpuinfo_isa.fp16arith;
1937
+ #elif CPUINFO_ARCH_ARM64
1938
+ return cpuinfo_isa.fp16arith;
1939
+ #else
1940
+ return false;
1941
+ #endif
1942
+ }
1943
+
1944
+ static inline bool cpuinfo_has_arm_fhm(void) {
1945
+ #if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
1946
+ return cpuinfo_isa.fhm;
1947
+ #else
1948
+ return false;
1949
+ #endif
1950
+ }
1951
+
1952
+ static inline bool cpuinfo_has_arm_neon_dot(void) {
1953
+ #if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
1954
+ return cpuinfo_isa.dot;
1955
+ #else
1956
+ return false;
1957
+ #endif
1958
+ }
1959
+
1960
+ static inline bool cpuinfo_has_arm_neon_bf16(void) {
1961
+ #if CPUINFO_ARCH_ARM64
1962
+ return cpuinfo_isa.bf16;
1963
+ #else
1964
+ return false;
1965
+ #endif
1966
+ }
1967
+
1968
+ static inline bool cpuinfo_has_arm_jscvt(void) {
1969
+ #if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
1970
+ return cpuinfo_isa.jscvt;
1971
+ #else
1972
+ return false;
1973
+ #endif
1974
+ }
1975
+
1976
+ static inline bool cpuinfo_has_arm_fcma(void) {
1977
+ #if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
1978
+ return cpuinfo_isa.fcma;
1979
+ #else
1980
+ return false;
1981
+ #endif
1982
+ }
1983
+
1984
+ static inline bool cpuinfo_has_arm_i8mm(void) {
1985
+ #if CPUINFO_ARCH_ARM64
1986
+ return cpuinfo_isa.i8mm;
1987
+ #else
1988
+ return false;
1989
+ #endif
1990
+ }
1991
+
1992
+ static inline bool cpuinfo_has_arm_aes(void) {
1993
+ #if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
1994
+ return cpuinfo_isa.aes;
1995
+ #else
1996
+ return false;
1997
+ #endif
1998
+ }
1999
+
2000
+ static inline bool cpuinfo_has_arm_sha1(void) {
2001
+ #if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
2002
+ return cpuinfo_isa.sha1;
2003
+ #else
2004
+ return false;
2005
+ #endif
2006
+ }
2007
+
2008
+ static inline bool cpuinfo_has_arm_sha2(void) {
2009
+ #if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
2010
+ return cpuinfo_isa.sha2;
2011
+ #else
2012
+ return false;
2013
+ #endif
2014
+ }
2015
+
2016
+ static inline bool cpuinfo_has_arm_pmull(void) {
2017
+ #if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
2018
+ return cpuinfo_isa.pmull;
2019
+ #else
2020
+ return false;
2021
+ #endif
2022
+ }
2023
+
2024
+ static inline bool cpuinfo_has_arm_crc32(void) {
2025
+ #if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
2026
+ return cpuinfo_isa.crc32;
2027
+ #else
2028
+ return false;
2029
+ #endif
2030
+ }
2031
+
2032
+ static inline bool cpuinfo_has_arm_sve(void) {
2033
+ #if CPUINFO_ARCH_ARM64
2034
+ return cpuinfo_isa.sve;
2035
+ #else
2036
+ return false;
2037
+ #endif
2038
+ }
2039
+
2040
+ static inline bool cpuinfo_has_arm_sve_bf16(void) {
2041
+ #if CPUINFO_ARCH_ARM64
2042
+ return cpuinfo_isa.sve && cpuinfo_isa.bf16;
2043
+ #else
2044
+ return false;
2045
+ #endif
2046
+ }
2047
+
2048
+ static inline bool cpuinfo_has_arm_sve2(void) {
2049
+ #if CPUINFO_ARCH_ARM64
2050
+ return cpuinfo_isa.sve2;
2051
+ #else
2052
+ return false;
2053
+ #endif
2054
+ }
2055
+
2056
+ // Function to get the max SVE vector length on ARM CPU's which support SVE.
2057
+ static inline uint32_t cpuinfo_get_max_arm_sve_length(void) {
2058
+ #if CPUINFO_ARCH_ARM64
2059
+ return cpuinfo_isa.svelen * 8; // bytes * 8 = bit length(vector length)
2060
+ #else
2061
+ return 0;
2062
+ #endif
2063
+ }
2064
+
2065
+ static inline bool cpuinfo_has_arm_sme(void) {
2066
+ #if CPUINFO_ARCH_ARM64
2067
+ return cpuinfo_isa.sme;
2068
+ #else
2069
+ return false;
2070
+ #endif
2071
+ }
2072
+
2073
+ static inline bool cpuinfo_has_arm_sme2(void) {
2074
+ #if CPUINFO_ARCH_ARM64
2075
+ return cpuinfo_isa.sme2;
2076
+ #else
2077
+ return false;
2078
+ #endif
2079
+ }
2080
+
2081
+ static inline bool cpuinfo_has_arm_sme2p1(void) {
2082
+ #if CPUINFO_ARCH_ARM64
2083
+ return cpuinfo_isa.sme2p1;
2084
+ #else
2085
+ return false;
2086
+ #endif
2087
+ }
2088
+
2089
+ static inline bool cpuinfo_has_arm_sme_i16i32(void) {
2090
+ #if CPUINFO_ARCH_ARM64
2091
+ return cpuinfo_isa.sme_i16i32;
2092
+ #else
2093
+ return false;
2094
+ #endif
2095
+ }
2096
+
2097
+ static inline bool cpuinfo_has_arm_sme_bi32i32(void) {
2098
+ #if CPUINFO_ARCH_ARM64
2099
+ return cpuinfo_isa.sme_bi32i32;
2100
+ #else
2101
+ return false;
2102
+ #endif
2103
+ }
2104
+
2105
+ static inline bool cpuinfo_has_arm_sme_b16b16(void) {
2106
+ #if CPUINFO_ARCH_ARM64
2107
+ return cpuinfo_isa.sme_b16b16;
2108
+ #else
2109
+ return false;
2110
+ #endif
2111
+ }
2112
+
2113
+ static inline bool cpuinfo_has_arm_sme_f16f16(void) {
2114
+ #if CPUINFO_ARCH_ARM64
2115
+ return cpuinfo_isa.sme_f16f16;
2116
+ #else
2117
+ return false;
2118
+ #endif
2119
+ }
2120
+
2121
+ #if CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
2122
+ /* This structure is not a part of stable API. Use cpuinfo_has_riscv_* functions
2123
+ * instead. */
2124
+ struct cpuinfo_riscv_isa {
2125
+ /**
2126
+ * Keep fields in line with the canonical order as defined by
2127
+ * Section 27.11 Subset Naming Convention.
2128
+ */
2129
+ /* RV32I/64I/128I Base ISA. */
2130
+ bool i;
2131
+ #if CPUINFO_ARCH_RISCV32
2132
+ /* RV32E Base ISA. */
2133
+ bool e;
2134
+ #endif
2135
+ /* Integer Multiply/Divide Extension. */
2136
+ bool m;
2137
+ /* Atomic Extension. */
2138
+ bool a;
2139
+ /* Single-Precision Floating-Point Extension. */
2140
+ bool f;
2141
+ /* Double-Precision Floating-Point Extension. */
2142
+ bool d;
2143
+ /* Compressed Extension. */
2144
+ bool c;
2145
+ /* Vector Extension. */
2146
+ bool v;
2147
+ };
2148
+
2149
+ extern struct cpuinfo_riscv_isa cpuinfo_isa;
2150
+ #endif
2151
+
2152
+ static inline bool cpuinfo_has_riscv_i(void) {
2153
+ #if CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
2154
+ return cpuinfo_isa.i;
2155
+ #else
2156
+ return false;
2157
+ #endif
2158
+ }
2159
+
2160
+ static inline bool cpuinfo_has_riscv_e(void) {
2161
+ #if CPUINFO_ARCH_RISCV32
2162
+ return cpuinfo_isa.e;
2163
+ #else
2164
+ return false;
2165
+ #endif
2166
+ }
2167
+
2168
+ static inline bool cpuinfo_has_riscv_m(void) {
2169
+ #if CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
2170
+ return cpuinfo_isa.m;
2171
+ #else
2172
+ return false;
2173
+ #endif
2174
+ }
2175
+
2176
+ static inline bool cpuinfo_has_riscv_a(void) {
2177
+ #if CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
2178
+ return cpuinfo_isa.a;
2179
+ #else
2180
+ return false;
2181
+ #endif
2182
+ }
2183
+
2184
+ static inline bool cpuinfo_has_riscv_f(void) {
2185
+ #if CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
2186
+ return cpuinfo_isa.f;
2187
+ #else
2188
+ return false;
2189
+ #endif
2190
+ }
2191
+
2192
+ static inline bool cpuinfo_has_riscv_d(void) {
2193
+ #if CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
2194
+ return cpuinfo_isa.d;
2195
+ #else
2196
+ return false;
2197
+ #endif
2198
+ }
2199
+
2200
+ static inline bool cpuinfo_has_riscv_g(void) {
2201
+ // The 'G' extension is simply shorthand for 'IMAFD'.
2202
+ return cpuinfo_has_riscv_i() && cpuinfo_has_riscv_m() &&
2203
+ cpuinfo_has_riscv_a() && cpuinfo_has_riscv_f() &&
2204
+ cpuinfo_has_riscv_d();
2205
+ }
2206
+
2207
+ static inline bool cpuinfo_has_riscv_c(void) {
2208
+ #if CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
2209
+ return cpuinfo_isa.c;
2210
+ #else
2211
+ return false;
2212
+ #endif
2213
+ }
2214
+
2215
+ static inline bool cpuinfo_has_riscv_v(void) {
2216
+ #if CPUINFO_ARCH_RISCV32 || CPUINFO_ARCH_RISCV64
2217
+ return cpuinfo_isa.v;
2218
+ #else
2219
+ return false;
2220
+ #endif
2221
+ }
2222
+
2223
+ const struct cpuinfo_processor *CPUINFO_ABI cpuinfo_get_processors(void);
2224
+ const struct cpuinfo_core *CPUINFO_ABI cpuinfo_get_cores(void);
2225
+ const struct cpuinfo_cluster *CPUINFO_ABI cpuinfo_get_clusters(void);
2226
+ const struct cpuinfo_package *CPUINFO_ABI cpuinfo_get_packages(void);
2227
+ const struct cpuinfo_uarch_info *CPUINFO_ABI cpuinfo_get_uarchs(void);
2228
+ const struct cpuinfo_cache *CPUINFO_ABI cpuinfo_get_l1i_caches(void);
2229
+ const struct cpuinfo_cache *CPUINFO_ABI cpuinfo_get_l1d_caches(void);
2230
+ const struct cpuinfo_cache *CPUINFO_ABI cpuinfo_get_l2_caches(void);
2231
+ const struct cpuinfo_cache *CPUINFO_ABI cpuinfo_get_l3_caches(void);
2232
+ const struct cpuinfo_cache *CPUINFO_ABI cpuinfo_get_l4_caches(void);
2233
+
2234
+ const struct cpuinfo_processor *CPUINFO_ABI
2235
+ cpuinfo_get_processor(uint32_t index);
2236
+ const struct cpuinfo_core *CPUINFO_ABI cpuinfo_get_core(uint32_t index);
2237
+ const struct cpuinfo_cluster *CPUINFO_ABI cpuinfo_get_cluster(uint32_t index);
2238
+ const struct cpuinfo_package *CPUINFO_ABI cpuinfo_get_package(uint32_t index);
2239
+ const struct cpuinfo_uarch_info *CPUINFO_ABI cpuinfo_get_uarch(uint32_t index);
2240
+ const struct cpuinfo_cache *CPUINFO_ABI cpuinfo_get_l1i_cache(uint32_t index);
2241
+ const struct cpuinfo_cache *CPUINFO_ABI cpuinfo_get_l1d_cache(uint32_t index);
2242
+ const struct cpuinfo_cache *CPUINFO_ABI cpuinfo_get_l2_cache(uint32_t index);
2243
+ const struct cpuinfo_cache *CPUINFO_ABI cpuinfo_get_l3_cache(uint32_t index);
2244
+ const struct cpuinfo_cache *CPUINFO_ABI cpuinfo_get_l4_cache(uint32_t index);
2245
+
2246
+ uint32_t CPUINFO_ABI cpuinfo_get_processors_count(void);
2247
+ uint32_t CPUINFO_ABI cpuinfo_get_cores_count(void);
2248
+ uint32_t CPUINFO_ABI cpuinfo_get_clusters_count(void);
2249
+ uint32_t CPUINFO_ABI cpuinfo_get_packages_count(void);
2250
+ uint32_t CPUINFO_ABI cpuinfo_get_uarchs_count(void);
2251
+ uint32_t CPUINFO_ABI cpuinfo_get_l1i_caches_count(void);
2252
+ uint32_t CPUINFO_ABI cpuinfo_get_l1d_caches_count(void);
2253
+ uint32_t CPUINFO_ABI cpuinfo_get_l2_caches_count(void);
2254
+ uint32_t CPUINFO_ABI cpuinfo_get_l3_caches_count(void);
2255
+ uint32_t CPUINFO_ABI cpuinfo_get_l4_caches_count(void);
2256
+
2257
+ /**
2258
+ * Returns upper bound on cache size.
2259
+ */
2260
+ uint32_t CPUINFO_ABI cpuinfo_get_max_cache_size(void);
2261
+
2262
+ /**
2263
+ * Identify the logical processor that executes the current thread.
2264
+ *
2265
+ * There is no guarantee that the thread will stay on the same logical processor
2266
+ * for any time. Callers should treat the result as only a hint, and be prepared
2267
+ * to handle NULL return value.
2268
+ */
2269
+ const struct cpuinfo_processor *CPUINFO_ABI cpuinfo_get_current_processor(void);
2270
+
2271
+ /**
2272
+ * Identify the core that executes the current thread.
2273
+ *
2274
+ * There is no guarantee that the thread will stay on the same core for any
2275
+ * time. Callers should treat the result as only a hint, and be prepared to
2276
+ * handle NULL return value.
2277
+ */
2278
+ const struct cpuinfo_core *CPUINFO_ABI cpuinfo_get_current_core(void);
2279
+
2280
+ /**
2281
+ * Identify the microarchitecture index of the core that executes the current
2282
+ * thread. If the system does not support such identification, the function
2283
+ * returns 0.
2284
+ *
2285
+ * There is no guarantee that the thread will stay on the same type of core for
2286
+ * any time. Callers should treat the result as only a hint.
2287
+ */
2288
+ uint32_t CPUINFO_ABI cpuinfo_get_current_uarch_index(void);
2289
+
2290
+ /**
2291
+ * Identify the microarchitecture index of the core that executes the current
2292
+ * thread. If the system does not support such identification, the function
2293
+ * returns the user-specified default value.
2294
+ *
2295
+ * There is no guarantee that the thread will stay on the same type of core for
2296
+ * any time. Callers should treat the result as only a hint.
2297
+ */
2298
+ uint32_t CPUINFO_ABI
2299
+ cpuinfo_get_current_uarch_index_with_default(uint32_t default_uarch_index);
2300
+
2301
+ #ifdef __cplusplus
2302
+ } /* extern "C" */
2303
+ #endif
2304
+
2305
+ #endif /* CPUINFO_H */