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
@@ -1,18 +1,18 @@
1
1
  # type: ignore
2
2
 
3
- from taichi._kernels import (
3
+ from gstaichi._kernels import (
4
4
  blit_from_field_to_field,
5
5
  scan_add_inclusive,
6
6
  sort_stage,
7
7
  uniform_add,
8
8
  warp_shfl_up_i32,
9
9
  )
10
- from taichi.lang.impl import current_cfg, field
11
- from taichi.lang.kernel_impl import data_oriented
12
- from taichi.lang.misc import cuda, vulkan
13
- from taichi.lang.runtime_ops import sync
14
- from taichi.lang.simt import subgroup
15
- from taichi.types.primitive_types import i32
10
+ from gstaichi.lang.impl import current_cfg, field
11
+ from gstaichi.lang.kernel_impl import data_oriented
12
+ from gstaichi.lang.misc import cuda, vulkan
13
+ from gstaichi.lang.runtime_ops import sync
14
+ from gstaichi.lang.simt import subgroup
15
+ from gstaichi.types.primitive_types import i32
16
16
 
17
17
 
18
18
  def parallel_sort(keys, values=None):
@@ -1,4 +1,4 @@
1
- import taichi as ti
1
+ import gstaichi as ti
2
2
 
3
3
 
4
4
  @ti.kernel
@@ -2,7 +2,7 @@
2
2
 
3
3
  import warnings
4
4
 
5
- from taichi.lang.kernel_impl import real_func as _real_func
5
+ from gstaichi.lang.kernel_impl import real_func as _real_func
6
6
 
7
7
 
8
8
  def real_func(func):
@@ -0,0 +1,50 @@
1
+ # type: ignore
2
+
3
+ from gstaichi.lang import impl, simt
4
+ from gstaichi.lang._ndarray import *
5
+ from gstaichi.lang._ndrange import ndrange
6
+ from gstaichi.lang._texture import Texture
7
+ from gstaichi.lang.argpack import *
8
+ from gstaichi.lang.exception import *
9
+ from gstaichi.lang.field import *
10
+ from gstaichi.lang.impl import *
11
+ from gstaichi.lang.kernel_impl import *
12
+ from gstaichi.lang.matrix import *
13
+ from gstaichi.lang.mesh import *
14
+ from gstaichi.lang.misc import * # pylint: disable=W0622
15
+ from gstaichi.lang.ops import * # pylint: disable=W0622
16
+ from gstaichi.lang.runtime_ops import *
17
+ from gstaichi.lang.snode import *
18
+ from gstaichi.lang.source_builder import *
19
+ from gstaichi.lang.struct import *
20
+ from gstaichi.types.enums import DeviceCapability, Format, Layout
21
+
22
+ __all__ = [
23
+ s
24
+ for s in dir()
25
+ if not s.startswith("_")
26
+ and s
27
+ not in [
28
+ "any_array",
29
+ "ast",
30
+ "common_ops",
31
+ "enums",
32
+ "exception",
33
+ "expr",
34
+ "impl",
35
+ "inspect",
36
+ "kernel_arguments",
37
+ "kernel_impl",
38
+ "matrix",
39
+ "mesh",
40
+ "misc",
41
+ "ops",
42
+ "platform",
43
+ "runtime_ops",
44
+ "shell",
45
+ "snode",
46
+ "source_builder",
47
+ "struct",
48
+ "util",
49
+ ]
50
+ ]
@@ -1,19 +1,26 @@
1
1
  # type: ignore
2
2
 
3
+ from typing import TYPE_CHECKING, Union
4
+
3
5
  import numpy as np
4
6
 
5
- from taichi._lib import core as _ti_core
6
- from taichi.lang import impl
7
- from taichi.lang.exception import TaichiIndexError
8
- from taichi.lang.util import cook_dtype, get_traceback, python_scope, to_numpy_type
9
- from taichi.types import primitive_types
10
- from taichi.types.enums import Layout
11
- from taichi.types.ndarray_type import NdarrayTypeMetadata
12
- from taichi.types.utils import is_real, is_signed
7
+ from gstaichi._lib import core as _ti_core
8
+ from gstaichi.lang import impl
9
+ from gstaichi.lang.exception import GsTaichiIndexError
10
+ from gstaichi.lang.util import cook_dtype, get_traceback, python_scope, to_numpy_type
11
+ from gstaichi.types import primitive_types
12
+ from gstaichi.types.enums import Layout
13
+ from gstaichi.types.ndarray_type import NdarrayTypeMetadata
14
+ from gstaichi.types.utils import is_real, is_signed
15
+
16
+ if TYPE_CHECKING:
17
+ from gstaichi.lang.matrix import MatrixNdarray, VectorNdarray
18
+
19
+ TensorNdarray = Union["ScalarNdarray", VectorNdarray, MatrixNdarray]
13
20
 
14
21
 
15
22
  class Ndarray:
16
- """Taichi ndarray class.
23
+ """GsTaichi ndarray class.
17
24
 
18
25
  Args:
19
26
  dtype (DataType): Data type of each value.
@@ -27,7 +34,7 @@ class Ndarray:
27
34
  self.dtype = None
28
35
  self.arr = None
29
36
  self.layout = Layout.AOS
30
- self.grad = None
37
+ self.grad: "TensorNdarray | None" = None
31
38
 
32
39
  def get_type(self):
33
40
  return NdarrayTypeMetadata(self.element_type, self.shape, self.grad is not None)
@@ -91,7 +98,7 @@ class Ndarray:
91
98
  numpy.ndarray: The result numpy array.
92
99
  """
93
100
  arr = np.zeros(shape=self.arr.total_shape(), dtype=to_numpy_type(self.dtype))
94
- from taichi._kernels import ndarray_to_ext_arr # pylint: disable=C0415
101
+ from gstaichi._kernels import ndarray_to_ext_arr # pylint: disable=C0415
95
102
 
96
103
  ndarray_to_ext_arr(self, arr)
97
104
  impl.get_runtime().sync()
@@ -105,7 +112,7 @@ class Ndarray:
105
112
  numpy.ndarray: The result numpy array.
106
113
  """
107
114
  arr = np.zeros(shape=self.arr.total_shape(), dtype=to_numpy_type(self.dtype))
108
- from taichi._kernels import ndarray_matrix_to_ext_arr # pylint: disable=C0415
115
+ from gstaichi._kernels import ndarray_matrix_to_ext_arr # pylint: disable=C0415
109
116
 
110
117
  layout_is_aos = 1
111
118
  ndarray_matrix_to_ext_arr(self, arr, layout_is_aos, as_vector)
@@ -126,7 +133,7 @@ class Ndarray:
126
133
  if not arr.flags.c_contiguous:
127
134
  arr = np.ascontiguousarray(arr)
128
135
 
129
- from taichi._kernels import ext_arr_to_ndarray # pylint: disable=C0415
136
+ from gstaichi._kernels import ext_arr_to_ndarray # pylint: disable=C0415
130
137
 
131
138
  ext_arr_to_ndarray(arr, self)
132
139
  impl.get_runtime().sync()
@@ -147,7 +154,7 @@ class Ndarray:
147
154
  if not arr.flags.c_contiguous:
148
155
  arr = np.ascontiguousarray(arr)
149
156
 
150
- from taichi._kernels import ext_arr_to_ndarray_matrix # pylint: disable=C0415
157
+ from gstaichi._kernels import ext_arr_to_ndarray_matrix # pylint: disable=C0415
151
158
 
152
159
  layout_is_aos = 1
153
160
  ext_arr_to_ndarray_matrix(arr, self, layout_is_aos, as_vector)
@@ -182,12 +189,12 @@ class Ndarray:
182
189
  """
183
190
  assert isinstance(other, Ndarray)
184
191
  assert tuple(self.arr.shape) == tuple(other.arr.shape)
185
- from taichi._kernels import ndarray_to_ndarray # pylint: disable=C0415
192
+ from gstaichi._kernels import ndarray_to_ndarray # pylint: disable=C0415
186
193
 
187
194
  ndarray_to_ndarray(self, other)
188
195
  impl.get_runtime().sync()
189
196
 
190
- def _set_grad(self, grad):
197
+ def _set_grad(self, grad: "TensorNdarray"):
191
198
  """Sets the gradient ndarray.
192
199
 
193
200
  Args:
@@ -218,7 +225,7 @@ class Ndarray:
218
225
  if not isinstance(key, (tuple, list)):
219
226
  key = (key,)
220
227
  if len(key) != len(self.arr.total_shape()):
221
- raise TaichiIndexError(f"{len(self.arr.total_shape())}d ndarray indexed with {len(key)}d indices: {key}")
228
+ raise GsTaichiIndexError(f"{len(self.arr.total_shape())}d ndarray indexed with {len(key)}d indices: {key}")
222
229
  return key
223
230
 
224
231
  @python_scope
@@ -230,7 +237,7 @@ class Ndarray:
230
237
 
231
238
 
232
239
  class ScalarNdarray(Ndarray):
233
- """Taichi ndarray with scalar elements.
240
+ """GsTaichi ndarray with scalar elements.
234
241
 
235
242
  Args:
236
243
  dtype (DataType): Data type of each value.
@@ -247,13 +254,10 @@ class ScalarNdarray(Ndarray):
247
254
  self.element_type = dtype
248
255
 
249
256
  def __del__(self):
250
- if (
251
- impl is not None
252
- and impl.get_runtime is not None
253
- and impl.get_runtime() is not None
254
- and impl.get_runtime().prog is not None
255
- ):
256
- impl.get_runtime().prog.delete_ndarray(self.arr)
257
+ if impl is not None and impl.get_runtime is not None and impl.get_runtime() is not None:
258
+ prog = impl.get_runtime()._prog
259
+ if prog is not None:
260
+ prog.delete_ndarray(self.arr)
257
261
 
258
262
  @property
259
263
  def element_shape(self):
@@ -283,7 +287,7 @@ class ScalarNdarray(Ndarray):
283
287
  return ret_arr
284
288
 
285
289
  def _fill_by_kernel(self, val):
286
- from taichi._kernels import fill_ndarray # pylint: disable=C0415
290
+ from gstaichi._kernels import fill_ndarray # pylint: disable=C0415
287
291
 
288
292
  fill_ndarray(self, val)
289
293
 
@@ -5,11 +5,11 @@ from typing import Iterable
5
5
 
6
6
  import numpy as np
7
7
 
8
- from taichi.lang import ops
9
- from taichi.lang.exception import TaichiSyntaxError, TaichiTypeError
10
- from taichi.lang.expr import Expr
11
- from taichi.lang.matrix import Matrix
12
- from taichi.types.utils import is_integral
8
+ from gstaichi.lang import ops
9
+ from gstaichi.lang.exception import GsTaichiSyntaxError, GsTaichiTypeError
10
+ from gstaichi.lang.expr import Expr
11
+ from gstaichi.lang.matrix import Matrix
12
+ from gstaichi.types.utils import is_integral
13
13
 
14
14
 
15
15
  class _Ndrange:
@@ -19,7 +19,7 @@ class _Ndrange:
19
19
  if not isinstance(arg, collections.abc.Sequence):
20
20
  args[i] = (0, arg)
21
21
  if len(args[i]) != 2:
22
- raise TaichiSyntaxError(
22
+ raise GsTaichiSyntaxError(
23
23
  "Every argument of ndrange should be a scalar or a tuple/list like (begin, end)"
24
24
  )
25
25
  args[i] = (args[i][0], ops.max(args[i][0], args[i][1]))
@@ -28,7 +28,7 @@ class _Ndrange:
28
28
  if not isinstance(bound, (int, np.integer)) and not (
29
29
  isinstance(bound, Expr) and is_integral(bound.ptr.get_rvalue_type())
30
30
  ):
31
- raise TaichiTypeError(
31
+ raise GsTaichiTypeError(
32
32
  "Every argument of ndrange should be an integer scalar or a tuple/list of (int, int)"
33
33
  )
34
34
  self.bounds = args
@@ -129,7 +129,7 @@ def ndrange(*args) -> Iterable:
129
129
 
130
130
  A typical usage of `ndrange` is when you want to loop over a tensor and process
131
131
  its entries in parallel. You should avoid writing nested `for` loops here since
132
- only top level `for` loops are paralleled in taichi, instead you can use `ndrange`
132
+ only top level `for` loops are paralleled in gstaichi, instead you can use `ndrange`
133
133
  to hold all entries in one top level loop:
134
134
 
135
135
  >>> @ti.kernel
@@ -0,0 +1,199 @@
1
+ import dataclasses
2
+ import weakref
3
+ from typing import Any, Union
4
+
5
+ import gstaichi.lang
6
+ import gstaichi.lang._ndarray
7
+ import gstaichi.lang._texture
8
+ import gstaichi.lang.expr
9
+ import gstaichi.lang.snode
10
+ from gstaichi._lib import core as _ti_core
11
+ from gstaichi.lang.any_array import AnyArray
12
+ from gstaichi.lang.argpack import ArgPack, ArgPackType
13
+ from gstaichi.lang.exception import (
14
+ GsTaichiRuntimeTypeError,
15
+ )
16
+ from gstaichi.lang.kernel_arguments import KernelArgument
17
+ from gstaichi.lang.matrix import MatrixType
18
+ from gstaichi.lang.util import to_gstaichi_type
19
+ from gstaichi.types import (
20
+ ndarray_type,
21
+ sparse_matrix_builder,
22
+ template,
23
+ texture_type,
24
+ )
25
+
26
+ AnnotationType = Union[
27
+ template,
28
+ ArgPackType,
29
+ "texture_type.TextureType",
30
+ "texture_type.RWTextureType",
31
+ ndarray_type.NdarrayType,
32
+ sparse_matrix_builder,
33
+ Any,
34
+ ]
35
+
36
+
37
+ class GsTaichiCallableTemplateMapper:
38
+ """
39
+ This should probably be renamed to sometihng like FeatureMapper, or
40
+ FeatureExtractor, since:
41
+ - it's not specific to templates
42
+ - it extracts what are later called 'features', for example for ndarray this includes:
43
+ - element type
44
+ - number dimensions
45
+ - needs grad (or not)
46
+ - these are returned as a heterogeneous tuple, whose contents depends on the type
47
+ """
48
+
49
+ def __init__(self, arguments: list[KernelArgument], template_slot_locations: list[int]) -> None:
50
+ self.arguments: list[KernelArgument] = arguments
51
+ self.num_args: int = len(arguments)
52
+ self.template_slot_locations: list[int] = template_slot_locations
53
+ self.mapping: dict[tuple[Any, ...], int] = {}
54
+
55
+ @staticmethod
56
+ def extract_arg(arg, annotation: AnnotationType, arg_name: str) -> Any:
57
+ if annotation == template or isinstance(annotation, template):
58
+ if isinstance(arg, gstaichi.lang.snode.SNode):
59
+ return arg.ptr
60
+ if isinstance(arg, gstaichi.lang.expr.Expr):
61
+ return arg.ptr.get_underlying_ptr_address()
62
+ if isinstance(arg, _ti_core.ExprCxx):
63
+ return arg.get_underlying_ptr_address()
64
+ if isinstance(arg, tuple):
65
+ return tuple(GsTaichiCallableTemplateMapper.extract_arg(item, annotation, arg_name) for item in arg)
66
+ if isinstance(arg, gstaichi.lang._ndarray.Ndarray):
67
+ raise GsTaichiRuntimeTypeError(
68
+ "Ndarray shouldn't be passed in via `ti.template()`, please annotate your kernel using `ti.types.ndarray(...)` instead"
69
+ )
70
+
71
+ if isinstance(arg, (list, tuple, dict, set)) or hasattr(arg, "_data_oriented"):
72
+ # [Composite arguments] Return weak reference to the object
73
+ # GsTaichi kernel will cache the extracted arguments, thus we can't simply return the original argument.
74
+ # Instead, a weak reference to the original value is returned to avoid memory leak.
75
+
76
+ # TODO(zhanlue): replacing "tuple(args)" with "hash of argument values"
77
+ # This can resolve the following issues:
78
+ # 1. Invalid weak-ref will leave a dead(dangling) entry in both caches: "self.mapping" and "self.compiled_functions"
79
+ # 2. Different argument instances with same type and same value, will get templatized into seperate kernels.
80
+ return weakref.ref(arg)
81
+
82
+ # [Primitive arguments] Return the value
83
+ return arg
84
+ if isinstance(annotation, ArgPackType):
85
+ if not isinstance(arg, ArgPack):
86
+ raise GsTaichiRuntimeTypeError(f"Argument {arg_name} must be a argument pack, got {type(arg)}")
87
+ return tuple(
88
+ GsTaichiCallableTemplateMapper.extract_arg(arg[name], dtype, arg_name)
89
+ for index, (name, dtype) in enumerate(annotation.members.items())
90
+ )
91
+ if dataclasses.is_dataclass(annotation):
92
+ _res_l = []
93
+ for field in dataclasses.fields(annotation):
94
+ field_value = getattr(arg, field.name)
95
+ arg_name = f"__ti_{arg_name}_{field.name}"
96
+ field_extracted = GsTaichiCallableTemplateMapper.extract_arg(field_value, field.type, arg_name)
97
+ _res_l.append(field_extracted)
98
+ return tuple(_res_l)
99
+ if isinstance(annotation, texture_type.TextureType):
100
+ if not isinstance(arg, gstaichi.lang._texture.Texture):
101
+ raise GsTaichiRuntimeTypeError(f"Argument {arg_name} must be a texture, got {type(arg)}")
102
+ if arg.num_dims != annotation.num_dimensions:
103
+ raise GsTaichiRuntimeTypeError(
104
+ f"TextureType dimension mismatch for argument {arg_name}: expected {annotation.num_dimensions}, got {arg.num_dims}"
105
+ )
106
+ return (arg.num_dims,)
107
+ if isinstance(annotation, texture_type.RWTextureType):
108
+ if not isinstance(arg, gstaichi.lang._texture.Texture):
109
+ raise GsTaichiRuntimeTypeError(f"Argument {arg_name} must be a texture, got {type(arg)}")
110
+ if arg.num_dims != annotation.num_dimensions:
111
+ raise GsTaichiRuntimeTypeError(
112
+ f"RWTextureType dimension mismatch for argument {arg_name}: expected {annotation.num_dimensions}, got {arg.num_dims}"
113
+ )
114
+ if arg.fmt != annotation.fmt:
115
+ raise GsTaichiRuntimeTypeError(
116
+ f"RWTextureType format mismatch for argument {arg_name}: expected {annotation.fmt}, got {arg.fmt}"
117
+ )
118
+ # (penguinliong) '0' is the assumed LOD level. We currently don't
119
+ # support mip-mapping.
120
+ return arg.num_dims, arg.fmt, 0
121
+ if isinstance(annotation, ndarray_type.NdarrayType):
122
+ if isinstance(arg, gstaichi.lang._ndarray.Ndarray):
123
+ annotation.check_matched(arg.get_type(), arg_name)
124
+ needs_grad = (arg.grad is not None) if annotation.needs_grad is None else annotation.needs_grad
125
+ assert arg.shape is not None
126
+ return arg.element_type, len(arg.shape), needs_grad, annotation.boundary
127
+ if isinstance(arg, AnyArray):
128
+ ty = arg.get_type()
129
+ annotation.check_matched(arg.get_type(), arg_name)
130
+ return ty.element_type, len(arg.shape), ty.needs_grad, annotation.boundary
131
+ # external arrays
132
+ shape = getattr(arg, "shape", None)
133
+ if shape is None:
134
+ raise GsTaichiRuntimeTypeError(f"Invalid type for argument {arg_name}, got {arg}")
135
+ shape = tuple(shape)
136
+ element_shape: tuple[int, ...] = ()
137
+ dtype = to_gstaichi_type(arg.dtype)
138
+ if isinstance(annotation.dtype, MatrixType):
139
+ if annotation.ndim is not None:
140
+ if len(shape) != annotation.dtype.ndim + annotation.ndim:
141
+ raise ValueError(
142
+ f"Invalid value for argument {arg_name} - required array has ndim={annotation.ndim} element_dim={annotation.dtype.ndim}, "
143
+ f"array with {len(shape)} dimensions is provided"
144
+ )
145
+ else:
146
+ if len(shape) < annotation.dtype.ndim:
147
+ raise ValueError(
148
+ f"Invalid value for argument {arg_name} - required element_dim={annotation.dtype.ndim}, "
149
+ f"array with {len(shape)} dimensions is provided"
150
+ )
151
+ element_shape = shape[-annotation.dtype.ndim :]
152
+ anno_element_shape = annotation.dtype.get_shape()
153
+ if None not in anno_element_shape and element_shape != anno_element_shape:
154
+ raise ValueError(
155
+ f"Invalid value for argument {arg_name} - required element_shape={anno_element_shape}, "
156
+ f"array with element shape of {element_shape} is provided"
157
+ )
158
+ elif annotation.dtype is not None:
159
+ # User specified scalar dtype
160
+ if annotation.dtype != dtype:
161
+ raise ValueError(
162
+ f"Invalid value for argument {arg_name} - required array has dtype={annotation.dtype.to_string()}, "
163
+ f"array with dtype={dtype.to_string()} is provided"
164
+ )
165
+
166
+ if annotation.ndim is not None and len(shape) != annotation.ndim:
167
+ raise ValueError(
168
+ f"Invalid value for argument {arg_name} - required array has ndim={annotation.ndim}, "
169
+ f"array with {len(shape)} dimensions is provided"
170
+ )
171
+ needs_grad = (
172
+ getattr(arg, "requires_grad", False) if annotation.needs_grad is None else annotation.needs_grad
173
+ )
174
+ element_type = (
175
+ _ti_core.get_type_factory_instance().get_tensor_type(element_shape, dtype)
176
+ if len(element_shape) != 0
177
+ else arg.dtype
178
+ )
179
+ return element_type, len(shape) - len(element_shape), needs_grad, annotation.boundary
180
+ if isinstance(annotation, sparse_matrix_builder):
181
+ return arg.dtype
182
+ # Use '#' as a placeholder because other kinds of arguments are not involved in template instantiation
183
+ return "#"
184
+
185
+ def extract(self, args: tuple[Any, ...]) -> tuple[Any, ...]:
186
+ extracted: list[Any] = []
187
+ for arg, kernel_arg in zip(args, self.arguments):
188
+ extracted.append(self.extract_arg(arg, kernel_arg.annotation, kernel_arg.name))
189
+ return tuple(extracted)
190
+
191
+ def lookup(self, args: tuple[Any, ...]) -> tuple[int, tuple[Any, ...]]:
192
+ if len(args) != self.num_args:
193
+ raise TypeError(f"{self.num_args} argument(s) needed but {len(args)} provided.")
194
+
195
+ key = self.extract(args)
196
+ if key not in self.mapping:
197
+ count = len(self.mapping)
198
+ self.mapping[key] = count
199
+ return self.mapping[key], key
@@ -2,13 +2,13 @@
2
2
 
3
3
  import numpy as np
4
4
 
5
- from taichi._lib import core as _ti_core
6
- from taichi.lang import impl
7
- from taichi.lang.expr import Expr, make_expr_group
8
- from taichi.lang.matrix import Matrix
9
- from taichi.lang.util import taichi_scope
10
- from taichi.types import vector
11
- from taichi.types.primitive_types import f32
5
+ from gstaichi._lib import core as _ti_core
6
+ from gstaichi.lang import impl
7
+ from gstaichi.lang.expr import Expr, make_expr_group
8
+ from gstaichi.lang.matrix import Matrix
9
+ from gstaichi.lang.util import gstaichi_scope
10
+ from gstaichi.types import vector
11
+ from gstaichi.types.primitive_types import f32
12
12
 
13
13
 
14
14
  def _get_entries(mat):
@@ -22,7 +22,7 @@ class TextureSampler:
22
22
  self.ptr_expr = ptr_expr
23
23
  self.num_dims = num_dims
24
24
 
25
- @taichi_scope
25
+ @gstaichi_scope
26
26
  def sample_lod(self, uv, lod):
27
27
  ast_builder = impl.get_runtime().compiling_callable.ast_builder()
28
28
  dbg_info = _ti_core.DebugInfo(impl.get_runtime().get_current_src_info())
@@ -34,7 +34,7 @@ class TextureSampler:
34
34
  a = impl.call_internal("composite_extract_3", v, with_runtime_context=False)
35
35
  return vector(4, f32)([r, g, b, a])
36
36
 
37
- @taichi_scope
37
+ @gstaichi_scope
38
38
  def fetch(self, index, lod):
39
39
  ast_builder = impl.get_runtime().compiling_callable.ast_builder()
40
40
  dbg_info = _ti_core.DebugInfo(impl.get_runtime().get_current_src_info())
@@ -49,11 +49,11 @@ class TextureSampler:
49
49
 
50
50
  class RWTextureAccessor:
51
51
  def __init__(self, ptr_expr, num_dims) -> None:
52
- # taichi_python.TexturePtrExpression.
52
+ # gstaichi_python.TexturePtrExpression.
53
53
  self.ptr_expr = ptr_expr
54
54
  self.num_dims = num_dims
55
55
 
56
- @taichi_scope
56
+ @gstaichi_scope
57
57
  def load(self, index):
58
58
  ast_builder = impl.get_runtime().compiling_callable.ast_builder()
59
59
  dbg_info = _ti_core.DebugInfo(impl.get_runtime().get_current_src_info())
@@ -65,7 +65,7 @@ class RWTextureAccessor:
65
65
  a = impl.call_internal("composite_extract_3", v, with_runtime_context=False)
66
66
  return vector(4, f32)([r, g, b, a])
67
67
 
68
- @taichi_scope
68
+ @gstaichi_scope
69
69
  def store(self, index, value):
70
70
  ast_builder = impl.get_runtime().compiling_callable.ast_builder()
71
71
  dbg_info = _ti_core.DebugInfo(impl.get_runtime().get_current_src_info())
@@ -75,7 +75,7 @@ class RWTextureAccessor:
75
75
  )
76
76
 
77
77
  @property
78
- @taichi_scope
78
+ @gstaichi_scope
79
79
  def shape(self):
80
80
  """A list containing sizes for each dimension. Note that element shape will be excluded.
81
81
 
@@ -87,18 +87,18 @@ class RWTextureAccessor:
87
87
  ret = [Expr(_ti_core.get_external_tensor_shape_along_axis(self.ptr_expr, i, dbg_info)) for i in range(dim)]
88
88
  return ret
89
89
 
90
- @taichi_scope
90
+ @gstaichi_scope
91
91
  def _loop_range(self):
92
- """Gets the corresponding taichi_python.Expr to serve as loop range.
92
+ """Gets the corresponding gstaichi_python.Expr to serve as loop range.
93
93
 
94
94
  Returns:
95
- taichi_python.Expr: See above.
95
+ gstaichi_python.Expr: See above.
96
96
  """
97
97
  return self.ptr_expr
98
98
 
99
99
 
100
100
  class Texture:
101
- """Taichi Texture class.
101
+ """GsTaichi Texture class.
102
102
 
103
103
  Args:
104
104
  fmt (ti.Format): Color format of the texture.
@@ -148,7 +148,7 @@ class Texture:
148
148
  # Don't use transpose method since its enums are too new
149
149
  image = image.rotate(90, expand=True)
150
150
  arr = np.asarray(image)
151
- from taichi._kernels import ( # pylint: disable=import-outside-toplevel
151
+ from gstaichi._kernels import ( # pylint: disable=import-outside-toplevel
152
152
  load_texture_from_numpy,
153
153
  )
154
154
 
@@ -164,7 +164,7 @@ class Texture:
164
164
  from PIL import Image # pylint: disable=import-outside-toplevel
165
165
 
166
166
  res = np.zeros(self.shape + (3,), np.uint8)
167
- from taichi._kernels import ( # pylint: disable=import-outside-toplevel
167
+ from gstaichi._kernels import ( # pylint: disable=import-outside-toplevel
168
168
  save_texture_to_numpy,
169
169
  )
170
170
 
@@ -1,19 +1,19 @@
1
1
  # type: ignore
2
2
 
3
- # Taichi's custom inspect module.
4
- # This module is used by Taichi's ast transformer to parse the source code.
3
+ # GsTaichi's custom inspect module.
4
+ # This module is used by GsTaichi's ast transformer to parse the source code.
5
5
  # Currently this module is aimed for working in the following modes:
6
6
  # 1. Usual Python/IPython mode, e.g. python script.py
7
7
  # In this case we mainly rely on the built-in `inspect` module, except
8
8
  # we need some hacks when we are in IPython mode and there is a cell magic.
9
- # 2. Blender's scripting mode, e.g. Users write Taichi code in the scripting
9
+ # 2. Blender's scripting mode, e.g. Users write GsTaichi code in the scripting
10
10
  # window in Blender and press the run button. In this case we need to
11
11
  # retrieve the source using Blender's `bpy.data.texts` and write it to a temp
12
12
  # file so that the inspect module can parse.
13
13
  # 3. The interactive shell mode, e.g. Users directly type their code in the
14
14
  # interactive shell. In this case we use `dill` to get the source.
15
15
  #
16
- # NB: Running Taichi in other modes are likely not supported.
16
+ # NB: Running GsTaichi in other modes are likely not supported.
17
17
 
18
18
  import atexit
19
19
  import inspect
@@ -137,7 +137,7 @@ def _Python_IPython_findsource(obj):
137
137
  pass
138
138
  raise IOError(
139
139
  f"Cannot find source code for Object: {obj}, it's likely \
140
- you are not running Taichi from command line or IPython."
140
+ you are not running GsTaichi from command line or IPython."
141
141
  )
142
142
 
143
143
 
@@ -158,9 +158,9 @@ def _custom_findsource(obj):
158
158
  except:
159
159
  raise IOError(
160
160
  f"Cannot find source code for Object: {obj}, this \
161
- is possibly because of you are running Taichi in an environment that Taichi's own \
161
+ is possibly because of you are running GsTaichi in an environment that GsTaichi's own \
162
162
  inspect module cannot find the source. Please report an issue to help us fix: \
163
- https://github.com/taichi-dev/taichi/issues"
163
+ https://github.com/taichi-dev/gstaichi/issues"
164
164
  )
165
165
 
166
166