gstaichi 0.1.20.dev0__cp310-cp310-macosx_15_0_arm64.whl → 0.1.25.dev0__cp310-cp310-macosx_15_0_arm64.whl

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 (239) hide show
  1. {taichi → gstaichi}/__init__.py +9 -13
  2. {taichi → gstaichi}/_funcs.py +8 -8
  3. {taichi → gstaichi}/_kernels.py +19 -19
  4. gstaichi/_lib/__init__.py +3 -0
  5. taichi/_lib/core/taichi_python.cpython-310-darwin.so → gstaichi/_lib/core/gstaichi_python.cpython-310-darwin.so +0 -0
  6. taichi/_lib/core/taichi_python.pyi → gstaichi/_lib/core/gstaichi_python.pyi +382 -520
  7. {taichi → gstaichi}/_lib/runtime/runtime_arm64.bc +0 -0
  8. {taichi → gstaichi}/_lib/utils.py +15 -15
  9. {taichi → gstaichi}/_logging.py +1 -1
  10. {taichi → gstaichi}/_main.py +24 -31
  11. gstaichi/_snode/__init__.py +5 -0
  12. {taichi → gstaichi}/_snode/fields_builder.py +27 -29
  13. {taichi → gstaichi}/_snode/snode_tree.py +5 -5
  14. gstaichi/_test_tools/__init__.py +0 -0
  15. gstaichi/_test_tools/load_kernel_string.py +30 -0
  16. gstaichi/_version.py +1 -0
  17. {taichi → gstaichi}/_version_check.py +8 -5
  18. gstaichi/ad/__init__.py +3 -0
  19. {taichi → gstaichi}/ad/_ad.py +26 -26
  20. {taichi → gstaichi}/algorithms/_algorithms.py +7 -7
  21. {taichi → gstaichi}/examples/minimal.py +1 -1
  22. {taichi → gstaichi}/experimental.py +1 -1
  23. gstaichi/lang/__init__.py +50 -0
  24. {taichi → gstaichi}/lang/_ndarray.py +30 -26
  25. {taichi → gstaichi}/lang/_ndrange.py +8 -8
  26. gstaichi/lang/_template_mapper.py +199 -0
  27. {taichi → gstaichi}/lang/_texture.py +19 -19
  28. {taichi → gstaichi}/lang/_wrap_inspect.py +7 -7
  29. {taichi → gstaichi}/lang/any_array.py +13 -13
  30. {taichi → gstaichi}/lang/argpack.py +29 -29
  31. gstaichi/lang/ast/__init__.py +5 -0
  32. {taichi → gstaichi}/lang/ast/ast_transformer.py +94 -582
  33. {taichi → gstaichi}/lang/ast/ast_transformer_utils.py +54 -41
  34. gstaichi/lang/ast/ast_transformers/__init__.py +0 -0
  35. gstaichi/lang/ast/ast_transformers/call_transformer.py +267 -0
  36. gstaichi/lang/ast/ast_transformers/function_def_transformer.py +320 -0
  37. {taichi → gstaichi}/lang/ast/checkers.py +5 -5
  38. gstaichi/lang/ast/transform.py +9 -0
  39. {taichi → gstaichi}/lang/common_ops.py +12 -12
  40. gstaichi/lang/exception.py +80 -0
  41. {taichi → gstaichi}/lang/expr.py +22 -22
  42. {taichi → gstaichi}/lang/field.py +29 -27
  43. {taichi → gstaichi}/lang/impl.py +116 -121
  44. {taichi → gstaichi}/lang/kernel_arguments.py +16 -16
  45. {taichi → gstaichi}/lang/kernel_impl.py +330 -363
  46. {taichi → gstaichi}/lang/matrix.py +119 -115
  47. {taichi → gstaichi}/lang/matrix_ops.py +6 -6
  48. {taichi → gstaichi}/lang/matrix_ops_utils.py +4 -4
  49. {taichi → gstaichi}/lang/mesh.py +22 -22
  50. {taichi → gstaichi}/lang/misc.py +39 -68
  51. {taichi → gstaichi}/lang/ops.py +146 -141
  52. {taichi → gstaichi}/lang/runtime_ops.py +2 -2
  53. {taichi → gstaichi}/lang/shell.py +3 -3
  54. {taichi → gstaichi}/lang/simt/__init__.py +1 -1
  55. {taichi → gstaichi}/lang/simt/block.py +7 -7
  56. {taichi → gstaichi}/lang/simt/grid.py +1 -1
  57. {taichi → gstaichi}/lang/simt/subgroup.py +1 -1
  58. {taichi → gstaichi}/lang/simt/warp.py +1 -1
  59. {taichi → gstaichi}/lang/snode.py +46 -44
  60. {taichi → gstaichi}/lang/source_builder.py +13 -13
  61. {taichi → gstaichi}/lang/struct.py +33 -33
  62. {taichi → gstaichi}/lang/util.py +24 -24
  63. gstaichi/linalg/__init__.py +8 -0
  64. {taichi → gstaichi}/linalg/matrixfree_cg.py +14 -14
  65. {taichi → gstaichi}/linalg/sparse_cg.py +10 -10
  66. {taichi → gstaichi}/linalg/sparse_matrix.py +23 -23
  67. {taichi → gstaichi}/linalg/sparse_solver.py +21 -21
  68. {taichi → gstaichi}/math/__init__.py +1 -1
  69. {taichi → gstaichi}/math/_complex.py +21 -20
  70. {taichi → gstaichi}/math/mathimpl.py +56 -56
  71. gstaichi/profiler/__init__.py +6 -0
  72. {taichi → gstaichi}/profiler/kernel_metrics.py +11 -11
  73. {taichi → gstaichi}/profiler/kernel_profiler.py +30 -36
  74. {taichi → gstaichi}/profiler/memory_profiler.py +1 -1
  75. {taichi → gstaichi}/profiler/scoped_profiler.py +2 -2
  76. {taichi → gstaichi}/sparse/_sparse_grid.py +7 -7
  77. {taichi → gstaichi}/tools/__init__.py +4 -4
  78. {taichi → gstaichi}/tools/diagnose.py +10 -17
  79. gstaichi/types/__init__.py +19 -0
  80. {taichi → gstaichi}/types/annotations.py +1 -1
  81. {taichi → gstaichi}/types/compound_types.py +8 -8
  82. {taichi → gstaichi}/types/enums.py +1 -1
  83. {taichi → gstaichi}/types/ndarray_type.py +7 -7
  84. {taichi → gstaichi}/types/primitive_types.py +17 -14
  85. {taichi → gstaichi}/types/quant.py +9 -9
  86. {taichi → gstaichi}/types/texture_type.py +5 -5
  87. {taichi → gstaichi}/types/utils.py +1 -1
  88. {gstaichi-0.1.20.dev0.dist-info → gstaichi-0.1.25.dev0.dist-info}/METADATA +13 -16
  89. gstaichi-0.1.25.dev0.dist-info/RECORD +168 -0
  90. gstaichi-0.1.25.dev0.dist-info/entry_points.txt +2 -0
  91. gstaichi-0.1.25.dev0.dist-info/top_level.txt +1 -0
  92. gstaichi-0.1.20.dev0.dist-info/RECORD +0 -219
  93. gstaichi-0.1.20.dev0.dist-info/entry_points.txt +0 -2
  94. gstaichi-0.1.20.dev0.dist-info/top_level.txt +0 -1
  95. taichi/_lib/__init__.py +0 -3
  96. taichi/_lib/c_api/include/taichi/cpp/taichi.hpp +0 -1401
  97. taichi/_lib/c_api/include/taichi/taichi.h +0 -29
  98. taichi/_lib/c_api/include/taichi/taichi_core.h +0 -1111
  99. taichi/_lib/c_api/include/taichi/taichi_cpu.h +0 -29
  100. taichi/_lib/c_api/include/taichi/taichi_metal.h +0 -72
  101. taichi/_lib/c_api/include/taichi/taichi_platform.h +0 -55
  102. taichi/_lib/c_api/include/taichi/taichi_unity.h +0 -64
  103. taichi/_lib/c_api/include/taichi/taichi_vulkan.h +0 -151
  104. taichi/_lib/c_api/lib/libtaichi_c_api.dylib +0 -0
  105. taichi/_lib/c_api/runtime/runtime_arm64.bc +0 -0
  106. taichi/_lib/c_api/taichi/lib/cmake/taichi/TaichiConfig.cmake +0 -29
  107. taichi/_lib/c_api/taichi/lib/cmake/taichi/TaichiConfigVersion.cmake +0 -65
  108. taichi/_lib/c_api/taichi/lib/cmake/taichi/TaichiTargets.cmake +0 -121
  109. taichi/_lib/runtime/libMoltenVK.dylib +0 -0
  110. taichi/_snode/__init__.py +0 -5
  111. taichi/_ti_module/__init__.py +0 -3
  112. taichi/_ti_module/cppgen.py +0 -309
  113. taichi/_ti_module/module.py +0 -145
  114. taichi/_version.py +0 -1
  115. taichi/ad/__init__.py +0 -3
  116. taichi/aot/__init__.py +0 -12
  117. taichi/aot/_export.py +0 -28
  118. taichi/aot/conventions/__init__.py +0 -3
  119. taichi/aot/conventions/gfxruntime140/__init__.py +0 -38
  120. taichi/aot/conventions/gfxruntime140/dr.py +0 -244
  121. taichi/aot/conventions/gfxruntime140/sr.py +0 -613
  122. taichi/aot/module.py +0 -253
  123. taichi/aot/utils.py +0 -151
  124. taichi/graph/__init__.py +0 -3
  125. taichi/graph/_graph.py +0 -292
  126. taichi/lang/__init__.py +0 -50
  127. taichi/lang/ast/__init__.py +0 -5
  128. taichi/lang/ast/transform.py +0 -9
  129. taichi/lang/exception.py +0 -80
  130. taichi/linalg/__init__.py +0 -8
  131. taichi/profiler/__init__.py +0 -6
  132. taichi/shaders/Circles_vk.frag +0 -29
  133. taichi/shaders/Circles_vk.vert +0 -45
  134. taichi/shaders/Circles_vk_frag.spv +0 -0
  135. taichi/shaders/Circles_vk_vert.spv +0 -0
  136. taichi/shaders/Lines_vk.frag +0 -9
  137. taichi/shaders/Lines_vk.vert +0 -11
  138. taichi/shaders/Lines_vk_frag.spv +0 -0
  139. taichi/shaders/Lines_vk_vert.spv +0 -0
  140. taichi/shaders/Mesh_vk.frag +0 -71
  141. taichi/shaders/Mesh_vk.vert +0 -68
  142. taichi/shaders/Mesh_vk_frag.spv +0 -0
  143. taichi/shaders/Mesh_vk_vert.spv +0 -0
  144. taichi/shaders/Particles_vk.frag +0 -95
  145. taichi/shaders/Particles_vk.vert +0 -73
  146. taichi/shaders/Particles_vk_frag.spv +0 -0
  147. taichi/shaders/Particles_vk_vert.spv +0 -0
  148. taichi/shaders/SceneLines2quad_vk_comp.spv +0 -0
  149. taichi/shaders/SceneLines_vk.frag +0 -9
  150. taichi/shaders/SceneLines_vk.vert +0 -12
  151. taichi/shaders/SceneLines_vk_frag.spv +0 -0
  152. taichi/shaders/SceneLines_vk_vert.spv +0 -0
  153. taichi/shaders/SetImage_vk.frag +0 -21
  154. taichi/shaders/SetImage_vk.vert +0 -15
  155. taichi/shaders/SetImage_vk_frag.spv +0 -0
  156. taichi/shaders/SetImage_vk_vert.spv +0 -0
  157. taichi/shaders/Triangles_vk.frag +0 -16
  158. taichi/shaders/Triangles_vk.vert +0 -29
  159. taichi/shaders/Triangles_vk_frag.spv +0 -0
  160. taichi/shaders/Triangles_vk_vert.spv +0 -0
  161. taichi/shaders/lines2quad_vk_comp.spv +0 -0
  162. taichi/types/__init__.py +0 -19
  163. {taichi → gstaichi}/__main__.py +0 -0
  164. {taichi → gstaichi}/_lib/core/__init__.py +0 -0
  165. {taichi → gstaichi}/_lib/core/py.typed +0 -0
  166. {taichi/_lib/c_api → gstaichi/_lib}/runtime/libMoltenVK.dylib +0 -0
  167. {taichi → gstaichi}/algorithms/__init__.py +0 -0
  168. {taichi → gstaichi}/assets/.git +0 -0
  169. {taichi → gstaichi}/assets/Go-Regular.ttf +0 -0
  170. {taichi → gstaichi}/assets/static/imgs/ti_gallery.png +0 -0
  171. {taichi → gstaichi}/lang/ast/symbol_resolver.py +0 -0
  172. {taichi → gstaichi}/sparse/__init__.py +0 -0
  173. {taichi → gstaichi}/tools/np2ply.py +0 -0
  174. {taichi → gstaichi}/tools/vtk.py +0 -0
  175. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/GLFW/glfw3.h +0 -0
  176. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/GLFW/glfw3native.h +0 -0
  177. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv-tools/instrument.hpp +0 -0
  178. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv-tools/libspirv.h +0 -0
  179. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv-tools/libspirv.hpp +0 -0
  180. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv-tools/linker.hpp +0 -0
  181. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv-tools/optimizer.hpp +0 -0
  182. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv_cross/GLSL.std.450.h +0 -0
  183. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv_cross/spirv.h +0 -0
  184. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv_cross/spirv.hpp +0 -0
  185. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv_cross/spirv_cfg.hpp +0 -0
  186. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv_cross/spirv_common.hpp +0 -0
  187. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv_cross/spirv_cpp.hpp +0 -0
  188. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv_cross/spirv_cross.hpp +0 -0
  189. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv_cross/spirv_cross_c.h +0 -0
  190. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv_cross/spirv_cross_containers.hpp +0 -0
  191. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv_cross/spirv_cross_error_handling.hpp +0 -0
  192. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv_cross/spirv_cross_parsed_ir.hpp +0 -0
  193. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv_cross/spirv_cross_util.hpp +0 -0
  194. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv_cross/spirv_glsl.hpp +0 -0
  195. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv_cross/spirv_hlsl.hpp +0 -0
  196. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv_cross/spirv_msl.hpp +0 -0
  197. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv_cross/spirv_parser.hpp +0 -0
  198. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv_cross/spirv_reflect.hpp +0 -0
  199. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/SPIRV-Tools/SPIRV-ToolsConfig.cmake +0 -0
  200. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/SPIRV-Tools/SPIRV-ToolsTarget-release.cmake +0 -0
  201. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/SPIRV-Tools/SPIRV-ToolsTarget.cmake +0 -0
  202. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/SPIRV-Tools-diff/SPIRV-Tools-diffConfig.cmake +0 -0
  203. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/SPIRV-Tools-diff/SPIRV-Tools-diffTargets-release.cmake +0 -0
  204. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/SPIRV-Tools-diff/SPIRV-Tools-diffTargets.cmake +0 -0
  205. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/SPIRV-Tools-link/SPIRV-Tools-linkConfig.cmake +0 -0
  206. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/SPIRV-Tools-link/SPIRV-Tools-linkTargets-release.cmake +0 -0
  207. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/SPIRV-Tools-link/SPIRV-Tools-linkTargets.cmake +0 -0
  208. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/SPIRV-Tools-lint/SPIRV-Tools-lintConfig.cmake +0 -0
  209. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/SPIRV-Tools-lint/SPIRV-Tools-lintTargets-release.cmake +0 -0
  210. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/SPIRV-Tools-lint/SPIRV-Tools-lintTargets.cmake +0 -0
  211. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/SPIRV-Tools-opt/SPIRV-Tools-optConfig.cmake +0 -0
  212. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/SPIRV-Tools-opt/SPIRV-Tools-optTargets-release.cmake +0 -0
  213. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/SPIRV-Tools-opt/SPIRV-Tools-optTargets.cmake +0 -0
  214. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/SPIRV-Tools-reduce/SPIRV-Tools-reduceConfig.cmake +0 -0
  215. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/SPIRV-Tools-reduce/SPIRV-Tools-reduceTarget-release.cmake +0 -0
  216. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/SPIRV-Tools-reduce/SPIRV-Tools-reduceTarget.cmake +0 -0
  217. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/glfw3/glfw3Config.cmake +0 -0
  218. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/glfw3/glfw3ConfigVersion.cmake +0 -0
  219. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/glfw3/glfw3Targets-release.cmake +0 -0
  220. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/cmake/glfw3/glfw3Targets.cmake +0 -0
  221. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/libSPIRV-Tools-shared.dylib +0 -0
  222. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/share/spirv_cross_c/cmake/spirv_cross_cConfig-release.cmake +0 -0
  223. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/share/spirv_cross_c/cmake/spirv_cross_cConfig.cmake +0 -0
  224. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/share/spirv_cross_core/cmake/spirv_cross_coreConfig-release.cmake +0 -0
  225. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/share/spirv_cross_core/cmake/spirv_cross_coreConfig.cmake +0 -0
  226. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/share/spirv_cross_cpp/cmake/spirv_cross_cppConfig-release.cmake +0 -0
  227. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/share/spirv_cross_cpp/cmake/spirv_cross_cppConfig.cmake +0 -0
  228. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/share/spirv_cross_glsl/cmake/spirv_cross_glslConfig-release.cmake +0 -0
  229. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/share/spirv_cross_glsl/cmake/spirv_cross_glslConfig.cmake +0 -0
  230. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/share/spirv_cross_hlsl/cmake/spirv_cross_hlslConfig-release.cmake +0 -0
  231. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/share/spirv_cross_hlsl/cmake/spirv_cross_hlslConfig.cmake +0 -0
  232. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/share/spirv_cross_msl/cmake/spirv_cross_mslConfig-release.cmake +0 -0
  233. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/share/spirv_cross_msl/cmake/spirv_cross_mslConfig.cmake +0 -0
  234. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/share/spirv_cross_reflect/cmake/spirv_cross_reflectConfig-release.cmake +0 -0
  235. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/share/spirv_cross_reflect/cmake/spirv_cross_reflectConfig.cmake +0 -0
  236. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/share/spirv_cross_util/cmake/spirv_cross_utilConfig-release.cmake +0 -0
  237. {gstaichi-0.1.20.dev0.data → gstaichi-0.1.25.dev0.data}/data/share/spirv_cross_util/cmake/spirv_cross_utilConfig.cmake +0 -0
  238. {gstaichi-0.1.20.dev0.dist-info → gstaichi-0.1.25.dev0.dist-info}/WHEEL +0 -0
  239. {gstaichi-0.1.20.dev0.dist-info → gstaichi-0.1.25.dev0.dist-info}/licenses/LICENSE +0 -0
