gstaichi 0.1.23.dev0__cp310-cp310-win_amd64.whl → 0.1.25.dev0__cp310-cp310-win_amd64.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.
- gstaichi/CHANGELOG.md +9 -0
- {taichi → gstaichi}/__init__.py +9 -13
- {taichi → gstaichi}/_funcs.py +8 -8
- {taichi → gstaichi}/_kernels.py +19 -19
- gstaichi/_lib/__init__.py +3 -0
- taichi/_lib/core/taichi_python.cp310-win_amd64.pyd → gstaichi/_lib/core/gstaichi_python.cp310-win_amd64.pyd +0 -0
- taichi/_lib/core/taichi_python.pyi → gstaichi/_lib/core/gstaichi_python.pyi +382 -522
- {taichi → gstaichi}/_lib/runtime/runtime_cuda.bc +0 -0
- {taichi → gstaichi}/_lib/runtime/runtime_x64.bc +0 -0
- {taichi → gstaichi}/_lib/utils.py +15 -15
- {taichi → gstaichi}/_logging.py +1 -1
- {taichi → gstaichi}/_main.py +24 -31
- gstaichi/_snode/__init__.py +5 -0
- {taichi → gstaichi}/_snode/fields_builder.py +27 -29
- {taichi → gstaichi}/_snode/snode_tree.py +5 -5
- gstaichi/_test_tools/__init__.py +0 -0
- gstaichi/_test_tools/load_kernel_string.py +30 -0
- gstaichi/_version.py +1 -0
- {taichi → gstaichi}/_version_check.py +8 -5
- gstaichi/ad/__init__.py +3 -0
- {taichi → gstaichi}/ad/_ad.py +26 -26
- {taichi → gstaichi}/algorithms/_algorithms.py +7 -7
- {taichi → gstaichi}/examples/minimal.py +1 -1
- {taichi → gstaichi}/experimental.py +1 -1
- gstaichi/lang/__init__.py +50 -0
- {taichi → gstaichi}/lang/_ndarray.py +30 -26
- {taichi → gstaichi}/lang/_ndrange.py +8 -8
- gstaichi/lang/_template_mapper.py +199 -0
- {taichi → gstaichi}/lang/_texture.py +19 -19
- {taichi → gstaichi}/lang/_wrap_inspect.py +7 -7
- {taichi → gstaichi}/lang/any_array.py +13 -13
- {taichi → gstaichi}/lang/argpack.py +29 -29
- gstaichi/lang/ast/__init__.py +5 -0
- {taichi → gstaichi}/lang/ast/ast_transformer.py +94 -582
- {taichi → gstaichi}/lang/ast/ast_transformer_utils.py +54 -41
- gstaichi/lang/ast/ast_transformers/__init__.py +0 -0
- gstaichi/lang/ast/ast_transformers/call_transformer.py +267 -0
- gstaichi/lang/ast/ast_transformers/function_def_transformer.py +320 -0
- {taichi → gstaichi}/lang/ast/checkers.py +5 -5
- gstaichi/lang/ast/transform.py +9 -0
- {taichi → gstaichi}/lang/common_ops.py +12 -12
- gstaichi/lang/exception.py +80 -0
- {taichi → gstaichi}/lang/expr.py +22 -22
- {taichi → gstaichi}/lang/field.py +29 -27
- {taichi → gstaichi}/lang/impl.py +116 -121
- {taichi → gstaichi}/lang/kernel_arguments.py +16 -16
- {taichi → gstaichi}/lang/kernel_impl.py +330 -363
- {taichi → gstaichi}/lang/matrix.py +119 -115
- {taichi → gstaichi}/lang/matrix_ops.py +6 -6
- {taichi → gstaichi}/lang/matrix_ops_utils.py +4 -4
- {taichi → gstaichi}/lang/mesh.py +22 -22
- {taichi → gstaichi}/lang/misc.py +39 -68
- {taichi → gstaichi}/lang/ops.py +146 -141
- {taichi → gstaichi}/lang/runtime_ops.py +2 -2
- {taichi → gstaichi}/lang/shell.py +3 -3
- {taichi → gstaichi}/lang/simt/__init__.py +1 -1
- {taichi → gstaichi}/lang/simt/block.py +7 -7
- {taichi → gstaichi}/lang/simt/grid.py +1 -1
- {taichi → gstaichi}/lang/simt/subgroup.py +1 -1
- {taichi → gstaichi}/lang/simt/warp.py +1 -1
- {taichi → gstaichi}/lang/snode.py +46 -44
- {taichi → gstaichi}/lang/source_builder.py +13 -13
- {taichi → gstaichi}/lang/struct.py +33 -33
- {taichi → gstaichi}/lang/util.py +24 -24
- gstaichi/linalg/__init__.py +8 -0
- {taichi → gstaichi}/linalg/matrixfree_cg.py +14 -14
- {taichi → gstaichi}/linalg/sparse_cg.py +10 -10
- {taichi → gstaichi}/linalg/sparse_matrix.py +23 -23
- {taichi → gstaichi}/linalg/sparse_solver.py +21 -21
- {taichi → gstaichi}/math/__init__.py +1 -1
- {taichi → gstaichi}/math/_complex.py +21 -20
- {taichi → gstaichi}/math/mathimpl.py +56 -56
- gstaichi/profiler/__init__.py +6 -0
- {taichi → gstaichi}/profiler/kernel_metrics.py +11 -11
- {taichi → gstaichi}/profiler/kernel_profiler.py +30 -36
- {taichi → gstaichi}/profiler/memory_profiler.py +1 -1
- {taichi → gstaichi}/profiler/scoped_profiler.py +2 -2
- {taichi → gstaichi}/sparse/_sparse_grid.py +7 -7
- {taichi → gstaichi}/tools/__init__.py +4 -4
- {taichi → gstaichi}/tools/diagnose.py +10 -17
- gstaichi/types/__init__.py +19 -0
- {taichi → gstaichi}/types/annotations.py +1 -1
- {taichi → gstaichi}/types/compound_types.py +8 -8
- {taichi → gstaichi}/types/enums.py +1 -1
- {taichi → gstaichi}/types/ndarray_type.py +7 -7
- {taichi → gstaichi}/types/primitive_types.py +17 -14
- {taichi → gstaichi}/types/quant.py +9 -9
- {taichi → gstaichi}/types/texture_type.py +5 -5
- {taichi → gstaichi}/types/utils.py +1 -1
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/bin/SPIRV-Tools-shared.dll +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/SPIRV-Tools-diff.lib +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/SPIRV-Tools-link.lib +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/SPIRV-Tools-lint.lib +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/SPIRV-Tools-opt.lib +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/SPIRV-Tools-reduce.lib +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/SPIRV-Tools-shared.lib +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/SPIRV-Tools.lib +0 -0
- {gstaichi-0.1.23.dev0.dist-info → gstaichi-0.1.25.dev0.dist-info}/METADATA +13 -16
- gstaichi-0.1.25.dev0.dist-info/RECORD +138 -0
- gstaichi-0.1.25.dev0.dist-info/entry_points.txt +2 -0
- gstaichi-0.1.25.dev0.dist-info/top_level.txt +1 -0
- gstaichi-0.1.23.dev0.data/data/include/GLFW/glfw3.h +0 -6389
- gstaichi-0.1.23.dev0.data/data/include/GLFW/glfw3native.h +0 -594
- gstaichi-0.1.23.dev0.data/data/lib/cmake/glfw3/glfw3Config.cmake +0 -3
- gstaichi-0.1.23.dev0.data/data/lib/cmake/glfw3/glfw3ConfigVersion.cmake +0 -65
- gstaichi-0.1.23.dev0.data/data/lib/cmake/glfw3/glfw3Targets-release.cmake +0 -19
- gstaichi-0.1.23.dev0.data/data/lib/cmake/glfw3/glfw3Targets.cmake +0 -107
- gstaichi-0.1.23.dev0.data/data/lib/glfw3.lib +0 -0
- gstaichi-0.1.23.dev0.dist-info/RECORD +0 -198
- gstaichi-0.1.23.dev0.dist-info/entry_points.txt +0 -2
- gstaichi-0.1.23.dev0.dist-info/top_level.txt +0 -1
- taichi/CHANGELOG.md +0 -20
- taichi/_lib/__init__.py +0 -3
- taichi/_lib/c_api/bin/taichi_c_api.dll +0 -0
- taichi/_lib/c_api/include/taichi/cpp/taichi.hpp +0 -1401
- taichi/_lib/c_api/include/taichi/taichi.h +0 -29
- taichi/_lib/c_api/include/taichi/taichi_core.h +0 -1111
- taichi/_lib/c_api/include/taichi/taichi_cpu.h +0 -29
- taichi/_lib/c_api/include/taichi/taichi_cuda.h +0 -36
- taichi/_lib/c_api/include/taichi/taichi_platform.h +0 -55
- taichi/_lib/c_api/include/taichi/taichi_unity.h +0 -64
- taichi/_lib/c_api/include/taichi/taichi_vulkan.h +0 -151
- taichi/_lib/c_api/lib/taichi_c_api.lib +0 -0
- taichi/_lib/c_api/runtime/runtime_cuda.bc +0 -0
- taichi/_lib/c_api/runtime/runtime_x64.bc +0 -0
- taichi/_lib/c_api/taichi/lib/cmake/taichi/TaichiConfig.cmake +0 -29
- taichi/_lib/c_api/taichi/lib/cmake/taichi/TaichiConfigVersion.cmake +0 -65
- taichi/_lib/c_api/taichi/lib/cmake/taichi/TaichiTargets.cmake +0 -121
- taichi/_lib/runtime/slim_libdevice.10.bc +0 -0
- taichi/_snode/__init__.py +0 -5
- taichi/_ti_module/__init__.py +0 -3
- taichi/_ti_module/cppgen.py +0 -309
- taichi/_ti_module/module.py +0 -145
- taichi/_version.py +0 -1
- taichi/ad/__init__.py +0 -3
- taichi/aot/__init__.py +0 -12
- taichi/aot/_export.py +0 -28
- taichi/aot/conventions/__init__.py +0 -3
- taichi/aot/conventions/gfxruntime140/__init__.py +0 -38
- taichi/aot/conventions/gfxruntime140/dr.py +0 -244
- taichi/aot/conventions/gfxruntime140/sr.py +0 -613
- taichi/aot/module.py +0 -253
- taichi/aot/utils.py +0 -151
- taichi/graph/__init__.py +0 -3
- taichi/graph/_graph.py +0 -292
- taichi/lang/__init__.py +0 -50
- taichi/lang/ast/__init__.py +0 -5
- taichi/lang/ast/transform.py +0 -9
- taichi/lang/exception.py +0 -80
- taichi/linalg/__init__.py +0 -8
- taichi/profiler/__init__.py +0 -6
- taichi/shaders/Circles_vk.frag +0 -29
- taichi/shaders/Circles_vk.vert +0 -45
- taichi/shaders/Circles_vk_frag.spv +0 -0
- taichi/shaders/Circles_vk_vert.spv +0 -0
- taichi/shaders/Lines_vk.frag +0 -9
- taichi/shaders/Lines_vk.vert +0 -11
- taichi/shaders/Lines_vk_frag.spv +0 -0
- taichi/shaders/Lines_vk_vert.spv +0 -0
- taichi/shaders/Mesh_vk.frag +0 -71
- taichi/shaders/Mesh_vk.vert +0 -68
- taichi/shaders/Mesh_vk_frag.spv +0 -0
- taichi/shaders/Mesh_vk_vert.spv +0 -0
- taichi/shaders/Particles_vk.frag +0 -95
- taichi/shaders/Particles_vk.vert +0 -73
- taichi/shaders/Particles_vk_frag.spv +0 -0
- taichi/shaders/Particles_vk_vert.spv +0 -0
- taichi/shaders/SceneLines2quad_vk_comp.spv +0 -0
- taichi/shaders/SceneLines_vk.frag +0 -9
- taichi/shaders/SceneLines_vk.vert +0 -12
- taichi/shaders/SceneLines_vk_frag.spv +0 -0
- taichi/shaders/SceneLines_vk_vert.spv +0 -0
- taichi/shaders/SetImage_vk.frag +0 -21
- taichi/shaders/SetImage_vk.vert +0 -15
- taichi/shaders/SetImage_vk_frag.spv +0 -0
- taichi/shaders/SetImage_vk_vert.spv +0 -0
- taichi/shaders/Triangles_vk.frag +0 -16
- taichi/shaders/Triangles_vk.vert +0 -29
- taichi/shaders/Triangles_vk_frag.spv +0 -0
- taichi/shaders/Triangles_vk_vert.spv +0 -0
- taichi/shaders/lines2quad_vk_comp.spv +0 -0
- taichi/types/__init__.py +0 -19
- {taichi → gstaichi}/__main__.py +0 -0
- {taichi → gstaichi}/_lib/core/__init__.py +0 -0
- {taichi → gstaichi}/_lib/core/py.typed +0 -0
- {taichi/_lib/c_api → gstaichi/_lib}/runtime/slim_libdevice.10.bc +0 -0
- {taichi → gstaichi}/algorithms/__init__.py +0 -0
- {taichi → gstaichi}/assets/.git +0 -0
- {taichi → gstaichi}/assets/Go-Regular.ttf +0 -0
- {taichi → gstaichi}/assets/static/imgs/ti_gallery.png +0 -0
- {taichi → gstaichi}/lang/ast/symbol_resolver.py +0 -0
- {taichi → gstaichi}/sparse/__init__.py +0 -0
- {taichi → gstaichi}/tools/np2ply.py +0 -0
- {taichi → gstaichi}/tools/vtk.py +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools/cmake/SPIRV-ToolsConfig.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools/cmake/SPIRV-ToolsTarget-release.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools/cmake/SPIRV-ToolsTarget.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-diff/cmake/SPIRV-Tools-diffConfig.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-diff/cmake/SPIRV-Tools-diffTargets-release.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-diff/cmake/SPIRV-Tools-diffTargets.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-link/cmake/SPIRV-Tools-linkConfig.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-link/cmake/SPIRV-Tools-linkTargets-release.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-link/cmake/SPIRV-Tools-linkTargets.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-lint/cmake/SPIRV-Tools-lintConfig.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-lint/cmake/SPIRV-Tools-lintTargets-release.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-lint/cmake/SPIRV-Tools-lintTargets.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-opt/cmake/SPIRV-Tools-optConfig.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-opt/cmake/SPIRV-Tools-optTargets-release.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-opt/cmake/SPIRV-Tools-optTargets.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-reduce/cmake/SPIRV-Tools-reduceConfig.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-reduce/cmake/SPIRV-Tools-reduceTarget-release.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-reduce/cmake/SPIRV-Tools-reduceTarget.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv-tools/instrument.hpp +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv-tools/libspirv.h +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv-tools/libspirv.hpp +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv-tools/linker.hpp +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv-tools/optimizer.hpp +0 -0
- {gstaichi-0.1.23.dev0.dist-info → gstaichi-0.1.25.dev0.dist-info}/WHEEL +0 -0
- {gstaichi-0.1.23.dev0.dist-info → gstaichi-0.1.25.dev0.dist-info}/licenses/LICENSE +0 -0
@@ -1,12 +1,12 @@
|
|
1
1
|
# type: ignore
|
2
2
|
|
3
|
-
from
|
4
|
-
from
|
5
|
-
from
|
6
|
-
from
|
7
|
-
from
|
8
|
-
from
|
9
|
-
from
|
3
|
+
from gstaichi.lang.impl import grouped, root, static
|
4
|
+
from gstaichi.lang.kernel_impl import kernel
|
5
|
+
from gstaichi.lang.misc import ij, ijk
|
6
|
+
from gstaichi.lang.snode import is_active
|
7
|
+
from gstaichi.lang.struct import Struct
|
8
|
+
from gstaichi.types.annotations import template
|
9
|
+
from gstaichi.types.primitive_types import f32
|
10
10
|
|
11
11
|
|
12
12
|
def grid(field_dict, shape):
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# type: ignore
|
2
2
|
|
3
|
-
"""
|
3
|
+
"""GsTaichi utility module.
|
4
4
|
|
5
5
|
- `image` submodule for image io.
|
6
6
|
- `video` submodule for exporting results to video files.
|
7
7
|
- `diagnose` submodule for printing system environment information.
|
8
8
|
"""
|
9
9
|
|
10
|
-
from
|
11
|
-
from
|
12
|
-
from
|
10
|
+
from gstaichi.tools.diagnose import *
|
11
|
+
from gstaichi.tools.np2ply import *
|
12
|
+
from gstaichi.tools.vtk import *
|
@@ -8,7 +8,7 @@ import sys
|
|
8
8
|
|
9
9
|
|
10
10
|
def main():
|
11
|
-
print("
|
11
|
+
print("GsTaichi system diagnose:")
|
12
12
|
print("")
|
13
13
|
executable = sys.executable
|
14
14
|
|
@@ -38,7 +38,7 @@ def main():
|
|
38
38
|
|
39
39
|
def try_print(tag, expr):
|
40
40
|
try:
|
41
|
-
cmd = f'import
|
41
|
+
cmd = f'import gstaichi as ti; print("===="); print({expr}, end="")'
|
42
42
|
ret = subprocess.check_output([executable, "-c", cmd]).decode()
|
43
43
|
ret = ret.split("====" + os.linesep, maxsplit=1)[1]
|
44
44
|
print(f"{tag}: {ret}")
|
@@ -48,7 +48,7 @@ def main():
|
|
48
48
|
print("")
|
49
49
|
try_print("import", "ti")
|
50
50
|
print("")
|
51
|
-
for arch in ["cpu", "metal", "
|
51
|
+
for arch in ["cpu", "metal", "cuda", "vulkan"]:
|
52
52
|
try_print(arch, f"ti.lang.misc.is_arch_supported(ti.{arch})")
|
53
53
|
print("")
|
54
54
|
|
@@ -81,37 +81,30 @@ def main():
|
|
81
81
|
print(f"{nvidia_smi.decode()}")
|
82
82
|
|
83
83
|
try:
|
84
|
-
ti_header = subprocess.check_output([executable, "-c", "import
|
84
|
+
ti_header = subprocess.check_output([executable, "-c", "import gstaichi"])
|
85
85
|
except Exception as e:
|
86
|
-
print(f"`import
|
86
|
+
print(f"`import gstaichi` failed: {e}")
|
87
87
|
else:
|
88
88
|
print(f"{ti_header.decode()}")
|
89
89
|
|
90
90
|
try:
|
91
|
-
ti_init_test = subprocess.check_output([executable, "-c", "import
|
91
|
+
ti_init_test = subprocess.check_output([executable, "-c", "import gstaichi as ti; ti.init()"])
|
92
92
|
except Exception as e:
|
93
93
|
print(f"`ti.init()` failed: {e}")
|
94
94
|
else:
|
95
95
|
print(f"{ti_init_test.decode()}")
|
96
96
|
|
97
97
|
try:
|
98
|
-
|
98
|
+
ti_cuda_test = subprocess.check_output([executable, "-c", "import gstaichi as ti; ti.init(arch=ti.cuda)"])
|
99
99
|
except Exception as e:
|
100
|
-
print(f"
|
101
|
-
else:
|
102
|
-
print(f"{ti_opengl_test.decode()}")
|
103
|
-
|
104
|
-
try:
|
105
|
-
ti_cuda_test = subprocess.check_output([executable, "-c", "import taichi as ti; ti.init(arch=ti.cuda)"])
|
106
|
-
except Exception as e:
|
107
|
-
print(f"Taichi CUDA test failed: {e}")
|
100
|
+
print(f"GsTaichi CUDA test failed: {e}")
|
108
101
|
else:
|
109
102
|
print(f"{ti_cuda_test.decode()}")
|
110
103
|
|
111
104
|
try:
|
112
|
-
ti_laplace = subprocess.check_output([executable, "-m", "
|
105
|
+
ti_laplace = subprocess.check_output([executable, "-m", "gstaichi", "example", "minimal"])
|
113
106
|
except Exception as e:
|
114
|
-
print(f"`python/
|
107
|
+
print(f"`python/gstaichi/examples/algorithm/laplace.py` failed: {e}")
|
115
108
|
else:
|
116
109
|
print(f"{ti_laplace.decode()}")
|
117
110
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# type: ignore
|
2
|
+
|
3
|
+
"""
|
4
|
+
This module defines data types in GsTaichi:
|
5
|
+
|
6
|
+
- primitive: int, float, etc.
|
7
|
+
- compound: matrix, vector, struct.
|
8
|
+
- template: for reference types.
|
9
|
+
- ndarray: for arbitrary arrays.
|
10
|
+
- quant: for quantized types, see "https://yuanming.gstaichi.graphics/publication/2021-quangstaichi/quangstaichi.pdf"
|
11
|
+
"""
|
12
|
+
|
13
|
+
from gstaichi.types import quant
|
14
|
+
from gstaichi.types.annotations import *
|
15
|
+
from gstaichi.types.compound_types import *
|
16
|
+
from gstaichi.types.ndarray_type import *
|
17
|
+
from gstaichi.types.primitive_types import *
|
18
|
+
from gstaichi.types.texture_type import *
|
19
|
+
from gstaichi.types.utils import *
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# type: ignore
|
2
2
|
|
3
|
-
import
|
4
|
-
from
|
3
|
+
import gstaichi
|
4
|
+
from gstaichi._lib.utils import ti_python_core as _ti_python_core
|
5
5
|
|
6
6
|
_type_factory = _ti_python_core.get_type_factory_instance()
|
7
7
|
|
@@ -18,7 +18,7 @@ def matrix(n=None, m=None, dtype=None):
|
|
18
18
|
Args:
|
19
19
|
n (int): number of rows of the matrix.
|
20
20
|
m (int): number of columns of the matrix.
|
21
|
-
dtype (:mod:`~
|
21
|
+
dtype (:mod:`~gstaichi.types.primitive_types`): matrix data type.
|
22
22
|
|
23
23
|
Returns:
|
24
24
|
A matrix type.
|
@@ -28,7 +28,7 @@ def matrix(n=None, m=None, dtype=None):
|
|
28
28
|
>>> mat2x2 = ti.types.matrix(2, 2, ti.f32) # 2x2 matrix type
|
29
29
|
>>> M = mat2x2([[1., 2.], [3., 4.]]) # an instance of this type
|
30
30
|
"""
|
31
|
-
return
|
31
|
+
return gstaichi.lang.matrix.MatrixType(n, m, 2, dtype)
|
32
32
|
|
33
33
|
|
34
34
|
def vector(n=None, dtype=None):
|
@@ -36,7 +36,7 @@ def vector(n=None, dtype=None):
|
|
36
36
|
|
37
37
|
Args:
|
38
38
|
n (int): dimension of the vector.
|
39
|
-
dtype (:mod:`~
|
39
|
+
dtype (:mod:`~gstaichi.types.primitive_types`): vector data type.
|
40
40
|
|
41
41
|
Returns:
|
42
42
|
A vector type.
|
@@ -46,7 +46,7 @@ def vector(n=None, dtype=None):
|
|
46
46
|
>>> vec3 = ti.types.vector(3, ti.f32) # 3d vector type
|
47
47
|
>>> v = vec3([1., 2., 3.]) # an instance of this type
|
48
48
|
"""
|
49
|
-
return
|
49
|
+
return gstaichi.lang.matrix.VectorType(n, dtype)
|
50
50
|
|
51
51
|
|
52
52
|
def struct(**kwargs):
|
@@ -65,7 +65,7 @@ def struct(**kwargs):
|
|
65
65
|
>>> sphere = ti.types.struct(center=vec3, radius=float)
|
66
66
|
>>> s = sphere(center=vec3([0., 0., 0.]), radius=1.0)
|
67
67
|
"""
|
68
|
-
return
|
68
|
+
return gstaichi.lang.struct.StructType(**kwargs)
|
69
69
|
|
70
70
|
|
71
71
|
def argpack(**kwargs):
|
@@ -84,7 +84,7 @@ def argpack(**kwargs):
|
|
84
84
|
>>> sphere = ti.types.argpack(center=vec3, radius=float)
|
85
85
|
>>> s = sphere(center=vec3([0., 0., 0.]), radius=1.0)
|
86
86
|
"""
|
87
|
-
return
|
87
|
+
return gstaichi.lang.argpack.ArgPackType(**kwargs)
|
88
88
|
|
89
89
|
|
90
90
|
__all__ = ["matrix", "vector", "struct", "argpack"]
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# type: ignore
|
2
2
|
|
3
|
-
from
|
4
|
-
from
|
3
|
+
from gstaichi.types.compound_types import CompoundType, matrix, vector
|
4
|
+
from gstaichi.types.enums import Layout, to_boundary_enum
|
5
5
|
|
6
6
|
|
7
7
|
class NdarrayTypeMetadata:
|
@@ -47,10 +47,10 @@ def _make_matrix_dtype_from_element_shape(element_dim, element_shape, primitive_
|
|
47
47
|
|
48
48
|
|
49
49
|
class NdarrayType:
|
50
|
-
"""Type annotation for arbitrary arrays, including external arrays (numpy ndarrays and torch tensors) and
|
50
|
+
"""Type annotation for arbitrary arrays, including external arrays (numpy ndarrays and torch tensors) and GsTaichi ndarrays.
|
51
51
|
|
52
|
-
For external arrays, we treat it as a
|
53
|
-
For
|
52
|
+
For external arrays, we treat it as a GsTaichi data container with Scalar, Vector or Matrix elements.
|
53
|
+
For GsTaichi vector/matrix ndarrays, we will automatically identify element dimension and their corresponding axis by the dimension of datatype, say scalars, matrices or vectors.
|
54
54
|
For example, given type annotation `ti.types.ndarray(dtype=ti.math.vec3)`, a numpy array `np.zeros(10, 10, 3)` will be recognized as a 10x10 matrix composed of vec3 elements.
|
55
55
|
|
56
56
|
Args:
|
@@ -100,7 +100,7 @@ class NdarrayType:
|
|
100
100
|
else:
|
101
101
|
if self.dtype is not None:
|
102
102
|
# Check dtype match for scalar.
|
103
|
-
from
|
103
|
+
from gstaichi.lang import util # pylint: disable=C0415
|
104
104
|
|
105
105
|
if not util.cook_dtype(self.dtype) == ndarray_type.element_type:
|
106
106
|
raise TypeError(
|
@@ -129,7 +129,7 @@ class NdarrayType:
|
|
129
129
|
|
130
130
|
ndarray = NdarrayType
|
131
131
|
NDArray = NdarrayType
|
132
|
-
"""Alias for :class:`~
|
132
|
+
"""Alias for :class:`~gstaichi.types.ndarray_type.NdarrayType`.
|
133
133
|
|
134
134
|
Example::
|
135
135
|
|
@@ -1,6 +1,6 @@
|
|
1
|
-
|
1
|
+
from typing import Union
|
2
2
|
|
3
|
-
from
|
3
|
+
from gstaichi._lib import core as ti_python_core
|
4
4
|
|
5
5
|
# ========================================
|
6
6
|
# real types
|
@@ -14,7 +14,7 @@ float16 = ti_python_core.DataType_f16
|
|
14
14
|
# ----------------------------------------
|
15
15
|
|
16
16
|
f16 = float16
|
17
|
-
"""Alias for :const:`~
|
17
|
+
"""Alias for :const:`~gstaichi.types.primitive_types.float16`
|
18
18
|
"""
|
19
19
|
|
20
20
|
# ----------------------------------------
|
@@ -26,7 +26,7 @@ float32 = ti_python_core.DataType_f32
|
|
26
26
|
# ----------------------------------------
|
27
27
|
|
28
28
|
f32 = float32
|
29
|
-
"""Alias for :const:`~
|
29
|
+
"""Alias for :const:`~gstaichi.types.primitive_types.float32`
|
30
30
|
"""
|
31
31
|
|
32
32
|
# ----------------------------------------
|
@@ -38,7 +38,7 @@ float64 = ti_python_core.DataType_f64
|
|
38
38
|
# ----------------------------------------
|
39
39
|
|
40
40
|
f64 = float64
|
41
|
-
"""Alias for :const:`~
|
41
|
+
"""Alias for :const:`~gstaichi.types.primitive_types.float64`
|
42
42
|
"""
|
43
43
|
# ----------------------------------------
|
44
44
|
|
@@ -54,7 +54,7 @@ int8 = ti_python_core.DataType_i8
|
|
54
54
|
# ----------------------------------------
|
55
55
|
|
56
56
|
i8 = int8
|
57
|
-
"""Alias for :const:`~
|
57
|
+
"""Alias for :const:`~gstaichi.types.primitive_types.int8`
|
58
58
|
"""
|
59
59
|
|
60
60
|
# ----------------------------------------
|
@@ -66,7 +66,7 @@ int16 = ti_python_core.DataType_i16
|
|
66
66
|
# ----------------------------------------
|
67
67
|
|
68
68
|
i16 = int16
|
69
|
-
"""Alias for :const:`~
|
69
|
+
"""Alias for :const:`~gstaichi.types.primitive_types.int16`
|
70
70
|
"""
|
71
71
|
|
72
72
|
# ----------------------------------------
|
@@ -78,7 +78,7 @@ int32 = ti_python_core.DataType_i32
|
|
78
78
|
# ----------------------------------------
|
79
79
|
|
80
80
|
i32 = int32
|
81
|
-
"""Alias for :const:`~
|
81
|
+
"""Alias for :const:`~gstaichi.types.primitive_types.int32`
|
82
82
|
"""
|
83
83
|
|
84
84
|
# ----------------------------------------
|
@@ -90,7 +90,7 @@ int64 = ti_python_core.DataType_i64
|
|
90
90
|
# ----------------------------------------
|
91
91
|
|
92
92
|
i64 = int64
|
93
|
-
"""Alias for :const:`~
|
93
|
+
"""Alias for :const:`~gstaichi.types.primitive_types.int64`
|
94
94
|
"""
|
95
95
|
|
96
96
|
# ----------------------------------------
|
@@ -108,13 +108,13 @@ uint1 = ti_python_core.DataType_u1
|
|
108
108
|
# ----------------------------------------
|
109
109
|
|
110
110
|
u1 = uint1
|
111
|
-
"""Alias for :const:`~
|
111
|
+
"""Alias for :const:`~gstaichi.types.primitive_types.uint1`
|
112
112
|
"""
|
113
113
|
|
114
114
|
# ----------------------------------------
|
115
115
|
|
116
116
|
u8 = uint8
|
117
|
-
"""Alias for :const:`~
|
117
|
+
"""Alias for :const:`~gstaichi.types.primitive_types.uint8`
|
118
118
|
"""
|
119
119
|
|
120
120
|
# ----------------------------------------
|
@@ -126,7 +126,7 @@ uint16 = ti_python_core.DataType_u16
|
|
126
126
|
# ----------------------------------------
|
127
127
|
|
128
128
|
u16 = uint16
|
129
|
-
"""Alias for :const:`~
|
129
|
+
"""Alias for :const:`~gstaichi.types.primitive_types.uint16`
|
130
130
|
"""
|
131
131
|
|
132
132
|
# ----------------------------------------
|
@@ -138,7 +138,7 @@ uint32 = ti_python_core.DataType_u32
|
|
138
138
|
# ----------------------------------------
|
139
139
|
|
140
140
|
u32 = uint32
|
141
|
-
"""Alias for :const:`~
|
141
|
+
"""Alias for :const:`~gstaichi.types.primitive_types.uint32`
|
142
142
|
"""
|
143
143
|
|
144
144
|
# ----------------------------------------
|
@@ -150,7 +150,7 @@ uint64 = ti_python_core.DataType_u64
|
|
150
150
|
# ----------------------------------------
|
151
151
|
|
152
152
|
u64 = uint64
|
153
|
-
"""Alias for :const:`~
|
153
|
+
"""Alias for :const:`~gstaichi.types.primitive_types.uint64`
|
154
154
|
"""
|
155
155
|
|
156
156
|
# ----------------------------------------
|
@@ -174,6 +174,8 @@ integer_type_ids = [id(t) for t in integer_types]
|
|
174
174
|
all_types = real_types + integer_types
|
175
175
|
type_ids = [id(t) for t in all_types]
|
176
176
|
|
177
|
+
_python_primitive_types = Union[int, float, bool, str, None]
|
178
|
+
|
177
179
|
__all__ = [
|
178
180
|
"float32",
|
179
181
|
"f32",
|
@@ -200,4 +202,5 @@ __all__ = [
|
|
200
202
|
"uint64",
|
201
203
|
"u64",
|
202
204
|
"ref",
|
205
|
+
"_python_primitive_types",
|
203
206
|
]
|
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
"""
|
4
4
|
This module defines generators of quantized types.
|
5
|
-
For more details, read https://yuanming.
|
5
|
+
For more details, read https://yuanming.gstaichi.graphics/publication/2021-quangstaichi/quangstaichi.pdf.
|
6
6
|
"""
|
7
7
|
|
8
|
-
from
|
9
|
-
from
|
8
|
+
from gstaichi._lib.utils import ti_python_core as _ti_python_core
|
9
|
+
from gstaichi.types.primitive_types import i32
|
10
10
|
|
11
11
|
_type_factory = _ti_python_core.get_type_factory_instance()
|
12
12
|
|
@@ -23,10 +23,10 @@ def int(bits, signed=True, compute=None): # pylint: disable=W0622
|
|
23
23
|
DataType: The specified type.
|
24
24
|
"""
|
25
25
|
if compute is None:
|
26
|
-
from
|
26
|
+
from gstaichi.lang import impl # pylint: disable=C0415
|
27
27
|
|
28
28
|
compute = impl.get_runtime().default_ip if signed else impl.get_runtime().default_up
|
29
|
-
if isinstance(compute, _ti_python_core.
|
29
|
+
if isinstance(compute, _ti_python_core.DataTypeCxx):
|
30
30
|
compute = compute.get_ptr()
|
31
31
|
return _type_factory.get_quant_int_type(bits, signed, compute)
|
32
32
|
|
@@ -45,10 +45,10 @@ def fixed(bits, signed=True, max_value=1.0, compute=None, scale=None):
|
|
45
45
|
DataType: The specified type.
|
46
46
|
"""
|
47
47
|
if compute is None:
|
48
|
-
from
|
48
|
+
from gstaichi.lang import impl # pylint: disable=C0415
|
49
49
|
|
50
50
|
compute = impl.get_runtime().default_fp
|
51
|
-
if isinstance(compute, _ti_python_core.
|
51
|
+
if isinstance(compute, _ti_python_core.DataTypeCxx):
|
52
52
|
compute = compute.get_ptr()
|
53
53
|
# TODO: handle cases with bits > 32
|
54
54
|
underlying_type = int(bits=bits, signed=signed, compute=i32)
|
@@ -73,10 +73,10 @@ def float(exp, frac, signed=True, compute=None): # pylint: disable=W0622
|
|
73
73
|
DataType: The specified type.
|
74
74
|
"""
|
75
75
|
if compute is None:
|
76
|
-
from
|
76
|
+
from gstaichi.lang import impl # pylint: disable=C0415
|
77
77
|
|
78
78
|
compute = impl.get_runtime().default_fp
|
79
|
-
if isinstance(compute, _ti_python_core.
|
79
|
+
if isinstance(compute, _ti_python_core.DataTypeCxx):
|
80
80
|
compute = compute.get_ptr()
|
81
81
|
# Exponent is always unsigned
|
82
82
|
exp_type = int(bits=exp, signed=False, compute=i32)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# type: ignore
|
2
2
|
|
3
|
-
from
|
4
|
-
from
|
5
|
-
from
|
3
|
+
from gstaichi.lang.exception import GsTaichiCompilationError
|
4
|
+
from gstaichi.types.enums import Format
|
5
|
+
from gstaichi.types.primitive_types import f16, f32, i8, i16, i32, u8, u16, u32
|
6
6
|
|
7
7
|
FORMAT2TY_CH = {
|
8
8
|
Format.r8: (u8, 1),
|
@@ -71,7 +71,7 @@ class RWTextureType:
|
|
71
71
|
def __init__(self, num_dimensions, lod=0, fmt=None):
|
72
72
|
self.num_dimensions = num_dimensions
|
73
73
|
if fmt is None:
|
74
|
-
raise
|
74
|
+
raise GsTaichiCompilationError("fmt is required for rw_texture type")
|
75
75
|
else:
|
76
76
|
self.fmt = fmt
|
77
77
|
self.lod = lod
|
@@ -79,7 +79,7 @@ class RWTextureType:
|
|
79
79
|
|
80
80
|
texture = TextureType
|
81
81
|
rw_texture = RWTextureType
|
82
|
-
"""Alias for :class:`~
|
82
|
+
"""Alias for :class:`~gstaichi.types.ndarray_type.TextureType`.
|
83
83
|
"""
|
84
84
|
|
85
85
|
__all__ = ["texture", "rw_texture"]
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,9 +1,9 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: gstaichi
|
3
|
-
Version: 0.1.
|
4
|
-
Summary: The
|
5
|
-
Home-page: https://github.com/Genesis-Embedded-AI/
|
6
|
-
Author:
|
3
|
+
Version: 0.1.25.dev0
|
4
|
+
Summary: The GsTaichi Programming Language
|
5
|
+
Home-page: https://github.com/Genesis-Embedded-AI/gstaichi
|
6
|
+
Author: GsTaichi developers
|
7
7
|
License: Apache Software License (http://www.apache.org/licenses/LICENSE-2.0)
|
8
8
|
Keywords: graphics,simulation
|
9
9
|
Classifier: Development Status :: 5 - Production/Stable
|
@@ -47,16 +47,15 @@ Dynamic: requires-dist
|
|
47
47
|
Dynamic: requires-python
|
48
48
|
Dynamic: summary
|
49
49
|
|
50
|
-
#
|
50
|
+
# GsTaichi
|
51
51
|
|
52
|
-
[
|
52
|
+
[GsTaichi](https://github.com/Genesis-Embodied-AI/gstaichi) was forked in June 2025. This repository (or gstaichi) is now a fully independent project with no intention of maintaining backward compatibility with the original taichi. Whilst the repo largely resembles upstream for now, we have made the following changes:
|
53
53
|
- revamped continuous integration, to run using recent python versions (up to 3.13), recent mac os x versions (up to 15), and to run reliably (at least 95% of runs with correct code succeed)
|
54
54
|
- added dataclasses.dataclass structs:
|
55
55
|
- work with both ndarrays and fields (cf ti.struct (field only), ti.dataclass (field only), ti.data_oriented (field only), argpack (ndarray only))
|
56
56
|
- can be passed into child `ti.func`tions (cf argpack)
|
57
57
|
- does not affect kernel runtime speed (kernels see only the underlying arrays, no indirection is added within the kernel layer)
|
58
|
-
- removed GUI/GGUI
|
59
|
-
- upgraded supported OS and Python versions (eg added support for Python 3.13)
|
58
|
+
- removed GUI/GGUI, C-API, AOT, DX11, DX12, IOS, Android, OpenGL, GLES
|
60
59
|
|
61
60
|
Planned features:
|
62
61
|
- reduce warm cache launch latency
|
@@ -66,19 +65,17 @@ Planned features:
|
|
66
65
|
Planned pruning:
|
67
66
|
- remove argpack
|
68
67
|
- remove ti CLI
|
69
|
-
- remove OpenGL (please use Vulkan)
|
70
|
-
- remove mobile device support (Android etc)
|
71
68
|
- remove support for NVidia GPUs earlier than sm_60/Pascal
|
72
69
|
|
73
|
-
# What is
|
70
|
+
# What is gstaichi?
|
74
71
|
|
75
|
-
|
72
|
+
GsTaichi is a high performance multi-platform compiler, targeted at physics simulations. It compiles Python code into parallelizable kernels that can run on:
|
76
73
|
- NVidia GPUs, using CUDA
|
77
74
|
- Vulkan-compatible GPUs, using SPIR-V
|
78
75
|
- Mac Metal GPUs
|
79
76
|
- x86 and arm64 CPUs
|
80
77
|
|
81
|
-
|
78
|
+
GsTaichi supports automatic differentiation. GsTaichi lets you build fully fused GPU kernels, using Python.
|
82
79
|
|
83
80
|
[Genesis simulator](https://genesis-world.readthedocs.io/en/latest/)'s best-in-class performance can be largely attributed to Taichi, its underlying GPU acceleration framework for Python. Given how critical is this component, we decided to fork Taichi and build our own very framework from there, so that from now on, we are free to drive its development in the direction that best supports the continuous improvement of Genesis simulator.
|
84
81
|
|
@@ -89,7 +86,7 @@ GS-Taichi supports automatic differentiation. GS-Taichi lets you build fully fus
|
|
89
86
|
|
90
87
|
## Procedure
|
91
88
|
```
|
92
|
-
pip install
|
89
|
+
pip install gstaichi
|
93
90
|
```
|
94
91
|
|
95
92
|
(For how to build from source, see our CI build scripts, e.g. [linux build scripts](.github/workflows/scripts_new/linux_x86/) )
|
@@ -97,11 +94,11 @@ pip install gs-taichi
|
|
97
94
|
# Documentation
|
98
95
|
|
99
96
|
- [docs](docs/lang/articles)
|
100
|
-
- [API reference](https://ideal-adventure-2n6lpyw.pages.github.io/
|
97
|
+
- [API reference](https://ideal-adventure-2n6lpyw.pages.github.io/gstaichi.html)
|
101
98
|
|
102
99
|
# Something is broken!
|
103
100
|
|
104
|
-
- [Create an issue](https://github.com/Genesis-Embodied-AI/
|
101
|
+
- [Create an issue](https://github.com/Genesis-Embodied-AI/gstaichi/issues/new/choose)
|
105
102
|
|
106
103
|
# Acknowledgements
|
107
104
|
|