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.
- gstaichi/CHANGELOG.md +6 -0
- gstaichi/__init__.py +40 -0
- {taichi → gstaichi}/_funcs.py +8 -8
- {taichi → gstaichi}/_kernels.py +19 -19
- gstaichi/_lib/__init__.py +3 -0
- taichi/_lib/core/taichi_python.cpython-310-darwin.so → gstaichi/_lib/core/gstaichi_python.cpython-310-darwin.so +0 -0
- taichi/_lib/core/taichi_python.pyi → gstaichi/_lib/core/gstaichi_python.pyi +382 -520
- {taichi → gstaichi}/_lib/runtime/runtime_arm64.bc +0 -0
- {taichi → gstaichi}/_lib/utils.py +15 -15
- {taichi → gstaichi}/_logging.py +1 -1
- 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.dist-info → gstaichi-1.0.1.dist-info}/METADATA +13 -16
- gstaichi-1.0.1.dist-info/RECORD +166 -0
- gstaichi-1.0.1.dist-info/top_level.txt +1 -0
- gstaichi-0.1.23.dev0.dist-info/RECORD +0 -219
- 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/__init__.py +0 -44
- taichi/__main__.py +0 -5
- taichi/_lib/__init__.py +0 -3
- 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_metal.h +0 -72
- 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/libtaichi_c_api.dylib +0 -0
- taichi/_lib/c_api/runtime/runtime_arm64.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/libMoltenVK.dylib +0 -0
- taichi/_main.py +0 -552
- 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}/_lib/core/__init__.py +0 -0
- {taichi → gstaichi}/_lib/core/py.typed +0 -0
- {taichi/_lib/c_api → gstaichi/_lib}/runtime/libMoltenVK.dylib +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-1.0.1.data}/data/include/GLFW/glfw3.h +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/GLFW/glfw3native.h +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv-tools/instrument.hpp +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv-tools/libspirv.h +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv-tools/libspirv.hpp +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv-tools/linker.hpp +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv-tools/optimizer.hpp +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/GLSL.std.450.h +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv.h +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv.hpp +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_cfg.hpp +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_common.hpp +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_cpp.hpp +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_cross.hpp +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_cross_c.h +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_cross_containers.hpp +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_cross_error_handling.hpp +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_cross_parsed_ir.hpp +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_cross_util.hpp +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_glsl.hpp +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_hlsl.hpp +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_msl.hpp +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_parser.hpp +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv_cross/spirv_reflect.hpp +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools/SPIRV-ToolsConfig.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools/SPIRV-ToolsTarget-release.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools/SPIRV-ToolsTarget.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-diff/SPIRV-Tools-diffConfig.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-diff/SPIRV-Tools-diffTargets-release.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-diff/SPIRV-Tools-diffTargets.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-link/SPIRV-Tools-linkConfig.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-link/SPIRV-Tools-linkTargets-release.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-link/SPIRV-Tools-linkTargets.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-lint/SPIRV-Tools-lintConfig.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-lint/SPIRV-Tools-lintTargets-release.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-lint/SPIRV-Tools-lintTargets.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-opt/SPIRV-Tools-optConfig.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-opt/SPIRV-Tools-optTargets-release.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-opt/SPIRV-Tools-optTargets.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-reduce/SPIRV-Tools-reduceConfig.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-reduce/SPIRV-Tools-reduceTarget-release.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/SPIRV-Tools-reduce/SPIRV-Tools-reduceTarget.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/glfw3/glfw3Config.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/glfw3/glfw3ConfigVersion.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/glfw3/glfw3Targets-release.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/cmake/glfw3/glfw3Targets.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/libSPIRV-Tools-shared.dylib +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_c/cmake/spirv_cross_cConfig-release.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_c/cmake/spirv_cross_cConfig.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_core/cmake/spirv_cross_coreConfig-release.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_core/cmake/spirv_cross_coreConfig.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_cpp/cmake/spirv_cross_cppConfig-release.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_cpp/cmake/spirv_cross_cppConfig.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_glsl/cmake/spirv_cross_glslConfig-release.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_glsl/cmake/spirv_cross_glslConfig.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_hlsl/cmake/spirv_cross_hlslConfig-release.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_hlsl/cmake/spirv_cross_hlslConfig.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_msl/cmake/spirv_cross_mslConfig-release.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_msl/cmake/spirv_cross_mslConfig.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_reflect/cmake/spirv_cross_reflectConfig-release.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_reflect/cmake/spirv_cross_reflectConfig.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_util/cmake/spirv_cross_utilConfig-release.cmake +0 -0
- {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/share/spirv_cross_util/cmake/spirv_cross_utilConfig.cmake +0 -0
- {gstaichi-0.1.23.dev0.dist-info → gstaichi-1.0.1.dist-info}/WHEEL +0 -0
- {gstaichi-0.1.23.dev0.dist-info → gstaichi-1.0.1.dist-info}/licenses/LICENSE +0 -0
Binary file
|
@@ -45,11 +45,11 @@ def import_ti_python_core():
|
|
45
45
|
pyddir = os.path.dirname(os.path.realpath(__file__))
|
46
46
|
os.environ["PATH"] += os.pathsep + pyddir
|
47
47
|
try:
|
48
|
-
from
|
48
|
+
from gstaichi._lib.core import gstaichi_python as core # pylint: disable=C0415
|
49
49
|
except Exception as e:
|
50
50
|
if isinstance(e, ImportError):
|
51
51
|
print(
|
52
|
-
Fore.YELLOW + "Share object
|
52
|
+
Fore.YELLOW + "Share object gstaichi_python import failed, "
|
53
53
|
"check this page for possible solutions:\n"
|
54
54
|
"https://docs.taichi-lang.org/docs/install" + Fore.RESET
|
55
55
|
)
|
@@ -89,7 +89,7 @@ package_root = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__f
|
|
89
89
|
|
90
90
|
def get_core_shared_object():
|
91
91
|
directory = os.path.join(package_root, "_lib")
|
92
|
-
return os.path.join(directory, "
|
92
|
+
return os.path.join(directory, "libgstaichi_python.so")
|
93
93
|
|
94
94
|
|
95
95
|
def print_red_bold(*args, **kwargs):
|
@@ -120,11 +120,11 @@ if log_level:
|
|
120
120
|
|
121
121
|
def get_dll_name(name):
|
122
122
|
if get_os_name() == "linux":
|
123
|
-
return f"
|
123
|
+
return f"libgstaichi_{name}.so"
|
124
124
|
if get_os_name() == "osx":
|
125
|
-
return f"
|
125
|
+
return f"libgstaichi_{name}.dylib"
|
126
126
|
if get_os_name() == "win":
|
127
|
-
return f"
|
127
|
+
return f"gstaichi_{name}.dll"
|
128
128
|
raise Exception(f"Unknown OS: {get_os_name()}")
|
129
129
|
|
130
130
|
|
@@ -141,8 +141,8 @@ def compare_version(latest, current):
|
|
141
141
|
return tuple(latest_num) > tuple(current_num)
|
142
142
|
|
143
143
|
|
144
|
-
def
|
145
|
-
header = "[
|
144
|
+
def _print_gstaichi_header():
|
145
|
+
header = "[GsTaichi] "
|
146
146
|
header += f"version {ti_python_core.get_version_string()}, "
|
147
147
|
|
148
148
|
try:
|
@@ -171,8 +171,8 @@ def _print_taichi_header():
|
|
171
171
|
print(header)
|
172
172
|
|
173
173
|
|
174
|
-
if os.getenv("
|
175
|
-
|
174
|
+
if os.getenv("ENABLE_GSTAICHI_HEADER_PRINT", "True").lower() not in ("false", "0", "f"):
|
175
|
+
_print_gstaichi_header()
|
176
176
|
|
177
177
|
|
178
178
|
def try_get_wheel_tag(module):
|
@@ -218,28 +218,28 @@ def warn_restricted_version():
|
|
218
218
|
|
219
219
|
if get_os_name() == "linux":
|
220
220
|
try:
|
221
|
-
import
|
221
|
+
import gstaichi as ti # pylint: disable=import-outside-toplevel
|
222
222
|
|
223
223
|
wheel_tag = try_get_wheel_tag(ti)
|
224
224
|
if wheel_tag and "manylinux2014" in wheel_tag:
|
225
225
|
print_yellow_bold(
|
226
|
-
"You have installed a restricted version of
|
226
|
+
"You have installed a restricted version of gstaichi, certain features (e.g. Vulkan & GGUI) will not work."
|
227
227
|
)
|
228
228
|
libc_ver = try_get_loaded_libc_version()
|
229
229
|
if libc_ver and libc_ver < (2, 27):
|
230
230
|
print_yellow_bold(
|
231
|
-
"!!
|
231
|
+
"!! GsTaichi requires glibc >= 2.27 to run, please try upgrading your OS to a recent one (e.g. Ubuntu 18.04 or later) if possible."
|
232
232
|
)
|
233
233
|
|
234
234
|
pip_ver = try_get_pip_version()
|
235
235
|
if pip_ver and pip_ver < (20, 3, 0):
|
236
236
|
print_yellow_bold(
|
237
237
|
f"!! Your pip (version {'.'.join(map(str, pip_ver))}) is outdated (20.3.0 or later required), "
|
238
|
-
"try upgrading pip and install
|
238
|
+
"try upgrading pip and install gstaichi again."
|
239
239
|
)
|
240
240
|
print()
|
241
241
|
print_yellow_bold(" $ python3 -m pip install --upgrade pip")
|
242
|
-
print_yellow_bold(" $ python3 -m pip install --force-reinstall
|
242
|
+
print_yellow_bold(" $ python3 -m pip install --force-reinstall gstaichi")
|
243
243
|
print()
|
244
244
|
|
245
245
|
print_yellow_bold(
|
{taichi → gstaichi}/_logging.py
RENAMED
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
from typing import Any, Optional, Sequence, Union
|
4
4
|
|
5
|
-
from
|
6
|
-
from
|
7
|
-
from
|
8
|
-
from
|
9
|
-
from
|
10
|
-
from
|
5
|
+
from gstaichi._lib import core as _ti_core
|
6
|
+
from gstaichi._lib.core.gstaichi_python import SNodeCxx
|
7
|
+
from gstaichi._snode.snode_tree import SNodeTree
|
8
|
+
from gstaichi.lang import impl, snode
|
9
|
+
from gstaichi.lang.exception import GsTaichiRuntimeError
|
10
|
+
from gstaichi.lang.util import warning
|
11
11
|
|
12
12
|
_snode_registry = _ti_core.SNodeRegistry()
|
13
13
|
|
@@ -61,7 +61,7 @@ class FieldsBuilder:
|
|
61
61
|
|
62
62
|
# TODO: move this to SNodeTree class.
|
63
63
|
def deactivate_all(self):
|
64
|
-
"""Same as :func:`
|
64
|
+
"""Same as :func:`gstaichi.lang.snode.SNode.deactivate_all`"""
|
65
65
|
if self.finalized:
|
66
66
|
self.root.deactivate_all()
|
67
67
|
else:
|
@@ -72,7 +72,7 @@ class FieldsBuilder:
|
|
72
72
|
indices: Union[Sequence[_Axis], _Axis],
|
73
73
|
dimensions: Union[Sequence[int], int],
|
74
74
|
):
|
75
|
-
"""Same as :func:`
|
75
|
+
"""Same as :func:`gstaichi.lang.snode.SNode.dense`"""
|
76
76
|
self._check_not_finalized()
|
77
77
|
self.empty = False
|
78
78
|
return self.root.dense(indices, dimensions)
|
@@ -82,15 +82,15 @@ class FieldsBuilder:
|
|
82
82
|
indices: Union[Sequence[_Axis], _Axis],
|
83
83
|
dimensions: Union[Sequence[int], int],
|
84
84
|
):
|
85
|
-
"""Same as :func:`
|
85
|
+
"""Same as :func:`gstaichi.lang.snode.SNode.pointer`"""
|
86
86
|
if not _ti_core.is_extension_supported(impl.current_cfg().arch, _ti_core.Extension.sparse):
|
87
|
-
raise
|
87
|
+
raise GsTaichiRuntimeError("Pointer SNode is not supported on this backend.")
|
88
88
|
self._check_not_finalized()
|
89
89
|
self.empty = False
|
90
90
|
return self.root.pointer(indices, dimensions)
|
91
91
|
|
92
92
|
def _hash(self, indices, dimensions):
|
93
|
-
"""Same as :func:`
|
93
|
+
"""Same as :func:`gstaichi.lang.snode.SNode.hash`"""
|
94
94
|
raise NotImplementedError()
|
95
95
|
|
96
96
|
def dynamic(
|
@@ -99,16 +99,16 @@ class FieldsBuilder:
|
|
99
99
|
dimension: Union[Sequence[int], int],
|
100
100
|
chunk_size: Optional[int] = None,
|
101
101
|
):
|
102
|
-
"""Same as :func:`
|
102
|
+
"""Same as :func:`gstaichi.lang.snode.SNode.dynamic`"""
|
103
103
|
if not _ti_core.is_extension_supported(impl.current_cfg().arch, _ti_core.Extension.sparse):
|
104
|
-
raise
|
104
|
+
raise GsTaichiRuntimeError("Dynamic SNode is not supported on this backend.")
|
105
105
|
|
106
106
|
if dimension >= 2**31:
|
107
|
-
raise
|
107
|
+
raise GsTaichiRuntimeError(
|
108
108
|
f"The maximum dimension of a dynamic SNode cannot exceed the maximum value of a 32-bit signed integer: Got {dimension} > 2**31-1"
|
109
109
|
)
|
110
110
|
if chunk_size is not None and chunk_size >= 2**31:
|
111
|
-
raise
|
111
|
+
raise GsTaichiRuntimeError(
|
112
112
|
f"Chunk size cannot exceed the maximum value of a 32-bit signed integer: Got {chunk_size} > 2**31-1"
|
113
113
|
)
|
114
114
|
|
@@ -121,9 +121,9 @@ class FieldsBuilder:
|
|
121
121
|
indices: Union[Sequence[_Axis], _Axis],
|
122
122
|
dimensions: Union[Sequence[int], int],
|
123
123
|
):
|
124
|
-
"""Same as :func:`
|
124
|
+
"""Same as :func:`gstaichi.lang.snode.SNode.bitmasked`"""
|
125
125
|
if not _ti_core.is_extension_supported(impl.current_cfg().arch, _ti_core.Extension.sparse):
|
126
|
-
raise
|
126
|
+
raise GsTaichiRuntimeError("Bitmasked SNode is not supported on this backend.")
|
127
127
|
self._check_not_finalized()
|
128
128
|
self.empty = False
|
129
129
|
return self.root.bitmasked(indices, dimensions)
|
@@ -134,32 +134,32 @@ class FieldsBuilder:
|
|
134
134
|
dimensions: Union[Sequence[int], int],
|
135
135
|
max_num_bits: int,
|
136
136
|
):
|
137
|
-
"""Same as :func:`
|
137
|
+
"""Same as :func:`gstaichi.lang.snode.SNode.quant_array`"""
|
138
138
|
self._check_not_finalized()
|
139
139
|
self.empty = False
|
140
140
|
return self.root.quant_array(indices, dimensions, max_num_bits)
|
141
141
|
|
142
142
|
def place(self, *args: Any, offset: Optional[Union[Sequence[int], int]] = None):
|
143
|
-
"""Same as :func:`
|
143
|
+
"""Same as :func:`gstaichi.lang.snode.SNode.place`"""
|
144
144
|
self._check_not_finalized()
|
145
145
|
self.empty = False
|
146
146
|
self.root.place(*args, offset=offset)
|
147
147
|
|
148
148
|
def lazy_grad(self):
|
149
|
-
"""Same as :func:`
|
149
|
+
"""Same as :func:`gstaichi.lang.snode.SNode.lazy_grad`"""
|
150
150
|
# TODO: This complicates the implementation. Figure out why we need this
|
151
151
|
self._check_not_finalized()
|
152
152
|
self.empty = False
|
153
153
|
self.root.lazy_grad()
|
154
154
|
|
155
155
|
def _allocate_adjoint_checkbit(self):
|
156
|
-
"""Same as :func:`
|
156
|
+
"""Same as :func:`gstaichi.lang.snode.SNode._allocate_adjoint_checkbit`"""
|
157
157
|
self._check_not_finalized()
|
158
158
|
self.empty = False
|
159
159
|
self.root._allocate_adjoint_checkbit()
|
160
160
|
|
161
161
|
def lazy_dual(self):
|
162
|
-
"""Same as :func:`
|
162
|
+
"""Same as :func:`gstaichi.lang.snode.SNode.lazy_dual`"""
|
163
163
|
# TODO: This complicates the implementation. Figure out why we need this
|
164
164
|
self._check_not_finalized()
|
165
165
|
self.empty = False
|
@@ -172,18 +172,16 @@ class FieldsBuilder:
|
|
172
172
|
raise_warning (bool): Raise warning or not."""
|
173
173
|
return self._finalize(raise_warning, compile_only=False)
|
174
174
|
|
175
|
-
def
|
176
|
-
"""Constructs the SNodeTree and compiles the type for AOT purpose."""
|
177
|
-
return self._finalize(raise_warning=False, compile_only=True)
|
178
|
-
|
179
|
-
def _finalize(self, raise_warning, compile_only):
|
175
|
+
def _finalize(self, raise_warning, compile_only) -> SNodeTree:
|
180
176
|
self._check_not_finalized()
|
181
177
|
if self.empty and raise_warning:
|
182
178
|
warning("Finalizing an empty FieldsBuilder!")
|
183
179
|
self.finalized = True
|
184
180
|
impl.get_runtime().finalize_fields_builder(self)
|
185
|
-
return SNodeTree(
|
181
|
+
return SNodeTree(
|
182
|
+
_ti_core.finalize_snode_tree(_snode_registry, self.ptr, impl.get_runtime()._prog, compile_only)
|
183
|
+
)
|
186
184
|
|
187
185
|
def _check_not_finalized(self):
|
188
186
|
if self.finalized:
|
189
|
-
raise
|
187
|
+
raise GsTaichiRuntimeError("FieldsBuilder finalized")
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# type: ignore
|
2
2
|
|
3
|
-
# The reason we import just the
|
3
|
+
# The reason we import just the gstaichi.core.util module, instead of the ti_python_core
|
4
4
|
# object within it, is that ti_python_core is stateful. While in practice ti_python_core is
|
5
5
|
# loaded during the import procedure, it's probably still good to delay the
|
6
6
|
# access to it.
|
7
7
|
|
8
|
-
from
|
9
|
-
from
|
8
|
+
from gstaichi.lang import impl
|
9
|
+
from gstaichi.lang.exception import GsTaichiRuntimeError
|
10
10
|
|
11
11
|
|
12
12
|
class SNodeTree:
|
@@ -17,7 +17,7 @@ class SNodeTree:
|
|
17
17
|
|
18
18
|
def destroy(self):
|
19
19
|
if self.destroyed:
|
20
|
-
raise
|
20
|
+
raise GsTaichiRuntimeError("SNode tree has been destroyed")
|
21
21
|
if self.prog != impl.get_runtime().prog:
|
22
22
|
return
|
23
23
|
self.ptr.destroy_snode_tree(impl.get_runtime().prog)
|
@@ -30,5 +30,5 @@ class SNodeTree:
|
|
30
30
|
@property
|
31
31
|
def id(self):
|
32
32
|
if self.destroyed:
|
33
|
-
raise
|
33
|
+
raise GsTaichiRuntimeError("SNode tree has been destroyed")
|
34
34
|
return self.ptr.id()
|
File without changes
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import importlib.util
|
2
|
+
import sys
|
3
|
+
import tempfile
|
4
|
+
from contextlib import contextmanager
|
5
|
+
from pathlib import Path
|
6
|
+
|
7
|
+
|
8
|
+
def import_kernel_from_file(kernel_filepath: Path, kernel_name: str):
|
9
|
+
spec = importlib.util.spec_from_file_location(kernel_name, kernel_filepath)
|
10
|
+
assert spec is not None
|
11
|
+
module = importlib.util.module_from_spec(spec)
|
12
|
+
sys.modules[kernel_name] = module
|
13
|
+
loader = spec.loader
|
14
|
+
assert loader is not None
|
15
|
+
loader.exec_module(module)
|
16
|
+
return getattr(module, kernel_name)
|
17
|
+
|
18
|
+
|
19
|
+
@contextmanager
|
20
|
+
def load_kernel_from_string(kernel_str: str, kernel_name: str):
|
21
|
+
with tempfile.TemporaryDirectory() as temp_dir:
|
22
|
+
filepath = Path(temp_dir) / f"{kernel_name}.py"
|
23
|
+
with open(filepath, "w") as f:
|
24
|
+
f.write(kernel_str)
|
25
|
+
try:
|
26
|
+
kernel = import_kernel_from_file(kernel_filepath=filepath, kernel_name=kernel_name)
|
27
|
+
yield kernel
|
28
|
+
finally:
|
29
|
+
if kernel_name in sys.modules:
|
30
|
+
del sys.modules[kernel_name]
|
gstaichi/_version.py
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = '1.0.1'
|
@@ -8,11 +8,11 @@ import threading
|
|
8
8
|
import uuid
|
9
9
|
from urllib import request
|
10
10
|
|
11
|
-
from
|
11
|
+
from gstaichi._lib import core as _ti_core
|
12
12
|
|
13
13
|
|
14
14
|
def check_version(cur_uuid):
|
15
|
-
# Check
|
15
|
+
# Check GsTaichi version for the user.
|
16
16
|
major = _ti_core.get_version_major()
|
17
17
|
minor = _ti_core.get_version_minor()
|
18
18
|
patch = _ti_core.get_version_patch()
|
@@ -20,8 +20,11 @@ def check_version(cur_uuid):
|
|
20
20
|
payload = {"version": version, "platform": "", "python": ""}
|
21
21
|
|
22
22
|
system = platform.system()
|
23
|
-
|
23
|
+
u = platform.uname()
|
24
|
+
if (u.system, u.machine) == ("Linux", "x86_64"):
|
24
25
|
payload["platform"] = "manylinux_2_27_x86_64"
|
26
|
+
elif (u.system, u.machine) in (("Linux", "arm64"), ("Linux", "aarch64")):
|
27
|
+
payload["platform"] = "manylinux_2_27_aarch64"
|
25
28
|
elif system == "Windows":
|
26
29
|
payload["platform"] = "win_amd64"
|
27
30
|
elif system == "Darwin":
|
@@ -38,11 +41,11 @@ def check_version(cur_uuid):
|
|
38
41
|
payload["uuid"] = cur_uuid
|
39
42
|
if os.getenv("TI_CI") == "1":
|
40
43
|
payload["type"] = "CI"
|
41
|
-
# We do not want request exceptions break users' usage of
|
44
|
+
# We do not want request exceptions break users' usage of GsTaichi.
|
42
45
|
try:
|
43
46
|
payload = json.dumps(payload)
|
44
47
|
payload = payload.encode()
|
45
|
-
req = request.Request("https://metadata.
|
48
|
+
req = request.Request("https://metadata.gstaichi.graphics/check_version", method="POST")
|
46
49
|
req.add_header("Content-Type", "application/json")
|
47
50
|
with request.urlopen(req, data=payload, timeout=5) as response:
|
48
51
|
response = json.loads(response.read().decode("utf-8"))
|
gstaichi/ad/__init__.py
ADDED
{taichi → gstaichi}/ad/_ad.py
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
# type: ignore
|
2
2
|
|
3
|
-
"""
|
3
|
+
"""GsTaichi automatic differentiation module.
|
4
4
|
|
5
5
|
This module supplies two decorators for users to customize their
|
6
6
|
gradient computation task.
|
@@ -11,16 +11,16 @@ from functools import reduce
|
|
11
11
|
|
12
12
|
import numpy as np
|
13
13
|
|
14
|
-
import
|
15
|
-
from
|
16
|
-
from
|
17
|
-
from
|
18
|
-
from
|
19
|
-
from
|
20
|
-
from
|
21
|
-
from
|
22
|
-
from
|
23
|
-
from
|
14
|
+
import gstaichi.types.primitive_types as types
|
15
|
+
from gstaichi import _snode
|
16
|
+
from gstaichi.lang import impl
|
17
|
+
from gstaichi.lang._ndarray import Ndarray
|
18
|
+
from gstaichi.lang.expr import Expr
|
19
|
+
from gstaichi.lang.field import Field, ScalarField
|
20
|
+
from gstaichi.lang.kernel_impl import kernel
|
21
|
+
from gstaichi.lang.snode import SNode
|
22
|
+
from gstaichi.types import ndarray, template
|
23
|
+
from gstaichi.types.enums import AutodiffMode, SNodeGradType
|
24
24
|
|
25
25
|
|
26
26
|
class GradChecker:
|
@@ -140,19 +140,19 @@ def restore_all_fields(all_fields, backups):
|
|
140
140
|
|
141
141
|
class Tape:
|
142
142
|
def __init__(self, loss=None, clear_gradients=True, validation=False, grad_check=None):
|
143
|
-
"""A context manager for reverse mode autodiff :class:`~
|
143
|
+
"""A context manager for reverse mode autodiff :class:`~gstaichi.ad.Tape`. The
|
144
144
|
context manager would catching all of the callings of functions that
|
145
|
-
decorated by :func:`~
|
146
|
-
:func:`~
|
145
|
+
decorated by :func:`~gstaichi.lang.kernel_impl.kernel` or
|
146
|
+
:func:`~gstaichi.ad.grad_replaced` under `with` statement, and calculate
|
147
147
|
all the partial gradients of a given loss variable by calling all of the
|
148
148
|
gradient function of the callings caught in reverse order while `with`
|
149
149
|
statement ended.
|
150
150
|
|
151
|
-
See also :func:`~
|
152
|
-
:func:`~
|
151
|
+
See also :func:`~gstaichi.lang.kernel_impl.kernel` and
|
152
|
+
:func:`~gstaichi.ad.grad_replaced` for gradient functions.
|
153
153
|
|
154
154
|
Args:
|
155
|
-
loss(:class:`~
|
155
|
+
loss(:class:`~gstaichi.lang.expr.Expr`): The loss field, which shape should be ().
|
156
156
|
clear_gradients(Bool): Before `with` body start, clear all gradients or not.
|
157
157
|
validation(Bool): Check whether the code inside the context manager is autodiff valid, e.g., agree with the global data access rule.
|
158
158
|
grad_check(List[Field]): List of fields that need to check gradients.
|
@@ -293,7 +293,7 @@ def clear_all_gradients(gradient_type=SNodeGradType.ADJOINT):
|
|
293
293
|
|
294
294
|
places = tuple(places)
|
295
295
|
if places:
|
296
|
-
from
|
296
|
+
from gstaichi._kernels import clear_gradients # pylint: disable=C0415
|
297
297
|
|
298
298
|
clear_gradients(places)
|
299
299
|
|
@@ -302,12 +302,12 @@ def clear_all_gradients(gradient_type=SNodeGradType.ADJOINT):
|
|
302
302
|
|
303
303
|
|
304
304
|
def grad_replaced(func):
|
305
|
-
"""A decorator for python function to customize gradient with
|
305
|
+
"""A decorator for python function to customize gradient with GsTaichi's autodiff
|
306
306
|
system, e.g. `ti.ad.Tape()` and `kernel.grad()`.
|
307
307
|
|
308
|
-
This decorator forces
|
308
|
+
This decorator forces GsTaichi's autodiff system to use a user-defined gradient
|
309
309
|
function for the decorated function. Its customized gradient must be decorated
|
310
|
-
by :func:`~
|
310
|
+
by :func:`~gstaichi.ad.grad_for`.
|
311
311
|
|
312
312
|
Args:
|
313
313
|
fn (Callable): The python function to be decorated.
|
@@ -353,10 +353,10 @@ def grad_replaced(func):
|
|
353
353
|
def grad_for(primal):
|
354
354
|
"""Generates a decorator to decorate `primal`'s customized gradient function.
|
355
355
|
|
356
|
-
See :func:`~
|
356
|
+
See :func:`~gstaichi.lang.grad_replaced` for examples.
|
357
357
|
|
358
358
|
Args:
|
359
|
-
primal (Callable): The primal function, must be decorated by :func:`~
|
359
|
+
primal (Callable): The primal function, must be decorated by :func:`~gstaichi.ad.grad_replaced`.
|
360
360
|
|
361
361
|
Returns:
|
362
362
|
Callable: The decorator used to decorate customized gradient function."""
|
@@ -369,7 +369,7 @@ def grad_for(primal):
|
|
369
369
|
raise RuntimeError(f"Primal function `{primal.__name__}` must be decorated by ti.ad.grad_replaced")
|
370
370
|
if primal.grad is not None:
|
371
371
|
raise RuntimeError(
|
372
|
-
"Primal function must be a **python** function instead of a
|
372
|
+
"Primal function must be a **python** function instead of a gstaichi kernel. Please wrap the gstaichi kernel in a @ti.ad.grad_replaced decorated python function instead."
|
373
373
|
)
|
374
374
|
primal.grad = decorated
|
375
375
|
return decorated
|
@@ -378,9 +378,9 @@ def grad_for(primal):
|
|
378
378
|
|
379
379
|
|
380
380
|
def no_grad(func):
|
381
|
-
"""A decorator for python function to skip gradient calculation within
|
381
|
+
"""A decorator for python function to skip gradient calculation within GsTaichi's
|
382
382
|
autodiff system, e.g. `ti.ad.Tape()` and `kernel.grad()`.
|
383
|
-
This decorator forces
|
383
|
+
This decorator forces GsTaichi's autodiff system to use an empty gradient function
|
384
384
|
for the decorated function.
|
385
385
|
|
386
386
|
Args:
|
@@ -1,18 +1,18 @@
|
|
1
1
|
# type: ignore
|
2
2
|
|
3
|
-
from
|
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
|
11
|
-
from
|
12
|
-
from
|
13
|
-
from
|
14
|
-
from
|
15
|
-
from
|
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):
|
@@ -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
|
+
]
|