@@ -45,11 +45,11 @@ def import_ti_python_core():
45
45
  pyddir = os.path.dirname(os.path.realpath(__file__))
46
46
  os.environ["PATH"] += os.pathsep + pyddir
47
47
  try:
48
- from taichi._lib.core import taichi_python as core # pylint: disable=C0415
48
+ from gstaichi._lib.core import gstaichi_python as core # pylint: disable=C0415
49
49
  except Exception as e:
50
50
  if isinstance(e, ImportError):
51
51
  print(
52
- Fore.YELLOW + "Share object taichi_python import failed, "
52
+ Fore.YELLOW + "Share object gstaichi_python import failed, "
53
53
  "check this page for possible solutions:\n"
54
54
  "https://docs.taichi-lang.org/docs/install" + Fore.RESET
55
55
  )
@@ -89,7 +89,7 @@ package_root = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__f
89
89
 
90
90
  def get_core_shared_object():
91
91
  directory = os.path.join(package_root, "_lib")
92
- return os.path.join(directory, "libtaichi_python.so")
92
+ return os.path.join(directory, "libgstaichi_python.so")
93
93
 
94
94
 
95
95
  def print_red_bold(*args, **kwargs):
@@ -120,11 +120,11 @@ if log_level:
120
120
 
121
121
  def get_dll_name(name):
