gstaichi 0.1.23.dev0__cp310-cp310-macosx_15_0_arm64.whl → 1.0.1__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 (240) hide show
  1. gstaichi/CHANGELOG.md +6 -0
  2. gstaichi/__init__.py +40 -0
  3. {taichi → gstaichi}/_funcs.py +8 -8
  4. {taichi → gstaichi}/_kernels.py +19 -19
  5. gstaichi/_lib/__init__.py +3 -0
  6. taichi/_lib/core/taichi_python.cpython-310-darwin.so → gstaichi/_lib/core/gstaichi_python.cpython-310-darwin.so +0 -0
  7. taichi/_lib/core/taichi_python.pyi → gstaichi/_lib/core/gstaichi_python.pyi +382 -520
  8. {taichi → gstaichi}/_lib/runtime/runtime_arm64.bc +0 -0
  9. {taichi → gstaichi}/_lib/utils.py +15 -15
  10. {taichi → gstaichi}/_logging.py +1 -1
  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.23.dev0.dist-info → gstaichi-1.0.1.dist-info}/METADATA +13 -16
  89. gstaichi-1.0.1.dist-info/RECORD +166 -0
  90. gstaichi-1.0.1.dist-info/top_level.txt +1 -0
  91. gstaichi-0.1.23.dev0.dist-info/RECORD +0 -219
  92. gstaichi-0.1.23.dev0.dist-info/entry_points.txt +0 -2
  93. gstaichi-0.1.23.dev0.dist-info/top_level.txt +0 -1
  94. taichi/__init__.py +0 -44
  95. taichi/__main__.py +0 -5
  96. taichi/_lib/__init__.py +0 -3
  97. taichi/_lib/c_api/include/taichi/cpp/taichi.hpp +0 -1401
  98. taichi/_lib/c_api/include/taichi/taichi.h +0 -29
  99. taichi/_lib/c_api/include/taichi/taichi_core.h +0 -1111
  100. taichi/_lib/c_api/include/taichi/taichi_cpu.h +0 -29
  101. taichi/_lib/c_api/include/taichi/taichi_metal.h +0 -72
  102. taichi/_lib/c_api/include/taichi/taichi_platform.h +0 -55
  103. taichi/_lib/c_api/include/taichi/taichi_unity.h +0 -64
  104. taichi/_lib/c_api/include/taichi/taichi_vulkan.h +0 -151
  105. taichi/_lib/c_api/lib/libtaichi_c_api.dylib +0 -0
  106. taichi/_lib/c_api/runtime/runtime_arm64.bc +0 -0
  107. taichi/_lib/c_api/taichi/lib/cmake/taichi/TaichiConfig.cmake +0 -29
  108. taichi/_lib/c_api/taichi/lib/cmake/taichi/TaichiConfigVersion.cmake +0 -65
  109. taichi/_lib/c_api/taichi/lib/cmake/taichi/TaichiTargets.cmake +0 -121
  110. taichi/_lib/runtime/libMoltenVK.dylib +0 -0
  111. taichi/_main.py +0 -552
  112. taichi/_snode/__init__.py +0 -5
  113. taichi/_ti_module/__init__.py +0 -3
  114. taichi/_ti_module/cppgen.py +0 -309
  115. taichi/_ti_module/module.py +0 -145
  116. taichi/_version.py +0 -1
  117. taichi/ad/__init__.py +0 -3
  118. taichi/aot/__init__.py +0 -12
  119. taichi/aot/_export.py +0 -28
  120. taichi/aot/conventions/__init__.py +0 -3
  121. taichi/aot/conventions/gfxruntime140/__init__.py +0 -38
  122. taichi/aot/conventions/gfxruntime140/dr.py +0 -244
  123. taichi/aot/conventions/gfxruntime140/sr.py +0 -613
  124. taichi/aot/module.py +0 -253
  125. taichi/aot/utils.py +0 -151
  126. taichi/graph/__init__.py +0 -3
  127. taichi/graph/_graph.py +0 -292
  128. taichi/lang/__init__.py +0 -50
  129. taichi/lang/ast/__init__.py +0 -5
  130. taichi/lang/ast/transform.py +0 -9
  131. taichi/lang/exception.py +0 -80
  132. taichi/linalg/__init__.py +0 -8
  133. taichi/profiler/__init__.py +0 -6
  134. taichi/shaders/Circles_vk.frag +0 -29
  135. taichi/shaders/Circles_vk.vert +0 -45
  136. taichi/shaders/Circles_vk_frag.spv +0 -0
  137. taichi/shaders/Circles_vk_vert.spv +0 -0
  138. taichi/shaders/Lines_vk.frag +0 -9
  139. taichi/shaders/Lines_vk.vert +0 -11
  140. taichi/shaders/Lines_vk_frag.spv +0 -0
  141. taichi/shaders/Lines_vk_vert.spv +0 -0
  142. taichi/shaders/Mesh_vk.frag +0 -71
  143. taichi/shaders/Mesh_vk.vert +0 -68
  144. taichi/shaders/Mesh_vk_frag.spv +0 -0
  145. taichi/shaders/Mesh_vk_vert.spv +0 -0
  146. taichi/shaders/Particles_vk.frag +0 -95
  147. taichi/shaders/Particles_vk.vert +0 -73
  148. taichi/shaders/Particles_vk_frag.spv +0 -0
  149. taichi/shaders/Particles_vk_vert.spv +0 -0
  150. taichi/shaders/SceneLines2quad_vk_comp.spv +0 -0
  151. taichi/shaders/SceneLines_vk.frag +0 -9
  152. taichi/shaders/SceneLines_vk.vert +0 -12
  153. taichi/shaders/SceneLines_vk_frag.spv +0 -0
  154. taichi/shaders/SceneLines_vk_vert.spv +0 -0
  155. taichi/shaders/SetImage_vk.frag +0 -21
  156. taichi/shaders/SetImage_vk.vert +0 -15
  157. taichi/shaders/SetImage_vk_frag.spv +0 -0
  158. taichi/shaders/SetImage_vk_vert.spv +0 -0
  159. taichi/shaders/Triangles_vk.frag +0 -16
  160. taichi/shaders/Triangles_vk.vert +0 -29
  161. taichi/shaders/Triangles_vk_frag.spv +0 -0
  162. taichi/shaders/Triangles_vk_vert.spv +0 -0
  163. taichi/shaders/lines2quad_vk_comp.spv +0 -0
  164. taichi/types/__init__.py +0 -19
  165. {taichi → gstaichi}/_lib/core/__init__.py +0 -0
  166. {taichi → gstaichi}/_lib/core/py.typed +0 -0
  167. {taichi/_lib/c_api → gstaichi/_lib}/runtime/libMoltenVK.dylib +0 -0
  168. {taichi → gstaichi}/algorithms/__init__.py +0 -0
  169. {taichi → gstaichi}/assets/.git +0 -0
  170. {taichi → gstaichi}/assets/Go-Regular.ttf +0 -0
  171. {taichi → gstaichi}/assets/static/imgs/ti_gallery.png +0 -0
  172. {taichi → gstaichi}/lang/ast/symbol_resolver.py +0 -0
  173. {taichi → gstaichi}/sparse/__init__.py +0 -0
  174. {taichi → gstaichi}/tools/np2ply.py +0 -0
  175. {taichi → gstaichi}/tools/vtk.py +0 -0
  176. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/GLFW/glfw3.h +0 -0
  177. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/GLFW/glfw3native.h +0 -0
  178. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv-tools/instrument.hpp +0 -0
  179. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv-tools/libspirv.h +0 -0
  180. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv-tools/libspirv.hpp +0 -0
  181. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv-tools/linker.hpp +0 -0
  182. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv-tools/optimizer.hpp +0 -0
  183. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/GLSL.std.450.h +0 -0
  184. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv.h +0 -0
  185. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv.hpp +0 -0
  186. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_cfg.hpp +0 -0
  187. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_common.hpp +0 -0
  188. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_cpp.hpp +0 -0
  189. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_cross.hpp +0 -0
  190. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_cross_c.h +0 -0
  191. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_cross_containers.hpp +0 -0
  192. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_cross_error_handling.hpp +0 -0
  193. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_cross_parsed_ir.hpp +0 -0
  194. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_cross_util.hpp +0 -0
  195. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_glsl.hpp +0 -0
  196. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_hlsl.hpp +0 -0
  197. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_msl.hpp +0 -0
  198. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_parser.hpp +0 -0
  199. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_reflect.hpp +0 -0
  200. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools/SPIRV-ToolsConfig.cmake +0 -0
  201. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools/SPIRV-ToolsTarget-release.cmake +0 -0
  202. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools/SPIRV-ToolsTarget.cmake +0 -0
  203. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-diff/SPIRV-Tools-diffConfig.cmake +0 -0
  204. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-diff/SPIRV-Tools-diffTargets-release.cmake +0 -0
  205. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-diff/SPIRV-Tools-diffTargets.cmake +0 -0
  206. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-link/SPIRV-Tools-linkConfig.cmake +0 -0
  207. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-link/SPIRV-Tools-linkTargets-release.cmake +0 -0
  208. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-link/SPIRV-Tools-linkTargets.cmake +0 -0
  209. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-lint/SPIRV-Tools-lintConfig.cmake +0 -0
  210. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-lint/SPIRV-Tools-lintTargets-release.cmake +0 -0
  211. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-lint/SPIRV-Tools-lintTargets.cmake +0 -0
  212. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-opt/SPIRV-Tools-optConfig.cmake +0 -0
  213. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-opt/SPIRV-Tools-optTargets-release.cmake +0 -0
  214. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-opt/SPIRV-Tools-optTargets.cmake +0 -0
  215. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-reduce/SPIRV-Tools-reduceConfig.cmake +0 -0
  216. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-reduce/SPIRV-Tools-reduceTarget-release.cmake +0 -0
  217. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-reduce/SPIRV-Tools-reduceTarget.cmake +0 -0
  218. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/glfw3/glfw3Config.cmake +0 -0
  219. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/glfw3/glfw3ConfigVersion.cmake +0 -0
  220. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/glfw3/glfw3Targets-release.cmake +0 -0
  221. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/glfw3/glfw3Targets.cmake +0 -0
  222. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/libSPIRV-Tools-shared.dylib +0 -0
  223. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_c/cmake/spirv_cross_cConfig-release.cmake +0 -0
  224. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_c/cmake/spirv_cross_cConfig.cmake +0 -0
  225. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_core/cmake/spirv_cross_coreConfig-release.cmake +0 -0
  226. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_core/cmake/spirv_cross_coreConfig.cmake +0 -0
  227. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_cpp/cmake/spirv_cross_cppConfig-release.cmake +0 -0
  228. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_cpp/cmake/spirv_cross_cppConfig.cmake +0 -0
  229. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_glsl/cmake/spirv_cross_glslConfig-release.cmake +0 -0
  230. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_glsl/cmake/spirv_cross_glslConfig.cmake +0 -0
  231. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_hlsl/cmake/spirv_cross_hlslConfig-release.cmake +0 -0
  232. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_hlsl/cmake/spirv_cross_hlslConfig.cmake +0 -0
  233. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_msl/cmake/spirv_cross_mslConfig-release.cmake +0 -0
  234. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_msl/cmake/spirv_cross_mslConfig.cmake +0 -0
  235. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_reflect/cmake/spirv_cross_reflectConfig-release.cmake +0 -0
  236. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_reflect/cmake/spirv_cross_reflectConfig.cmake +0 -0
  237. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_util/cmake/spirv_cross_utilConfig-release.cmake +0 -0
  238. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_util/cmake/spirv_cross_utilConfig.cmake +0 -0
  239. {gstaichi-0.1.23.dev0.dist-info → gstaichi-1.0.1.dist-info}/WHEEL +0 -0
  240. {gstaichi-0.1.23.dev0.dist-info → gstaichi-1.0.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,10 +1,10 @@
1
1
  # type: ignore
2
2
 
3
- import taichi.lang.ops as ops_mod
4
- from taichi.lang.impl import static
5
- from taichi.lang.kernel_impl import func, pyfunc
6
- from taichi.lang.matrix import Matrix, Vector
7
- from taichi.lang.matrix_ops_utils import (
3
+ import gstaichi.lang.ops as ops_mod
4
+ from gstaichi.lang.impl import static
5
+ from gstaichi.lang.kernel_impl import func, pyfunc
6
+ from gstaichi.lang.matrix import Matrix, Vector
7
+ from gstaichi.lang.matrix_ops_utils import (
8
8
  arg_at,
9
9
  arg_foreach_check,
10
10
  assert_list,
@@ -18,7 +18,7 @@ from taichi.lang.matrix_ops_utils import (
18
18
  same_shapes,
19
19
  square_matrix,
20
20
  )
21
- from taichi.types.annotations import template
21
+ from gstaichi.types.annotations import template
22
22
 
23
23
 
24
24
  @preconditions(arg_at(0, assert_tensor))
@@ -2,9 +2,9 @@
2
2
 
3
3
  import functools
4
4
 
5
- from taichi.lang.exception import TaichiCompilationError
6
- from taichi.lang.expr import Expr
7
- from taichi.lang.matrix import Matrix
5
+ from gstaichi.lang.exception import GsTaichiCompilationError
6
+ from gstaichi.lang.expr import Expr
7
+ from gstaichi.lang.matrix import Matrix
8
8
 
9
9
 
10
10
  def do_check(checker_fns, *args, **kwargs):
@@ -21,7 +21,7 @@ def preconditions(*checker_funcs):
21
21
  def wrapper(*args, **kwargs):
22
22
  ok, msg = do_check(checker_funcs, *args, **kwargs)
23
23
  if not ok:
24
- raise TaichiCompilationError(msg)
24
+ raise GsTaichiCompilationError(msg)
25
25
  return func(*args, **kwargs)
26
26
 
27
27
  return wrapper
@@ -4,17 +4,17 @@ import json
4
4
 
5
5
  import numpy as np
6
6
 
7
- from taichi import lang
8
- from taichi._lib import core as _ti_core
9
- from taichi.lang import impl
10
- from taichi.lang.exception import TaichiSyntaxError
11
- from taichi.lang.field import Field, ScalarField
12
- from taichi.lang.matrix import Matrix, MatrixField
13
- from taichi.lang.struct import StructField
14
- from taichi.lang.util import python_scope
15
- from taichi.types import u16, u32
16
- from taichi.types.compound_types import CompoundType
17
- from taichi.types.enums import Layout
7
+ from gstaichi import lang
8
+ from gstaichi._lib import core as _ti_core
9
+ from gstaichi.lang import impl
10
+ from gstaichi.lang.exception import GsTaichiSyntaxError
11
+ from gstaichi.lang.field import Field, ScalarField
12
+ from gstaichi.lang.matrix import Matrix, MatrixField
13
+ from gstaichi.lang.struct import StructField
14
+ from gstaichi.lang.util import python_scope
15
+ from gstaichi.types import u16, u32
16
+ from gstaichi.types.compound_types import CompoundType
17
+ from gstaichi.types.enums import Layout
18
18
 
19
19
  MeshTopology = _ti_core.MeshTopology
20
20
  MeshElementType = _ti_core.MeshElementType
@@ -119,7 +119,7 @@ class MeshElementField:
119
119
  layout: ti.Layout.AoS/ti.Layout.SoA
120
120
 
121
121
  Example::
122
- >>> import meshtaichi_patcher as Patcher
122
+ >>> import meshgstaichi_patcher as Patcher
123
123
  >>> vec3 = ti.types.vector(3, ti.f32)
124
124
  >>> mesh = Patcher.load_mesh("bunny.obj", relations=['FV'])
125
125
  >>> mesh.faces.place({'area' : ti.f32}) # declares a mesh attribute `area` for each face element.
@@ -128,11 +128,11 @@ class MeshElementField:
128
128
 
129
129
  for key, dtype in members.items():
130
130
  if key in {"verts", "edges", "faces", "cells"}:
131
- raise TaichiSyntaxError(
132
- f"'{key}' cannot use as attribute name. It has been reserved as MeshTaichi's keyword."
131
+ raise GsTaichiSyntaxError(
132
+ f"'{key}' cannot use as attribute name. It has been reserved as MeshGsTaichi's keyword."
133
133
  )
134
134
  if key in self.attr_dict:
135
- raise TaichiSyntaxError(f"'{key}' has already use as attribute name.")
135
+ raise GsTaichiSyntaxError(f"'{key}' has already use as attribute name.")
136
136
 
137
137
  # init attr type
138
138
  self.attr_dict[key] = MeshAttrType(key, dtype, reorder, needs_grad)
@@ -269,8 +269,8 @@ class MeshElement:
269
269
  """
270
270
  for key, dtype in members.items():
271
271
  if key in {"verts", "edges", "faces", "cells"}:
272
- raise TaichiSyntaxError(
273
- f"'{key}' cannot use as attribute name. It has been reserved as MeshTaichi's keyword."
272
+ raise GsTaichiSyntaxError(
273
+ f"'{key}' cannot use as attribute name. It has been reserved as MeshGsTaichi's keyword."
274
274
  )
275
275
  self.attr_dict[key] = MeshAttrType(key, dtype, reorder, needs_grad)
276
276
 
@@ -318,7 +318,7 @@ class MeshInstance:
318
318
  """
319
319
  if hasattr(self, "_vert_position"):
320
320
  return self._vert_position
321
- raise TaichiSyntaxError("Position info is not in the file.")
321
+ raise GsTaichiSyntaxError("Position info is not in the file.")
322
322
 
323
323
  def set_owned_offset(self, element_type: MeshElementType, owned_offset: ScalarField):
324
324
  _ti_core.set_owned_offset(self.mesh_ptr, element_type, owned_offset.vars[0].ptr.snode())
@@ -443,7 +443,7 @@ class MeshMetadata:
443
443
  class MeshBuilder:
444
444
  def __init__(self):
445
445
  if not lang.misc.is_extension_supported(impl.current_cfg().arch, lang.extension.mesh):
446
- raise Exception("Backend " + str(impl.current_cfg().arch) + " doesn't support MeshTaichi extension")
446
+ raise Exception("Backend " + str(impl.current_cfg().arch) + " doesn't support MeshGsTaichi extension")
447
447
 
448
448
  self.verts = MeshElement(MeshElementType.Vertex, self)
449
449
  self.edges = MeshElement(MeshElementType.Edge, self)
@@ -501,11 +501,11 @@ class MeshBuilder:
501
501
  class Mesh:
502
502
  """The Mesh type class.
503
503
 
504
- MeshTaichi offers first-class support for triangular/tetrahedral meshes
504
+ MeshGsTaichi offers first-class support for triangular/tetrahedral meshes
505
505
  and allows efficient computation on these irregular data structures,
506
506
  only available for backends supporting `ti.extension.mesh`.
507
507
 
508
- See more details in https://github.com/taichi-dev/meshtaichi
508
+ See more details in https://github.com/taichi-dev/meshgstaichi
509
509
  """
510
510
 
511
511
  def __init__(self):
@@ -616,7 +616,7 @@ class MeshElementFieldProxy:
616
616
  ),
617
617
  )
618
618
  elif isinstance(attr, StructField):
619
- raise RuntimeError("MeshTaichi has not support StructField yet")
619
+ raise RuntimeError("MeshGsTaichi has not support StructField yet")
620
620
  else: # isinstance(attr, Field)
621
621
  var = attr._get_field_members()[0].ptr
622
622
  setattr(
@@ -1,22 +1,21 @@
1
1
  # type: ignore
2
2
 
3
3
  import atexit
4
- import functools
5
4
  import os
6
5
  import shutil
7
6
  import tempfile
8
7
  import warnings
9
8
  from copy import deepcopy as _deepcopy
10
9
 
11
- from taichi import _logging, _snode, _version_check
12
- from taichi._lib import core as _ti_core
13
- from taichi.lang import impl
14
- from taichi.lang.expr import Expr
15
- from taichi.lang.impl import axes, get_runtime
16
- from taichi.profiler.kernel_profiler import get_default_kernel_profiler
17
- from taichi.types.primitive_types import f32, f64, i32, i64
10
+ from gstaichi import _logging, _snode, _version_check
11
+ from gstaichi._lib import core as _ti_core
12
+ from gstaichi.lang import impl
13
+ from gstaichi.lang.expr import Expr
14
+ from gstaichi.lang.impl import axes, get_runtime
15
+ from gstaichi.profiler.kernel_profiler import get_default_kernel_profiler
16
+ from gstaichi.types.primitive_types import f32, f64, i32, i64
18
17
 
19
- warnings.filterwarnings("once", category=DeprecationWarning, module="taichi")
18
+ warnings.filterwarnings("once", category=DeprecationWarning, module="gstaichi")
20
19
 
21
20
  # ----------------------
22
21
  i = axes(0)
@@ -129,37 +128,17 @@ metal = _ti_core.metal
129
128
  """
130
129
  # ----------------------
131
130
 
132
- opengl = _ti_core.opengl
133
- """The OpenGL backend. OpenGL 4.3 required.
134
- """
135
- # ----------------------
136
-
137
- gles = _ti_core.gles
138
- """The OpenGL ES backend. OpenGL ES 3.1 required.
139
- """
140
- # ----------------------
141
-
142
131
  vulkan = _ti_core.vulkan
143
132
  """The Vulkan backend.
144
133
  """
145
134
  # ----------------------
146
135
 
147
- dx11 = _ti_core.dx11
148
- """The DX11 backend.
149
- """
150
- # ----------------------
151
-
152
- dx12 = _ti_core.dx12
153
- """The DX11 backend.
154
- """
155
- # ----------------------
156
-
157
- gpu = [cuda, metal, vulkan, opengl, dx11, dx12, gles, amdgpu]
136
+ gpu = [cuda, metal, vulkan, amdgpu]
158
137
  """A list of GPU backends supported on the current system.
159
- Currently contains 'cuda', 'metal', 'opengl', 'vulkan', 'dx11', 'dx12', 'gles', 'amdgpu'.
138
+ Currently contains 'cuda', 'metal', 'vulkan', 'amdgpu'.
160
139
 
161
- When this is used, Taichi automatically picks the matching GPU backend. If no
162
- GPU is detected, Taichi falls back to the CPU backend.
140
+ When this is used, GsTaichi automatically picks the matching GPU backend. If no
141
+ GPU is detected, GsTaichi falls back to the CPU backend.
163
142
  """
164
143
  # ----------------------
165
144
 
@@ -167,7 +146,7 @@ cpu = _ti_core.host_arch()
167
146
  """A list of CPU backends supported on the current system.
168
147
  Currently contains 'x64', 'x86_64', 'arm64'.
169
148
 
170
- When this is used, Taichi automatically picks the matching CPU backend.
149
+ When this is used, GsTaichi automatically picks the matching CPU backend.
171
150
  """
172
151
  # ----------------------
173
152
 
@@ -181,7 +160,7 @@ def timeline_save(fn):
181
160
 
182
161
 
183
162
  extension = _ti_core.Extension
184
- """An instance of Taichi extension.
163
+ """An instance of GsTaichi extension.
185
164
 
186
165
  The list of currently available extensions is ['sparse', 'quant', \
187
166
  'mesh', 'quant_basic', 'data64', 'adstack', 'bls', 'assertion', \
@@ -193,8 +172,8 @@ def is_extension_supported(arch, ext):
193
172
  """Checks whether an extension is supported on an arch.
194
173
 
195
174
  Args:
196
- arch (taichi_python.Arch): Specified arch.
197
- ext (taichi_python.Extension): Specified extension.
175
+ arch (gstaichi_python.Arch): Specified arch.
176
+ ext (gstaichi_python.Extension): Specified extension.
198
177
 
199
178
  Returns:
200
179
  bool: Whether `ext` is supported on `arch`.
@@ -203,7 +182,7 @@ def is_extension_supported(arch, ext):
203
182
 
204
183
 
205
184
  def reset():
206
- """Resets Taichi to its initial state.
185
+ """Resets GsTaichi to its initial state.
207
186
  This will destroy all the allocated fields and kernels, and restore
208
187
  the runtime to its default configuration.
209
188
 
@@ -271,11 +250,11 @@ class _SpecialConfig:
271
250
  def prepare_sandbox():
272
251
  """
273
252
  Returns a temporary directory, which will be automatically deleted on exit.
274
- It may contain the taichi_python shared object or some misc. files.
253
+ It may contain the gstaichi_python shared object or some misc. files.
275
254
  """
276
- tmp_dir = tempfile.mkdtemp(prefix="taichi-")
255
+ tmp_dir = tempfile.mkdtemp(prefix="gstaichi-")
277
256
  atexit.register(shutil.rmtree, tmp_dir)
278
- print(f"[Taichi] preparing sandbox at {tmp_dir}")
257
+ print(f"[GsTaichi] preparing sandbox at {tmp_dir}")
279
258
  os.mkdir(os.path.join(tmp_dir, "runtime/"))
280
259
  return tmp_dir
281
260
 
@@ -317,7 +296,7 @@ def check_require_version(require_version):
317
296
 
318
297
  if not match:
319
298
  raise Exception(
320
- f"Taichi version mismatch. Required version >= {major}.{minor}.{patch}, installed version = {_ti_core.get_version_string()}."
299
+ f"GsTaichi version mismatch. Required version >= {major}.{minor}.{patch}, installed version = {_ti_core.get_version_string()}."
321
300
  )
322
301
 
323
302
 
@@ -330,32 +309,32 @@ def init(
330
309
  require_version=None,
331
310
  **kwargs,
332
311
  ):
333
- """Initializes the Taichi runtime.
312
+ """Initializes the GsTaichi runtime.
334
313
 
335
- This should always be the entry point of your Taichi program. Most
314
+ This should always be the entry point of your GsTaichi program. Most
336
315
  importantly, it sets the backend used throughout the program.
337
316
 
338
317
  Args:
339
- arch: Backend to use. This is usually :const:`~taichi.lang.cpu` or :const:`~taichi.lang.gpu`.
318
+ arch: Backend to use. This is usually :const:`~gstaichi.lang.cpu` or :const:`~gstaichi.lang.gpu`.
340
319
  default_fp (Optional[type]): Default floating-point type.
341
320
  default_ip (Optional[type]): Default integral type.
342
321
  require_version (Optional[string]): A version string.
343
- **kwargs: Taichi provides highly customizable compilation through
344
- ``kwargs``, which allows for fine grained control of Taichi compiler
322
+ **kwargs: GsTaichi provides highly customizable compilation through
323
+ ``kwargs``, which allows for fine grained control of GsTaichi compiler
345
324
  behavior. Below we list some of the most frequently used ones. For a
346
325
  complete list, please check out
347
- https://github.com/taichi-dev/taichi/blob/master/taichi/program/compile_config.h.
326
+ https://github.com/taichi-dev/gstaichi/blob/master/gstaichi/program/compile_config.h.
348
327
 
349
328
  * ``cpu_max_num_threads`` (int): Sets the number of threads used by the CPU thread pool.
350
- * ``debug`` (bool): Enables the debug mode, under which Taichi does a few more things like boundary checks.
351
- * ``print_ir`` (bool): Prints the CHI IR of the Taichi kernels.
352
- *``offline_cache`` (bool): Enables offline cache of the compiled kernels. Default to True. When this is enabled Taichi will cache compiled kernel on your local disk to accelerate future calls.
329
+ * ``debug`` (bool): Enables the debug mode, under which GsTaichi does a few more things like boundary checks.
330
+ * ``print_ir`` (bool): Prints the CHI IR of the GsTaichi kernels.
331
+ *``offline_cache`` (bool): Enables offline cache of the compiled kernels. Default to True. When this is enabled GsTaichi will cache compiled kernel on your local disk to accelerate future calls.
353
332
  *``random_seed`` (int): Sets the seed of the random generator. The default is 0.
354
333
  """
355
334
  # Check version for users every 7 days if not disabled by users.
356
335
  _version_check.start_version_check_thread()
357
336
 
358
- # FIXME(https://github.com/taichi-dev/taichi/issues/4811): save the current working directory since it may be
337
+ # FIXME(https://github.com/taichi-dev/gstaichi/issues/4811): save the current working directory since it may be
359
338
  # changed by the Vulkan backend initialization on OS X.
360
339
  current_dir = os.getcwd()
361
340
 
@@ -448,7 +427,7 @@ def init(
448
427
  _logging.info(f"Following TI_ARCH setting up for arch={env_arch}")
449
428
  arch = _ti_core.arch_from_name(env_arch)
450
429
  cfg.arch = adaptive_arch_select(arch, enable_fallback)
451
- print(f"[Taichi] Starting on arch={_ti_core.arch_name(cfg.arch)}")
430
+ print(f"[GsTaichi] Starting on arch={_ti_core.arch_name(cfg.arch)}")
452
431
 
453
432
  if _test_mode:
454
433
  return spec_cfg
@@ -466,26 +445,26 @@ def init(
466
445
  if cfg.debug:
467
446
  impl.get_runtime()._register_signal_handlers()
468
447
 
469
- # Recover the current working directory (https://github.com/taichi-dev/taichi/issues/4811)
448
+ # Recover the current working directory (https://github.com/taichi-dev/gstaichi/issues/4811)
470
449
  os.chdir(current_dir)
471
450
  return None
472
451
 
473
452
 
474
453
  def no_activate(*args):
475
454
  """Deactivates a SNode pointer."""
476
- assert isinstance(get_runtime().compiling_callable, _ti_core.Kernel)
455
+ assert isinstance(get_runtime().compiling_callable, _ti_core.KernelCxx)
477
456
  for v in args:
478
457
  get_runtime().compiling_callable.no_activate(v._snode.ptr)
479
458
 
480
459
 
481
460
  def block_local(*args):
482
- """Hints Taichi to cache the fields and to enable the BLS optimization.
461
+ """Hints GsTaichi to cache the fields and to enable the BLS optimization.
483
462
 
484
463
  Please visit https://docs.taichi-lang.org/docs/performance
485
464
  for how BLS is used.
486
465
 
487
466
  Args:
488
- *args (List[Field]): A list of sparse Taichi fields.
467
+ *args (List[Field]): A list of sparse GsTaichi fields.
489
468
  """
490
469
  if impl.current_cfg().opt_level == 0:
491
470
  _logging.warn("""opt_level = 1 is enforced to enable bls analysis.""")
@@ -502,7 +481,7 @@ def mesh_local(*args):
502
481
  and to enable the mesh BLS optimization,
503
482
  only available for backends supporting `ti.extension.mesh` and to use with mesh-for loop.
504
483
 
505
- Related to https://github.com/taichi-dev/taichi/issues/3608
484
+ Related to https://github.com/taichi-dev/gstaichi/issues/3608
506
485
 
507
486
  Args:
508
487
  *args (List[Attribute]): A list of mesh attributes or fields accessed as attributes.
@@ -703,7 +682,7 @@ def mesh_patch_idx():
703
682
  """Returns the internal mesh patch id of this running thread,
704
683
  only available for backends supporting `ti.extension.mesh` and to use within mesh-for loop.
705
684
 
706
- Related to https://github.com/taichi-dev/taichi/issues/3608
685
+ Related to https://github.com/taichi-dev/gstaichi/issues/3608
707
686
  """
708
687
  return (
709
688
  impl.get_runtime()
@@ -716,7 +695,7 @@ def is_arch_supported(arch):
716
695
  """Checks whether an arch is supported on the machine.
717
696
 
718
697
  Args:
719
- arch (taichi_python.Arch): Specified arch.
698
+ arch (gstaichi_python.Arch): Specified arch.
720
699
 
721
700
  Returns:
722
701
  bool: Whether `arch` is supported on the machine.
@@ -726,11 +705,7 @@ def is_arch_supported(arch):
726
705
  cuda: _ti_core.with_cuda,
727
706
  amdgpu: _ti_core.with_amdgpu,
728
707
  metal: _ti_core.with_metal,
729
- opengl: functools.partial(_ti_core.with_opengl, False),
730
- gles: functools.partial(_ti_core.with_opengl, True),
731
708
  vulkan: _ti_core.with_vulkan,
732
- dx11: _ti_core.with_dx11,
733
- dx12: _ti_core.with_dx12,
734
709
  cpu: lambda: True,
735
710
  }
736
711
  with_arch = arch_table.get(arch, lambda: False)
@@ -782,16 +757,12 @@ __all__ = [
782
757
  "l",
783
758
  "x86_64",
784
759
  "x64",
785
- "dx11",
786
- "dx12",
787
760
  "arm64",
788
761
  "cpu",
789
762
  "cuda",
790
763
  "amdgpu",
791
- "gles",
792
764
  "gpu",
793
765
  "metal",
794
- "opengl",
795
766
  "vulkan",
796
767
  "extension",
797
768
  "loop_config",