122
122
  if get_os_name() == "linux":
123
- return f"libtaichi_{name}.so"
123
+ return f"libgstaichi_{name}.so"
124
124
  if get_os_name() == "osx":
125
- return f"libtaichi_{name}.dylib"
125
+ return f"libgstaichi_{name}.dylib"
126
126
  if get_os_name() == "win":
127
- return f"taichi_{name}.dll"
127
+ return f"gstaichi_{name}.dll"
128
128
  raise Exception(f"Unknown OS: {get_os_name()}")
129
129
 
130
130
 
@@ -141,8 +141,8 @@ def compare_version(latest, current):
141
141
  return tuple(latest_num) > tuple(current_num)
142
142
 
143
143
 
144
- def _print_taichi_header():
145
- header = "[Taichi] "
144
+ def _print_gstaichi_header():
145
+ header = "[GsTaichi] "
146
146
  header += f"version {ti_python_core.get_version_string()}, "
147
147
 
148
148
  try:
@@ -171,8 +171,8 @@ def _print_taichi_header():
171
171
  print(header)
172
172
 
173
173
 
174
- if os.getenv("ENABLE_TAICHI_HEADER_PRINT", "True").lower() not in ("false", "0", "f"):
175
- _print_taichi_header()
174
+ if os.getenv("ENABLE_GSTAICHI_HEADER_PRINT", "True").lower() not in ("false", "0", "f"):
175
+ _print_gstaichi_header()
176
176
 
177
177
 
178
178
  def try_get_wheel_tag(module):
@@ -218,28 +218,28 @@ def warn_restricted_version():
218
218
 
219
219
  if get_os_name() == "linux":
220
220
  try:
221
- import taichi as ti # pylint: disable=import-outside-toplevel
221
+ import gstaichi as ti # pylint: disable=import-outside-toplevel
222
222
 
223
223
  wheel_tag = try_get_wheel_tag(ti)
224
224
  if wheel_tag and "manylinux2014" in wheel_tag:
225
225
  print_yellow_bold(
226
- "You have installed a restricted version of taichi, certain features (e.g. Vulkan & GGUI) will not work."
226
+ "You have installed a restricted version of gstaichi, certain features (e.g. Vulkan & GGUI) will not work."
227
227
  )
228
228
  libc_ver = try_get_loaded_libc_version()
229
229
  if libc_ver and libc_ver < (2, 27):
230
230
  print_yellow_bold(
231
- "!! Taichi requires glibc >= 2.27 to run, please try upgrading your OS to a recent one (e.g. Ubuntu 18.04 or later) if possible."
231
+ "!! GsTaichi requires glibc >= 2.27 to run, please try upgrading your OS to a recent one (e.g. Ubuntu 18.04 or later) if possible."
232
232
  )
233
233
 
234
234
  pip_ver = try_get_pip_version()
235
235
  if pip_ver and pip_ver < (20, 3, 0):
236
236
  print_yellow_bold(
237
237
  f"!! Your pip (version {'.'.join(map(str, pip_ver))}) is outdated (20.3.0 or later required), "
238
- "try upgrading pip and install taichi again."
238
+ "try upgrading pip and install gstaichi again."
239
239
  )
240
240
  print()
241
241
  print_yellow_bold(" $ python3 -m pip install --upgrade pip")
242
- print_yellow_bold(" $ python3 -m pip install --force-reinstall taichi")
242
+ print_yellow_bold(" $ python3 -m pip install --force-reinstall gstaichi")
243
243
  print()
244
244
 
245
245
  print_yellow_bold(
@@ -3,7 +3,7 @@
3
3
  import inspect
4
4
  import os
5
5
 
6
- from taichi._lib import core as ti_python_core
6
+ from gstaichi._lib import core as ti_python_core
7
7
 
8
8
 
9
9
  def _get_logging(name):
@@ -16,10 +16,10 @@ import rich
16
16
  from colorama import Fore
17
17
  from rich.console import Console
18
18
 
19
- from taichi._lib import core as _ti_core
20
- from taichi._lib import utils
21
- from taichi.lang import impl
22
- from taichi.tools import diagnose
19
+ from gstaichi._lib import core as _ti_core
20
+ from gstaichi._lib import utils
21
+ from gstaichi.lang import impl
22
+ from gstaichi.tools import diagnose
23
23
 
24
24
 
25
25
  def timer(func):
@@ -53,14 +53,14 @@ def register(func):
53
53
 
54
54
 
55
55
  @registerableCLI
56
- class TaichiMain:
56
+ class GsTaichiMain:
57
57
  def __init__(self, test_mode: bool = False):
58
- self.banner = f"\n{'*' * 43}\n** Taichi Programming Language **\n{'*' * 43}"
58
+ self.banner = f"\n{'*' * 43}\n** GsTaichi Programming Language **\n{'*' * 43}"
59
59
  print(self.banner)
60
60
 
61
61
  print(self._get_friend_links())
62
62
 
63
- parser = argparse.ArgumentParser(description="Taichi CLI", usage=self._usage())
63
+ parser = argparse.ArgumentParser(description="GsTaichi CLI", usage=self._usage())
64
64
  parser.add_argument("command", help="command from the above list to run")
65
65
 
66
66
  # Flag for unit testing
@@ -81,7 +81,7 @@ class TaichiMain:
81
81
  if args.command not in self.registered_commands: # pylint: disable=E1101
82
82
  # TODO: do we really need this?
83
83
  if args.command.endswith(".py"):
84
- TaichiMain._exec_python_file(args.command)
84
+ GsTaichiMain._exec_python_file(args.command)
85
85
  else:
86
86
  print(f"{args.command} is not a valid command!")
87
87
  self.main_parser.print_help()
@@ -94,8 +94,8 @@ class TaichiMain:
94
94
  return (
95
95
  "\n"
96
96
  "Docs: https://docs.taichi-lang.org/\n"
97
- "GitHub: https://github.com/taichi-dev/taichi/\n"
98
- "Forum: https://forum.taichi.graphics/\n"
97
+ "GitHub: https://github.com/taichi-dev/gstaichi/\n"
98
+ "Forum: https://forum.gstaichi.graphics/\n"
99
99
  )
100
100
 
101
101
  def _usage(self) -> str:
@@ -124,7 +124,7 @@ class TaichiMain:
124
124
  @staticmethod
125
125
  def _get_available_examples() -> set:
126
126
  """Get a set of all available example names."""
127
- examples_dir = TaichiMain._get_examples_dir()
127
+ examples_dir = GsTaichiMain._get_examples_dir()
128
128
  all_examples = examples_dir.rglob("*.py")
129
129
  all_example_names = {f.stem: f.parent for f in all_examples}
130
130
  return all_example_names
@@ -158,11 +158,11 @@ class TaichiMain:
158
158
  box=rich.box.HORIZONTALS,
159
159
  show_header=False,
160
160
  header_style="bold #2070b2",
161
- title="[bold][#3fdda4]TAICHI[#f8e020] EXAMPLES",
161
+ title="[bold][#3fdda4]GSTAICHI[#f8e020] EXAMPLES",
162
162
  )
163
163
 
164
164
  ncols = 3
165
- choices = TaichiMain._get_available_examples()
165
+ choices = GsTaichiMain._get_available_examples()
166
166
  nrows, rem = divmod(len(choices), ncols)
167
167
  if rem > 0:
168
168
  nrows += 1
@@ -173,7 +173,7 @@ class TaichiMain:
173
173
  parser = argparse.ArgumentParser(prog="ti example", description=f"{self.example.__doc__}")
174
174
  parser.add_argument(
175
175
  "name",
176
- type=TaichiMain._example_choices_type(choices.keys()),
176
+ type=GsTaichiMain._example_choices_type(choices.keys()),
177
177
  choices=sorted(choices.keys()),
178
178
  help=console.print(table),
179
179
  nargs="?",
@@ -208,7 +208,7 @@ class TaichiMain:
208
208
  # TODO: Pass the arguments to downstream correctly(#3216).
209
209
  args = parser.parse_args(arguments)
210
210
 
211
- examples_dir = TaichiMain._get_examples_dir()
211
+ examples_dir = GsTaichiMain._get_examples_dir()
212
212
  example_name = args.name
213
213
  if example_name is None:
214
214
  try:
@@ -382,9 +382,9 @@ class TaichiMain:
382
382
  if self.test_mode:
383
383
  return args
384
384
 
385
- baseline_dir = TaichiMain._get_benchmark_baseline_dir()
386
- output_dir = TaichiMain._get_benchmark_output_dir()
387
- TaichiMain._display_benchmark_regression(baseline_dir, output_dir, args)
385
+ baseline_dir = GsTaichiMain._get_benchmark_baseline_dir()
386
+ output_dir = GsTaichiMain._get_benchmark_output_dir()
387
+ GsTaichiMain._display_benchmark_regression(baseline_dir, output_dir, args)
388
388
 
389
389
  return None
390
390
 
@@ -398,8 +398,8 @@ class TaichiMain:
398
398
  if self.test_mode:
399
399
  return args
400
400
 
401
- baseline_dir = TaichiMain._get_benchmark_baseline_dir()
402
- output_dir = TaichiMain._get_benchmark_output_dir()
401
+ baseline_dir = GsTaichiMain._get_benchmark_baseline_dir()
402
+ output_dir = GsTaichiMain._get_benchmark_output_dir()
403
403
  shutil.rmtree(baseline_dir, True)
404
404
  shutil.copytree(output_dir, baseline_dir)
405
405
  print(f"[benchmark] baseline data saved to {baseline_dir}")
@@ -417,7 +417,7 @@ class TaichiMain:
417
417
  parser = argparse.ArgumentParser(prog="ti run", description=f"{self.run.__doc__}")
418
418
  parser.add_argument(
419
419
  "filename",
420
- help="A single (Python) script to run with Taichi, e.g. render.py",
420
+ help="A single (Python) script to run with GsTaichi, e.g. render.py",
421
421
  )
422
422
  args = parser.parse_args(arguments)
423
423
 
@@ -459,7 +459,7 @@ class TaichiMain:
459
459
  @staticmethod
460
460
  @register
461
461
  def repl(arguments: list = sys.argv[2:]):
462
- """Start Taichi REPL / Python shell with 'import taichi as ti'"""
462
+ """Start GsTaichi REPL / Python shell with 'import gstaichi as ti'"""
463
463
 
464
464
  def local_scope():
465
465
  try:
@@ -477,7 +477,7 @@ class TaichiMain:
477
477
  @staticmethod
478
478
  @register
479
479
  def lint(arguments: list = sys.argv[2:]):
480
- """Run pylint checker for the Python codebase of Taichi"""
480
+ """Run pylint checker for the Python codebase of GsTaichi"""
481
481
  # TODO: support arguments for lint specific files
482
482
  # parser = argparse.ArgumentParser(prog='ti lint', description=f"{self.lint.__doc__}")
483
483
  # args = parser.parse_args(arguments)
@@ -495,13 +495,6 @@ class TaichiMain:
495
495
 
496
496
  pylint.lint.Run(options)
497
497
 
498
- @register
499
- def module(self, arguments: list = sys.argv[2:]):
500
- """Taichi module tools"""
501
- from taichi import _ti_module # pylint: disable=C0415
502
-
503
- _ti_module._main(arguments)
504
-
505
498
  @staticmethod
506
499
  @register
507
500
  def cache(arguments: list = sys.argv[2:]):
@@ -544,7 +537,7 @@ class TaichiMain:
544
537
 
545
538
 
546
539
  def main():
547
- cli = TaichiMain()
540
+ cli = GsTaichiMain()
548
541
  return cli()
549
542
 
550
543
 
@@ -0,0 +1,5 @@
1
+ # type: ignore
2
+
3
+ from gstaichi._snode.fields_builder import FieldsBuilder
4
+
5
+ __all__ = ["FieldsBuilder"]
@@ -2,12 +2,12 @@
2
2
 
3
3
  from typing import Any, Optional, Sequence, Union
4
4
 
5
- from taichi._lib import core as _ti_core
6
- from taichi._lib.core.taichi_python import SNode as SNodeCxx
7
- from taichi._snode.snode_tree import SNodeTree
8
- from taichi.lang import impl, snode
9
- from taichi.lang.exception import TaichiRuntimeError
10
- from taichi.lang.util import warning
5
+ from gstaichi._lib import core as _ti_core
6
+ from gstaichi._lib.core.gstaichi_python import SNodeCxx
7
+ from gstaichi._snode.snode_tree import SNodeTree
8
+ from gstaichi.lang import impl, snode
9
+ from gstaichi.lang.exception import GsTaichiRuntimeError
10
+ from gstaichi.lang.util import warning
11
11
 
12
12
  _snode_registry = _ti_core.SNodeRegistry()
13
13
 
@@ -61,7 +61,7 @@ class FieldsBuilder:
61
61
 
62
62
  # TODO: move this to SNodeTree class.
63
63
  def deactivate_all(self):
64
- """Same as :func:`taichi.lang.snode.SNode.deactivate_all`"""
64
+ """Same as :func:`gstaichi.lang.snode.SNode.deactivate_all`"""
65
65
  if self.finalized:
66
66
  self.root.deactivate_all()
67
67
  else:
@@ -72,7 +72,7 @@ class FieldsBuilder:
72
72
  indices: Union[Sequence[_Axis], _Axis],
73
73
  dimensions: Union[Sequence[int], int],
74
74
  ):
75
- """Same as :func:`taichi.lang.snode.SNode.dense`"""
75
+ """Same as :func:`gstaichi.lang.snode.SNode.dense`"""
76
76
  self._check_not_finalized()
77
77
  self.empty = False
78
78
  return self.root.dense(indices, dimensions)
@@ -82,15 +82,15 @@ class FieldsBuilder:
82
82
  indices: Union[Sequence[_Axis], _Axis],
83
83
  dimensions: Union[Sequence[int], int],
84
84
  ):
85
- """Same as :func:`taichi.lang.snode.SNode.pointer`"""
85
+ """Same as :func:`gstaichi.lang.snode.SNode.pointer`"""
86
86
  if not _ti_core.is_extension_supported(impl.current_cfg().arch, _ti_core.Extension.sparse):
87
- raise TaichiRuntimeError("Pointer SNode is not supported on this backend.")
87
+ raise GsTaichiRuntimeError("Pointer SNode is not supported on this backend.")
88
88
  self._check_not_finalized()
89
89
  self.empty = False
90
90
  return self.root.pointer(indices, dimensions)
91
91
 
92
92
  def _hash(self, indices, dimensions):
93
- """Same as :func:`taichi.lang.snode.SNode.hash`"""
93
+ """Same as :func:`gstaichi.lang.snode.SNode.hash`"""
94
94
  raise NotImplementedError()
95
95
 
96
96
  def dynamic(
@@ -99,16 +99,16 @@ class FieldsBuilder:
99
99
  dimension: Union[Sequence[int], int],
100
100
  chunk_size: Optional[int] = None,
101
101
  ):
102
- """Same as :func:`taichi.lang.snode.SNode.dynamic`"""
102
+ """Same as :func:`gstaichi.lang.snode.SNode.dynamic`"""
103
103
  if not _ti_core.is_extension_supported(impl.current_cfg().arch, _ti_core.Extension.sparse):
104
- raise TaichiRuntimeError("Dynamic SNode is not supported on this backend.")
104
+ raise GsTaichiRuntimeError("Dynamic SNode is not supported on this backend.")
105
105
 
106
106
  if dimension >= 2**31:
107
- raise TaichiRuntimeError(
107
+ raise GsTaichiRuntimeError(
108
108
  f"The maximum dimension of a dynamic SNode cannot exceed the maximum value of a 32-bit signed integer: Got {dimension} > 2**31-1"
109
109
  )
110
110
  if chunk_size is not None and chunk_size >= 2**31:
111
- raise TaichiRuntimeError(
111
+ raise GsTaichiRuntimeError(
112
112
  f"Chunk size cannot exceed the maximum value of a 32-bit signed integer: Got {chunk_size} > 2**31-1"
113
113
  )
114
114
 
@@ -121,9 +121,9 @@ class FieldsBuilder:
121
121
  indices: Union[Sequence[_Axis], _Axis],
122
122
  dimensions: Union[Sequence[int], int],
123
123
  ):
124
- """Same as :func:`taichi.lang.snode.SNode.bitmasked`"""
124
+ """Same as :func:`gstaichi.lang.snode.SNode.bitmasked`"""
125
125
  if not _ti_core.is_extension_supported(impl.current_cfg().arch, _ti_core.Extension.sparse):
126
- raise TaichiRuntimeError("Bitmasked SNode is not supported on this backend.")
126
+ raise GsTaichiRuntimeError("Bitmasked SNode is not supported on this backend.")
127
127
  self._check_not_finalized()
128
128
  self.empty = False
129
129
  return self.root.bitmasked(indices, dimensions)
@@ -134,32 +134,32 @@ class FieldsBuilder:
134
134
  dimensions: Union[Sequence[int], int],
135
135
  max_num_bits: int,
136
136
  ):
137
- """Same as :func:`taichi.lang.snode.SNode.quant_array`"""
137
+ """Same as :func:`gstaichi.lang.snode.SNode.quant_array`"""
138
138
  self._check_not_finalized()
139
139
  self.empty = False
140
140
  return self.root.quant_array(indices, dimensions, max_num_bits)
141
141
 
142
142
  def place(self, *args: Any, offset: Optional[Union[Sequence[int], int]] = None):
143
- """Same as :func:`taichi.lang.snode.SNode.place`"""
143
+ """Same as :func:`gstaichi.lang.snode.SNode.place`"""
144
144
  self._check_not_finalized()
145
145
  self.empty = False
146
146
  self.root.place(*args, offset=offset)
147
147
 
148
148
  def lazy_grad(self):
149
- """Same as :func:`taichi.lang.snode.SNode.lazy_grad`"""
149
+ """Same as :func:`gstaichi.lang.snode.SNode.lazy_grad`"""
150
150
  # TODO: This complicates the implementation. Figure out why we need this
151
151
  self._check_not_finalized()
152
152
  self.empty = False
153
153
  self.root.lazy_grad()
154
154
 
155
155
  def _allocate_adjoint_checkbit(self):
156
- """Same as :func:`taichi.lang.snode.SNode._allocate_adjoint_checkbit`"""
156
+ """Same as :func:`gstaichi.lang.snode.SNode._allocate_adjoint_checkbit`"""
157
157
  self._check_not_finalized()
158
158
  self.empty = False
159
159
  self.root._allocate_adjoint_checkbit()
160
160
 
161
161
  def lazy_dual(self):
162
- """Same as :func:`taichi.lang.snode.SNode.lazy_dual`"""
162
+ """Same as :func:`gstaichi.lang.snode.SNode.lazy_dual`"""
163
163
  # TODO: This complicates the implementation. Figure out why we need this
164
164
  self._check_not_finalized()
165
165
  self.empty = False
@@ -172,18 +172,16 @@ class FieldsBuilder:
172
172
  raise_warning (bool): Raise warning or not."""
173
173
  return self._finalize(raise_warning, compile_only=False)
174
174
 
175
- def _finalize_for_aot(self):
176
- """Constructs the SNodeTree and compiles the type for AOT purpose."""
177
- return self._finalize(raise_warning=False, compile_only=True)
178
-
179
- def _finalize(self, raise_warning, compile_only):
175
+ def _finalize(self, raise_warning, compile_only) -> SNodeTree:
180
176
  self._check_not_finalized()
181
177
  if self.empty and raise_warning:
182
178
  warning("Finalizing an empty FieldsBuilder!")
183
179
  self.finalized = True
184
180
  impl.get_runtime().finalize_fields_builder(self)
185
- return SNodeTree(_ti_core.finalize_snode_tree(_snode_registry, self.ptr, impl.get_runtime().prog, compile_only))
181
+ return SNodeTree(
182
+ _ti_core.finalize_snode_tree(_snode_registry, self.ptr, impl.get_runtime()._prog, compile_only)
183
+ )
186
184
 
187
185
  def _check_not_finalized(self):
188
186
  if self.finalized:
189
- raise TaichiRuntimeError("FieldsBuilder finalized")
187
+ raise GsTaichiRuntimeError("FieldsBuilder finalized")
@@ -1,12 +1,12 @@
1
1
  # type: ignore
2
2
 
3
- # The reason we import just the taichi.core.util module, instead of the ti_python_core
3
+ # The reason we import just the gstaichi.core.util module, instead of the ti_python_core
4
4
  # object within it, is that ti_python_core is stateful. While in practice ti_python_core is
5
5
  # loaded during the import procedure, it's probably still good to delay the
6
6
  # access to it.
7
7
 
8
- from taichi.lang import impl
9
- from taichi.lang.exception import TaichiRuntimeError
8
+ from gstaichi.lang import impl
9
+ from gstaichi.lang.exception import GsTaichiRuntimeError
10
10
 
11
11
 
12
12
  class SNodeTree:
@@ -17,7 +17,7 @@ class SNodeTree:
17
17
 
18
18
  def destroy(self):
19
19
  if self.destroyed:
20
- raise TaichiRuntimeError("SNode tree has been destroyed")
20
+ raise GsTaichiRuntimeError("SNode tree has been destroyed")
21
21
  if self.prog != impl.get_runtime().prog:
22
22
  return
23
23
  self.ptr.destroy_snode_tree(impl.get_runtime().prog)
@@ -30,5 +30,5 @@ class SNodeTree:
30
30
  @property
31
31
  def id(self):
32
32
  if self.destroyed:
33
- raise TaichiRuntimeError("SNode tree has been destroyed")
33
+ raise GsTaichiRuntimeError("SNode tree has been destroyed")
34
34
  return self.ptr.id()
File without changes
@@ -0,0 +1,30 @@
1
+ import importlib.util
2
+ import sys
3
+ import tempfile
4
+ from contextlib import contextmanager
5
+ from pathlib import Path
6
+
7
+
8
+ def import_kernel_from_file(kernel_filepath: Path, kernel_name: str):
9
+ spec = importlib.util.spec_from_file_location(kernel_name, kernel_filepath)
10
+ assert spec is not None
11
+ module = importlib.util.module_from_spec(spec)
12
+ sys.modules[kernel_name] = module
13
+ loader = spec.loader
14
+ assert loader is not None
15
+ loader.exec_module(module)
16
+ return getattr(module, kernel_name)
17
+
18
+
19
+ @contextmanager
20
+ def load_kernel_from_string(kernel_str: str, kernel_name: str):
21
+ with tempfile.TemporaryDirectory() as temp_dir:
22
+ filepath = Path(temp_dir) / f"{kernel_name}.py"
23
+ with open(filepath, "w") as f:
24
+ f.write(kernel_str)
25
+ try:
26
+ kernel = import_kernel_from_file(kernel_filepath=filepath, kernel_name=kernel_name)
27
+ yield kernel
28
+ finally:
29
+ if kernel_name in sys.modules:
30
+ del sys.modules[kernel_name]
gstaichi/_version.py ADDED
@@ -0,0 +1 @@
1
+ __version__ = '0.1.25.dev0'
@@ -8,11 +8,11 @@ import threading
8
8
  import uuid
9
9
  from urllib import request
10
10
 
11
- from taichi._lib import core as _ti_core
11
+ from gstaichi._lib import core as _ti_core
12
12
 
13
13
 
14
14
  def check_version(cur_uuid):
15
- # Check Taichi version for the user.
15
+ # Check GsTaichi version for the user.
16
16
  major = _ti_core.get_version_major()
17
17
  minor = _ti_core.get_version_minor()
18
18
  patch = _ti_core.get_version_patch()
@@ -20,8 +20,11 @@ def check_version(cur_uuid):
20
20
  payload = {"version": version, "platform": "", "python": ""}
21
21
 
22
22
  system = platform.system()
23
- if system == "Linux":
23
+ u = platform.uname()
24
+ if (u.system, u.machine) == ("Linux", "x86_64"):
24
25
  payload["platform"] = "manylinux_2_27_x86_64"
26
+ elif (u.system, u.machine) in (("Linux", "arm64"), ("Linux", "aarch64")):
27
+ payload["platform"] = "manylinux_2_27_aarch64"
25
28
  elif system == "Windows":
26
29
  payload["platform"] = "win_amd64"
27
30
  elif system == "Darwin":
@@ -38,11 +41,11 @@ def check_version(cur_uuid):
38
41
  payload["uuid"] = cur_uuid
39
42
  if os.getenv("TI_CI") == "1":
40
43
  payload["type"] = "CI"
41
- # We do not want request exceptions break users' usage of Taichi.
44
+ # We do not want request exceptions break users' usage of GsTaichi.
42
45
  try:
43
46
  payload = json.dumps(payload)
44
47
  payload = payload.encode()
45
- req = request.Request("https://metadata.taichi.graphics/check_version", method="POST")
48
+ req = request.Request("https://metadata.gstaichi.graphics/check_version", method="POST")
46
49
  req.add_header("Content-Type", "application/json")
47
50
  with request.urlopen(req, data=payload, timeout=5) as response:
48
51
  response = json.loads(response.read().decode("utf-8"))
@@ -0,0 +1,3 @@
1
+ # type: ignore
2
+
3
+ from gstaichi.ad._ad import *
@@ -1,6 +1,6 @@
1
1
  # type: ignore
2
2
 
3
- """Taichi automatic differentiation module.
3
+ """GsTaichi automatic differentiation module.
4
4
 
5
5
  This module supplies two decorators for users to customize their
6
6
  gradient computation task.
@@ -11,16 +11,16 @@ from functools import reduce
11
11
 
12
12
  import numpy as np
13
13
 
14
- import taichi.types.primitive_types as types
15
- from taichi import _snode
16
- from taichi.lang import impl
17
- from taichi.lang._ndarray import Ndarray
18
- from taichi.lang.expr import Expr
19
- from taichi.lang.field import Field, ScalarField
20
- from taichi.lang.kernel_impl import kernel
21
- from taichi.lang.snode import SNode
22
- from taichi.types import ndarray, template
23
- from taichi.types.enums import AutodiffMode, SNodeGradType
14
+ import gstaichi.types.primitive_types as types
15
+ from gstaichi import _snode
16
+ from gstaichi.lang import impl
17
+ from gstaichi.lang._ndarray import Ndarray
18
+ from gstaichi.lang.expr import Expr
19
+ from gstaichi.lang.field import Field, ScalarField
20
+ from gstaichi.lang.kernel_impl import kernel
21
+ from gstaichi.lang.snode import SNode
22
+ from gstaichi.types import ndarray, template
23
+ from gstaichi.types.enums import AutodiffMode, SNodeGradType
24
24
 
25
25
 
26
26
  class GradChecker:
@@ -140,19 +140,19 @@ def restore_all_fields(all_fields, backups):
140
140
 
141
141
  class Tape:
142
142
  def __init__(self, loss=None, clear_gradients=True, validation=False, grad_check=None):
143
- """A context manager for reverse mode autodiff :class:`~taichi.ad.Tape`. The
143
+ """A context manager for reverse mode autodiff :class:`~gstaichi.ad.Tape`. The
144
144
  context manager would catching all of the callings of functions that
145
- decorated by :func:`~taichi.lang.kernel_impl.kernel` or
146
- :func:`~taichi.ad.grad_replaced` under `with` statement, and calculate
145
+ decorated by :func:`~gstaichi.lang.kernel_impl.kernel` or
146
+ :func:`~gstaichi.ad.grad_replaced` under `with` statement, and calculate
147
147
  all the partial gradients of a given loss variable by calling all of the
148
148
  gradient function of the callings caught in reverse order while `with`
149
149
  statement ended.
150
150
 
151
- See also :func:`~taichi.lang.kernel_impl.kernel` and
152
- :func:`~taichi.ad.grad_replaced` for gradient functions.
151
+ See also :func:`~gstaichi.lang.kernel_impl.kernel` and
152
+ :func:`~gstaichi.ad.grad_replaced` for gradient functions.
153
153
 
154
154
  Args:
155
- loss(:class:`~taichi.lang.expr.Expr`): The loss field, which shape should be ().
155
+ loss(:class:`~gstaichi.lang.expr.Expr`): The loss field, which shape should be ().
156
156
  clear_gradients(Bool): Before `with` body start, clear all gradients or not.
157
157
  validation(Bool): Check whether the code inside the context manager is autodiff valid, e.g., agree with the global data access rule.
158
158
  grad_check(List[Field]): List of fields that need to check gradients.
@@ -293,7 +293,7 @@ def clear_all_gradients(gradient_type=SNodeGradType.ADJOINT):
293
293
 
294
294
  places = tuple(places)
295
295
  if places:
296
- from taichi._kernels import clear_gradients # pylint: disable=C0415
296
+ from gstaichi._kernels import clear_gradients # pylint: disable=C0415
297
297
 
298
298
  clear_gradients(places)
299
299
 
@@ -302,12 +302,12 @@ def clear_all_gradients(gradient_type=SNodeGradType.ADJOINT):
302
302
 
303
303
 
304
304
  def grad_replaced(func):
305
- """A decorator for python function to customize gradient with Taichi's autodiff
305
+ """A decorator for python function to customize gradient with GsTaichi's autodiff
306
306
  system, e.g. `ti.ad.Tape()` and `kernel.grad()`.
307
307
 
308
- This decorator forces Taichi's autodiff system to use a user-defined gradient
308
+ This decorator forces GsTaichi's autodiff system to use a user-defined gradient
309
309
  function for the decorated function. Its customized gradient must be decorated
310
- by :func:`~taichi.ad.grad_for`.
310
+ by :func:`~gstaichi.ad.grad_for`.
311
311
 
312
312
  Args:
313
313
  fn (Callable): The python function to be decorated.
@@ -353,10 +353,10 @@ def grad_replaced(func):
353
353
  def grad_for(primal):
354
354
  """Generates a decorator to decorate `primal`'s customized gradient function.
355
355
 
356
- See :func:`~taichi.lang.grad_replaced` for examples.
356
+ See :func:`~gstaichi.lang.grad_replaced` for examples.
357
357
 
358
358
  Args:
359
- primal (Callable): The primal function, must be decorated by :func:`~taichi.ad.grad_replaced`.
359
+ primal (Callable): The primal function, must be decorated by :func:`~gstaichi.ad.grad_replaced`.
360
360
 
361
361
  Returns:
362
362
  Callable: The decorator used to decorate customized gradient function."""
@@ -369,7 +369,7 @@ def grad_for(primal):
369
369
  raise RuntimeError(f"Primal function `{primal.__name__}` must be decorated by ti.ad.grad_replaced")
370
370
  if primal.grad is not None:
371
371
  raise RuntimeError(
372
- "Primal function must be a **python** function instead of a taichi kernel. Please wrap the taichi kernel in a @ti.ad.grad_replaced decorated python function instead."
372
+ "Primal function must be a **python** function instead of a gstaichi kernel. Please wrap the gstaichi kernel in a @ti.ad.grad_replaced decorated python function instead."
373
373
  )
374
374
  primal.grad = decorated
375
375
  return decorated
@@ -378,9 +378,9 @@ def grad_for(primal):
378
378
 
379
379
 
380
380
  def no_grad(func):
381
- """A decorator for python function to skip gradient calculation within Taichi's
381
+ """A decorator for python function to skip gradient calculation within GsTaichi's
382
382
  autodiff system, e.g. `ti.ad.Tape()` and `kernel.grad()`.
383
- This decorator forces Taichi's autodiff system to use an empty gradient function
383
+ This decorator forces GsTaichi's autodiff system to use an empty gradient function
384
384
  for the decorated function.
385
385
 
386
386
  Args: