gstaichi 0.1.23.dev0__cp310-cp310-win_amd64.whl → 1.0.1__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.
Files changed (219) hide show
  1. gstaichi/CHANGELOG.md +6 -0
  2. gstaichi/__init__.py +40 -0
  3. {taichi → gstaichi}/_funcs.py +8 -8
  4. {taichi → gstaichi}/_kernels.py +19 -19
  5. gstaichi/_lib/__init__.py +3 -0
  6. taichi/_lib/core/taichi_python.cp310-win_amd64.pyd → gstaichi/_lib/core/gstaichi_python.cp310-win_amd64.pyd +0 -0
  7. taichi/_lib/core/taichi_python.pyi → gstaichi/_lib/core/gstaichi_python.pyi +382 -522
  8. {taichi → gstaichi}/_lib/runtime/runtime_cuda.bc +0 -0
  9. {taichi → gstaichi}/_lib/runtime/runtime_x64.bc +0 -0
  10. {taichi → gstaichi}/_lib/utils.py +15 -15
  11. {taichi → gstaichi}/_logging.py +1 -1
  12. gstaichi/_snode/__init__.py +5 -0
  13. {taichi → gstaichi}/_snode/fields_builder.py +27 -29
  14. {taichi → gstaichi}/_snode/snode_tree.py +5 -5
  15. gstaichi/_test_tools/__init__.py +0 -0
  16. gstaichi/_test_tools/load_kernel_string.py +30 -0
  17. gstaichi/_version.py +1 -0
  18. {taichi → gstaichi}/_version_check.py +8 -5
  19. gstaichi/ad/__init__.py +3 -0
  20. {taichi → gstaichi}/ad/_ad.py +26 -26
  21. {taichi → gstaichi}/algorithms/_algorithms.py +7 -7
  22. {taichi → gstaichi}/examples/minimal.py +1 -1
  23. {taichi → gstaichi}/experimental.py +1 -1
  24. gstaichi/lang/__init__.py +50 -0
  25. {taichi → gstaichi}/lang/_ndarray.py +30 -26
  26. {taichi → gstaichi}/lang/_ndrange.py +8 -8
  27. gstaichi/lang/_template_mapper.py +199 -0
  28. {taichi → gstaichi}/lang/_texture.py +19 -19
  29. {taichi → gstaichi}/lang/_wrap_inspect.py +7 -7
  30. {taichi → gstaichi}/lang/any_array.py +13 -13
  31. {taichi → gstaichi}/lang/argpack.py +29 -29
  32. gstaichi/lang/ast/__init__.py +5 -0
  33. {taichi → gstaichi}/lang/ast/ast_transformer.py +94 -582
  34. {taichi → gstaichi}/lang/ast/ast_transformer_utils.py +54 -41
  35. gstaichi/lang/ast/ast_transformers/__init__.py +0 -0
  36. gstaichi/lang/ast/ast_transformers/call_transformer.py +267 -0
  37. gstaichi/lang/ast/ast_transformers/function_def_transformer.py +320 -0
  38. {taichi → gstaichi}/lang/ast/checkers.py +5 -5
  39. gstaichi/lang/ast/transform.py +9 -0
  40. {taichi → gstaichi}/lang/common_ops.py +12 -12
  41. gstaichi/lang/exception.py +80 -0
  42. {taichi → gstaichi}/lang/expr.py +22 -22
  43. {taichi → gstaichi}/lang/field.py +29 -27
  44. {taichi → gstaichi}/lang/impl.py +116 -121
  45. {taichi → gstaichi}/lang/kernel_arguments.py +16 -16
  46. {taichi → gstaichi}/lang/kernel_impl.py +330 -363
  47. {taichi → gstaichi}/lang/matrix.py +119 -115
  48. {taichi → gstaichi}/lang/matrix_ops.py +6 -6
  49. {taichi → gstaichi}/lang/matrix_ops_utils.py +4 -4
  50. {taichi → gstaichi}/lang/mesh.py +22 -22
  51. {taichi → gstaichi}/lang/misc.py +39 -68
  52. {taichi → gstaichi}/lang/ops.py +146 -141
  53. {taichi → gstaichi}/lang/runtime_ops.py +2 -2
  54. {taichi → gstaichi}/lang/shell.py +3 -3
  55. {taichi → gstaichi}/lang/simt/__init__.py +1 -1
  56. {taichi → gstaichi}/lang/simt/block.py +7 -7
  57. {taichi → gstaichi}/lang/simt/grid.py +1 -1
  58. {taichi → gstaichi}/lang/simt/subgroup.py +1 -1
  59. {taichi → gstaichi}/lang/simt/warp.py +1 -1
  60. {taichi → gstaichi}/lang/snode.py +46 -44
  61. {taichi → gstaichi}/lang/source_builder.py +13 -13
  62. {taichi → gstaichi}/lang/struct.py +33 -33
  63. {taichi → gstaichi}/lang/util.py +24 -24
  64. gstaichi/linalg/__init__.py +8 -0
  65. {taichi → gstaichi}/linalg/matrixfree_cg.py +14 -14
  66. {taichi → gstaichi}/linalg/sparse_cg.py +10 -10
  67. {taichi → gstaichi}/linalg/sparse_matrix.py +23 -23
  68. {taichi → gstaichi}/linalg/sparse_solver.py +21 -21
  69. {taichi → gstaichi}/math/__init__.py +1 -1
  70. {taichi → gstaichi}/math/_complex.py +21 -20
  71. {taichi → gstaichi}/math/mathimpl.py +56 -56
  72. gstaichi/profiler/__init__.py +6 -0
  73. {taichi → gstaichi}/profiler/kernel_metrics.py +11 -11
  74. {taichi → gstaichi}/profiler/kernel_profiler.py +30 -36
  75. {taichi → gstaichi}/profiler/memory_profiler.py +1 -1
  76. {taichi → gstaichi}/profiler/scoped_profiler.py +2 -2
  77. {taichi → gstaichi}/sparse/_sparse_grid.py +7 -7
  78. {taichi → gstaichi}/tools/__init__.py +4 -4
  79. {taichi → gstaichi}/tools/diagnose.py +10 -17
  80. gstaichi/types/__init__.py +19 -0
  81. {taichi → gstaichi}/types/annotations.py +1 -1
  82. {taichi → gstaichi}/types/compound_types.py +8 -8
  83. {taichi → gstaichi}/types/enums.py +1 -1
  84. {taichi → gstaichi}/types/ndarray_type.py +7 -7
  85. {taichi → gstaichi}/types/primitive_types.py +17 -14
  86. {taichi → gstaichi}/types/quant.py +9 -9
  87. {taichi → gstaichi}/types/texture_type.py +5 -5
  88. {taichi → gstaichi}/types/utils.py +1 -1
  89. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/bin/SPIRV-Tools-shared.dll +0 -0
  90. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/SPIRV-Tools-diff.lib +0 -0
  91. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/SPIRV-Tools-link.lib +0 -0
  92. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/SPIRV-Tools-lint.lib +0 -0
  93. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/SPIRV-Tools-opt.lib +0 -0
  94. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/SPIRV-Tools-reduce.lib +0 -0
  95. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/SPIRV-Tools-shared.lib +0 -0
  96. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/lib/SPIRV-Tools.lib +0 -0
  97. {gstaichi-0.1.23.dev0.dist-info → gstaichi-1.0.1.dist-info}/METADATA +13 -16
  98. gstaichi-1.0.1.dist-info/RECORD +135 -0
  99. gstaichi-1.0.1.dist-info/top_level.txt +1 -0
  100. gstaichi-0.1.23.dev0.data/data/include/GLFW/glfw3.h +0 -6389
  101. gstaichi-0.1.23.dev0.data/data/include/GLFW/glfw3native.h +0 -594
  102. gstaichi-0.1.23.dev0.data/data/lib/cmake/glfw3/glfw3Config.cmake +0 -3
  103. gstaichi-0.1.23.dev0.data/data/lib/cmake/glfw3/glfw3ConfigVersion.cmake +0 -65
  104. gstaichi-0.1.23.dev0.data/data/lib/cmake/glfw3/glfw3Targets-release.cmake +0 -19
  105. gstaichi-0.1.23.dev0.data/data/lib/cmake/glfw3/glfw3Targets.cmake +0 -107
  106. gstaichi-0.1.23.dev0.data/data/lib/glfw3.lib +0 -0
  107. gstaichi-0.1.23.dev0.dist-info/RECORD +0 -198
  108. gstaichi-0.1.23.dev0.dist-info/entry_points.txt +0 -2
  109. gstaichi-0.1.23.dev0.dist-info/top_level.txt +0 -1
  110. taichi/CHANGELOG.md +0 -20
  111. taichi/__init__.py +0 -44
  112. taichi/__main__.py +0 -5
  113. taichi/_lib/__init__.py +0 -3
  114. taichi/_lib/c_api/bin/taichi_c_api.dll +0 -0
  115. taichi/_lib/c_api/include/taichi/cpp/taichi.hpp +0 -1401
  116. taichi/_lib/c_api/include/taichi/taichi.h +0 -29
  117. taichi/_lib/c_api/include/taichi/taichi_core.h +0 -1111
  118. taichi/_lib/c_api/include/taichi/taichi_cpu.h +0 -29
  119. taichi/_lib/c_api/include/taichi/taichi_cuda.h +0 -36
  120. taichi/_lib/c_api/include/taichi/taichi_platform.h +0 -55
  121. taichi/_lib/c_api/include/taichi/taichi_unity.h +0 -64
  122. taichi/_lib/c_api/include/taichi/taichi_vulkan.h +0 -151
  123. taichi/_lib/c_api/lib/taichi_c_api.lib +0 -0
  124. taichi/_lib/c_api/runtime/runtime_cuda.bc +0 -0
  125. taichi/_lib/c_api/runtime/runtime_x64.bc +0 -0
  126. taichi/_lib/c_api/taichi/lib/cmake/taichi/TaichiConfig.cmake +0 -29
  127. taichi/_lib/c_api/taichi/lib/cmake/taichi/TaichiConfigVersion.cmake +0 -65
  128. taichi/_lib/c_api/taichi/lib/cmake/taichi/TaichiTargets.cmake +0 -121
  129. taichi/_lib/runtime/slim_libdevice.10.bc +0 -0
  130. taichi/_main.py +0 -552
  131. taichi/_snode/__init__.py +0 -5
  132. taichi/_ti_module/__init__.py +0 -3
  133. taichi/_ti_module/cppgen.py +0 -309
  134. taichi/_ti_module/module.py +0 -145
  135. taichi/_version.py +0 -1
  136. taichi/ad/__init__.py +0 -3
  137. taichi/aot/__init__.py +0 -12
  138. taichi/aot/_export.py +0 -28
  139. taichi/aot/conventions/__init__.py +0 -3
  140. taichi/aot/conventions/gfxruntime140/__init__.py +0 -38
  141. taichi/aot/conventions/gfxruntime140/dr.py +0 -244
  142. taichi/aot/conventions/gfxruntime140/sr.py +0 -613
  143. taichi/aot/module.py +0 -253
  144. taichi/aot/utils.py +0 -151
  145. taichi/graph/__init__.py +0 -3
  146. taichi/graph/_graph.py +0 -292
  147. taichi/lang/__init__.py +0 -50
  148. taichi/lang/ast/__init__.py +0 -5
  149. taichi/lang/ast/transform.py +0 -9
  150. taichi/lang/exception.py +0 -80
  151. taichi/linalg/__init__.py +0 -8
  152. taichi/profiler/__init__.py +0 -6
  153. taichi/shaders/Circles_vk.frag +0 -29
  154. taichi/shaders/Circles_vk.vert +0 -45
  155. taichi/shaders/Circles_vk_frag.spv +0 -0
  156. taichi/shaders/Circles_vk_vert.spv +0 -0
  157. taichi/shaders/Lines_vk.frag +0 -9
  158. taichi/shaders/Lines_vk.vert +0 -11
  159. taichi/shaders/Lines_vk_frag.spv +0 -0
  160. taichi/shaders/Lines_vk_vert.spv +0 -0
  161. taichi/shaders/Mesh_vk.frag +0 -71
  162. taichi/shaders/Mesh_vk.vert +0 -68
  163. taichi/shaders/Mesh_vk_frag.spv +0 -0
  164. taichi/shaders/Mesh_vk_vert.spv +0 -0
  165. taichi/shaders/Particles_vk.frag +0 -95
  166. taichi/shaders/Particles_vk.vert +0 -73
  167. taichi/shaders/Particles_vk_frag.spv +0 -0
  168. taichi/shaders/Particles_vk_vert.spv +0 -0
  169. taichi/shaders/SceneLines2quad_vk_comp.spv +0 -0
  170. taichi/shaders/SceneLines_vk.frag +0 -9
  171. taichi/shaders/SceneLines_vk.vert +0 -12
  172. taichi/shaders/SceneLines_vk_frag.spv +0 -0
  173. taichi/shaders/SceneLines_vk_vert.spv +0 -0
  174. taichi/shaders/SetImage_vk.frag +0 -21
  175. taichi/shaders/SetImage_vk.vert +0 -15
  176. taichi/shaders/SetImage_vk_frag.spv +0 -0
  177. taichi/shaders/SetImage_vk_vert.spv +0 -0
  178. taichi/shaders/Triangles_vk.frag +0 -16
  179. taichi/shaders/Triangles_vk.vert +0 -29
  180. taichi/shaders/Triangles_vk_frag.spv +0 -0
  181. taichi/shaders/Triangles_vk_vert.spv +0 -0
  182. taichi/shaders/lines2quad_vk_comp.spv +0 -0
  183. taichi/types/__init__.py +0 -19
  184. {taichi → gstaichi}/_lib/core/__init__.py +0 -0
  185. {taichi → gstaichi}/_lib/core/py.typed +0 -0
  186. {taichi/_lib/c_api → gstaichi/_lib}/runtime/slim_libdevice.10.bc +0 -0
  187. {taichi → gstaichi}/algorithms/__init__.py +0 -0
  188. {taichi → gstaichi}/assets/.git +0 -0
  189. {taichi → gstaichi}/assets/Go-Regular.ttf +0 -0
  190. {taichi → gstaichi}/assets/static/imgs/ti_gallery.png +0 -0
  191. {taichi → gstaichi}/lang/ast/symbol_resolver.py +0 -0
  192. {taichi → gstaichi}/sparse/__init__.py +0 -0
  193. {taichi → gstaichi}/tools/np2ply.py +0 -0
  194. {taichi → gstaichi}/tools/vtk.py +0 -0
  195. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/SPIRV-Tools/cmake/SPIRV-ToolsConfig.cmake +0 -0
  196. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/SPIRV-Tools/cmake/SPIRV-ToolsTarget-release.cmake +0 -0
  197. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/SPIRV-Tools/cmake/SPIRV-ToolsTarget.cmake +0 -0
  198. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/SPIRV-Tools-diff/cmake/SPIRV-Tools-diffConfig.cmake +0 -0
  199. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/SPIRV-Tools-diff/cmake/SPIRV-Tools-diffTargets-release.cmake +0 -0
  200. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/SPIRV-Tools-diff/cmake/SPIRV-Tools-diffTargets.cmake +0 -0
  201. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/SPIRV-Tools-link/cmake/SPIRV-Tools-linkConfig.cmake +0 -0
  202. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/SPIRV-Tools-link/cmake/SPIRV-Tools-linkTargets-release.cmake +0 -0
  203. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/SPIRV-Tools-link/cmake/SPIRV-Tools-linkTargets.cmake +0 -0
  204. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/SPIRV-Tools-lint/cmake/SPIRV-Tools-lintConfig.cmake +0 -0
  205. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/SPIRV-Tools-lint/cmake/SPIRV-Tools-lintTargets-release.cmake +0 -0
  206. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/SPIRV-Tools-lint/cmake/SPIRV-Tools-lintTargets.cmake +0 -0
  207. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/SPIRV-Tools-opt/cmake/SPIRV-Tools-optConfig.cmake +0 -0
  208. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/SPIRV-Tools-opt/cmake/SPIRV-Tools-optTargets-release.cmake +0 -0
  209. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/SPIRV-Tools-opt/cmake/SPIRV-Tools-optTargets.cmake +0 -0
  210. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/SPIRV-Tools-reduce/cmake/SPIRV-Tools-reduceConfig.cmake +0 -0
  211. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/SPIRV-Tools-reduce/cmake/SPIRV-Tools-reduceTarget-release.cmake +0 -0
  212. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/SPIRV-Tools-reduce/cmake/SPIRV-Tools-reduceTarget.cmake +0 -0
  213. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv-tools/instrument.hpp +0 -0
  214. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv-tools/libspirv.h +0 -0
  215. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv-tools/libspirv.hpp +0 -0
  216. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv-tools/linker.hpp +0 -0
  217. {gstaichi-0.1.23.dev0.data → gstaichi-1.0.1.data}/data/include/spirv-tools/optimizer.hpp +0 -0
  218. {gstaichi-0.1.23.dev0.dist-info → gstaichi-1.0.1.dist-info}/WHEEL +0 -0
  219. {gstaichi-0.1.23.dev0.dist-info → gstaichi-1.0.1.dist-info}/licenses/LICENSE +0 -0
taichi/lang/__init__.py DELETED
@@ -1,50 +0,0 @@
1
- # type: ignore
2
-
3
- from taichi.lang import impl, simt
4
- from taichi.lang._ndarray import *
5
- from taichi.lang._ndrange import ndrange
6
- from taichi.lang._texture import Texture
7
- from taichi.lang.argpack import *
8
- from taichi.lang.exception import *
9
- from taichi.lang.field import *
10
- from taichi.lang.impl import *
11
- from taichi.lang.kernel_impl import *
12
- from taichi.lang.matrix import *
13
- from taichi.lang.mesh import *
14
- from taichi.lang.misc import * # pylint: disable=W0622
15
- from taichi.lang.ops import * # pylint: disable=W0622
16
- from taichi.lang.runtime_ops import *
17
- from taichi.lang.snode import *
18
- from taichi.lang.source_builder import *
19
- from taichi.lang.struct import *
20
- from taichi.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,5 +0,0 @@
1
- # type: ignore
2
-
3
- from taichi.lang.ast.ast_transformer_utils import ASTTransformerContext
4
- from taichi.lang.ast.checkers import KernelSimplicityASTChecker
5
- from taichi.lang.ast.transform import transform_tree
@@ -1,9 +0,0 @@
1
- # type: ignore
2
-
3
- from taichi.lang.ast.ast_transformer import ASTTransformer
4
- from taichi.lang.ast.ast_transformer_utils import ASTTransformerContext
5
-
6
-
7
- def transform_tree(tree, ctx: ASTTransformerContext):
8
- ASTTransformer()(ctx, tree)
9
- return ctx.return_data
taichi/lang/exception.py DELETED
@@ -1,80 +0,0 @@
1
- # type: ignore
2
-
3
- from taichi._lib import core
4
-
5
-
6
- class TaichiCompilationError(Exception):
7
- """Base class for all compilation exceptions."""
8
-
9
- pass
10
-
11
-
12
- class TaichiSyntaxError(TaichiCompilationError, SyntaxError):
13
- """Thrown when a syntax error is found during compilation."""
14
-
15
- pass
16
-
17
-
18
- class TaichiNameError(TaichiCompilationError, NameError):
19
- """Thrown when an undefine name is found during compilation."""
20
-
21
- pass
22
-
23
-
24
- class TaichiIndexError(TaichiCompilationError, IndexError):
25
- """Thrown when an index error is found during compilation."""
26
-
27
- pass
28
-
29
-
30
- class TaichiTypeError(TaichiCompilationError, TypeError):
31
- """Thrown when a type mismatch is found during compilation."""
32
-
33
- pass
34
-
35
-
36
- class TaichiRuntimeError(RuntimeError):
37
- """Thrown when the compiled program cannot be executed due to unspecified reasons."""
38
-
39
- pass
40
-
41
-
42
- class TaichiAssertionError(TaichiRuntimeError, AssertionError):
43
- """Thrown when assertion fails at runtime."""
44
-
45
- pass
46
-
47
-
48
- class TaichiRuntimeTypeError(TaichiRuntimeError, TypeError):
49
- @staticmethod
50
- def get(pos, needed, provided):
51
- return TaichiRuntimeTypeError(
52
- f"Argument {pos} (type={provided}) cannot be converted into required type {needed}"
53
- )
54
-
55
- @staticmethod
56
- def get_ret(needed, provided):
57
- return TaichiRuntimeTypeError(f"Return (type={provided}) cannot be converted into required type {needed}")
58
-
59
-
60
- def handle_exception_from_cpp(exc):
61
- if isinstance(exc, core.TaichiTypeError):
62
- return TaichiTypeError(str(exc))
63
- if isinstance(exc, core.TaichiSyntaxError):
64
- return TaichiSyntaxError(str(exc))
65
- if isinstance(exc, core.TaichiIndexError):
66
- return TaichiIndexError(str(exc))
67
- if isinstance(exc, core.TaichiAssertionError):
68
- return TaichiAssertionError(str(exc))
69
- return exc
70
-
71
-
72
- __all__ = [
73
- "TaichiSyntaxError",
74
- "TaichiTypeError",
75
- "TaichiCompilationError",
76
- "TaichiNameError",
77
- "TaichiRuntimeError",
78
- "TaichiRuntimeTypeError",
79
- "TaichiAssertionError",
80
- ]
taichi/linalg/__init__.py DELETED
@@ -1,8 +0,0 @@
1
- # type: ignore
2
-
3
- """Taichi support module for sparse matrix operations."""
4
-
5
- from taichi.linalg.matrixfree_cg import *
6
- from taichi.linalg.sparse_cg import SparseCG
7
- from taichi.linalg.sparse_matrix import *
8
- from taichi.linalg.sparse_solver import SparseSolver
@@ -1,6 +0,0 @@
1
- # type: ignore
2
-
3
- from taichi.profiler.kernel_metrics import *
4
- from taichi.profiler.kernel_profiler import *
5
- from taichi.profiler.memory_profiler import *
6
- from taichi.profiler.scoped_profiler import *
@@ -1,29 +0,0 @@
1
- #version 450
2
-
3
- layout(binding = 0) uniform UBO {
4
- vec3 color;
5
- int use_per_vertex_color;
6
- int use_per_vertex_radius;
7
- float radius;
8
- float window_width;
9
- float window_height;
10
- }
11
- ubo;
12
-
13
- layout(location = 1) in vec3 selected_color;
14
- layout(location = 2) in vec2 pos_2d;
15
-
16
- layout(location = 0) out vec4 out_color;
17
-
18
- void main() {
19
- float dist_sq = dot(pos_2d, pos_2d);
20
- float alpha = 1.0 - step(1.0, dist_sq);
21
-
22
- /*
23
- if (length(pos_2d) >= 1.0) {
24
- discard;
25
- }
26
- */
27
-
28
- out_color = vec4(selected_color, alpha);
29
- }
@@ -1,45 +0,0 @@
1
- #version 450
2
-
3
- layout(location = 0) in vec3 in_position;
4
- layout(location = 1) in vec3 in_normal;
5
- layout(location = 2) in vec2 in_texcoord;
6
- layout(location = 3) in vec4 in_color;
7
-
8
- layout(binding = 0) uniform UBO {
9
- vec3 color;
10
- int use_per_vertex_color;
11
- int use_per_vertex_radius;
12
- float radius;
13
- float window_width;
14
- float window_height;
15
- }
16
- ubo;
17
-
18
- layout(location = 1) out vec3 selected_color;
19
- layout(location = 2) out vec2 pos_2d;
20
-
21
- const vec2 offsets[6] = {
22
- vec2(-1.0f, 1.0f),
23
- vec2(1.0f, -1.0f),
24
- vec2(-1.0f, -1.0f),
25
- vec2(-1.0f, 1.0f),
26
- vec2(1.0f, 1.0f),
27
- vec2(1.0f, -1.0f),
28
- };
29
-
30
- void main() {
31
- float x = in_position.x * 2.0 - 1.0;
32
- float y = -(in_position.y * 2.0 - 1.0);
33
-
34
- pos_2d = offsets[gl_VertexIndex % 6];
35
- float radius_1d = ubo.use_per_vertex_radius == 0 ? ubo.radius : in_normal.x;
36
-
37
- gl_Position = vec4(x, y, 0.0, 1.0);
38
- gl_Position.xy += pos_2d * vec2(radius_1d / ubo.window_width * ubo.window_height, radius_1d) * 2.0;
39
-
40
- if (ubo.use_per_vertex_color == 0) {
41
- selected_color = ubo.color;
42
- } else {
43
- selected_color = in_color.rgb;
44
- }
45
- }
Binary file
Binary file
@@ -1,9 +0,0 @@
1
- #version 450
2
-
3
- layout(location = 0) in vec3 color;
4
-
5
- layout(location = 0) out vec4 out_color;
6
-
7
- void main() {
8
- out_color = vec4(color, 1);
9
- }
@@ -1,11 +0,0 @@
1
- #version 450
2
-
3
- layout(location = 0) in vec2 in_position;
4
- layout(location = 1) in uint in_color_encoded;
5
-
6
- layout(location = 0) out vec3 frag_color;
7
-
8
- void main() {
9
- gl_Position = vec4(in_position.x * 2.0 - 1.0, -(in_position.y * 2.0 - 1.0), 0.0, 1.0);
10
- frag_color = unpackUnorm4x8(in_color_encoded).rgb;
11
- }
Binary file
Binary file
@@ -1,71 +0,0 @@
1
- #version 450
2
-
3
- layout(location = 0) in vec3 frag_pos;
4
- layout(location = 1) in vec3 frag_normal;
5
- layout(location = 2) in vec2 frag_texcoord;
6
-
7
- layout(location = 0) out vec4 out_color;
8
-
9
- struct SceneUBO {
10
- vec3 camera_pos;
11
- mat4 view;
12
- mat4 projection;
13
- vec3 ambient_light;
14
- int point_light_count;
15
- };
16
-
17
- layout(binding = 0) uniform UBORenderable {
18
- vec3 color;
19
- int use_per_vertex_color;
20
- int two_sided;
21
- float has_attribute;
22
- }
23
- ubo_renderable;
24
-
25
- layout(binding = 1) uniform UBOScene {
26
- SceneUBO scene;
27
- float window_width;
28
- float window_height;
29
- float tan_half_fov;
30
- float aspect_ratio;
31
- }
32
- ubo_scene;
33
-
34
- struct PointLight {
35
- vec3 pos;
36
- vec3 color;
37
- };
38
-
39
- layout(binding = 2, std430) buffer SSBO {
40
- PointLight point_lights[];
41
- }
42
- ssbo;
43
-
44
- layout(location = 3) in vec4 selected_color;
45
-
46
- vec3 lambertian() {
47
- vec3 ambient = ubo_scene.scene.ambient_light * selected_color.rgb;
48
- vec3 result = ambient;
49
-
50
- for (int i = 0; i < ubo_scene.scene.point_light_count; ++i) {
51
- vec3 light_color = ssbo.point_lights[i].color;
52
-
53
- vec3 light_dir = normalize(ssbo.point_lights[i].pos - frag_pos);
54
- vec3 normal = normalize(frag_normal);
55
- float factor = 0.0;
56
- if(ubo_renderable.two_sided != 0){
57
- factor = abs(dot(light_dir, normal));
58
- }
59
- else{
60
- factor = max(dot(light_dir, normal), 0);
61
- }
62
- vec3 diffuse = factor * selected_color.rgb * light_color;
63
- result += diffuse;
64
- }
65
-
66
- return result;
67
- }
68
-
69
- void main() {
70
- out_color = vec4(lambertian(), selected_color.a);
71
- }
@@ -1,68 +0,0 @@
1
- #version 450
2
-
3
- layout(location = 0) in vec3 in_position;
4
- layout(location = 1) in vec3 in_normal;
5
- layout(location = 2) in vec2 in_texcoord;
6
- layout(location = 3) in vec4 in_color;
7
-
8
- layout(location = 0) out vec3 frag_pos;
9
- layout(location = 1) out vec3 frag_normal;
10
- layout(location = 2) out vec2 frag_texcoord;
11
- layout(location = 3) out vec4 selected_color;
12
-
13
- struct SceneUBO {
14
- vec3 camera_pos;
15
- mat4 view;
16
- mat4 projection;
17
- vec3 ambient_light;
18
- int point_light_count;
19
- };
20
-
21
- struct PointLight {
22
- vec3 pos;
23
- vec3 color;
24
- };
25
-
26
- struct MeshAttribute {
27
- mat4 model;
28
- };
29
-
30
- layout(binding = 0) uniform UBORenderable {
31
- vec3 color;
32
- int use_per_vertex_color;
33
- int two_sided;
34
- float has_attribute;
35
- }
36
- ubo_renderable;
37
-
38
- layout(binding = 1) uniform UBOScene {
39
- SceneUBO scene;
40
- float window_width;
41
- float window_height;
42
- float tan_half_fov;
43
- float aspect_ratio;
44
- }
45
- ubo_scene;
46
-
47
- layout(binding = 3, std430) buffer MeshAttributeBuffer {
48
- MeshAttribute mesh_attr[];
49
- }
50
- mesh_attr_buffer;
51
-
52
- void main() {
53
- mat4 model_tmp = transpose(mesh_attr_buffer.mesh_attr[gl_InstanceIndex].model);
54
- // if mesh attributes not given, then use Identity as model matrix
55
- mat4 model = mat4(1.0) * (1.0 - ubo_renderable.has_attribute) + model_tmp * ubo_renderable.has_attribute;
56
-
57
- gl_Position = ubo_scene.scene.projection * ubo_scene.scene.view * model * vec4(in_position, 1.0);
58
- gl_Position.y *= -1.0;
59
- frag_texcoord = in_texcoord;
60
- frag_pos = in_position;
61
- frag_normal = in_normal;
62
-
63
- if (ubo_renderable.use_per_vertex_color == 0) {
64
- selected_color = vec4(ubo_renderable.color, 1.0);
65
- } else {
66
- selected_color = in_color;
67
- }
68
- }
Binary file
Binary file
@@ -1,95 +0,0 @@
1
- #version 450
2
-
3
- struct SceneUBO {
4
- vec3 camera_pos;
5
- mat4 view;
6
- mat4 projection;
7
- vec3 ambient_light;
8
- int point_light_count;
9
- };
10
-
11
- layout(binding = 0) uniform UBORenderable {
12
- vec3 color;
13
- int use_per_vertex_color;
14
- int use_per_vertex_radius;
15
- float radius;
16
- }
17
- ubo_renderable;
18
-
19
- layout(binding = 1) uniform UBOScene {
20
- SceneUBO scene;
21
- float window_width;
22
- float window_height;
23
- float tan_half_fov;
24
- float aspect_ratio;
25
- }
26
- ubo_scene;
27
-
28
- struct PointLight {
29
- vec3 pos;
30
- vec3 color;
31
- };
32
-
33
- layout(binding = 2, std430) buffer SSBO {
34
- PointLight point_lights[];
35
- }
36
- ssbo;
37
-
38
- layout(location = 0) out vec4 out_color;
39
-
40
- layout(location = 0) in vec4 pos_camera_space;
41
- layout(location = 1) in vec4 selected_color;
42
- layout(location = 2) in vec2 pos_2d;
43
- layout(location = 3) in float selected_radius;
44
-
45
- float project_z(float view_z) {
46
- vec4 projected = ubo_scene.scene.projection * vec4(0, 0, view_z, 1);
47
- return projected.z / projected.w;
48
- }
49
-
50
- vec3 to_camera_space(vec3 pos) {
51
- vec4 temp = ubo_scene.scene.view * vec4(pos, 1.0);
52
- return temp.xyz / temp.w;
53
- }
54
-
55
- // operates in camera space !!
56
- vec3 lambertian(vec3 frag_pos, vec3 frag_normal) {
57
- vec3 ambient = ubo_scene.scene.ambient_light * selected_color.rgb;
58
- vec3 result = ambient;
59
-
60
- for (int i = 0; i < ubo_scene.scene.point_light_count; ++i) {
61
- vec3 light_color = ssbo.point_lights[i].color;
62
-
63
- vec3 light_dir =
64
- normalize(to_camera_space(ssbo.point_lights[i].pos) - frag_pos);
65
- vec3 normal = normalize(frag_normal);
66
- vec3 diffuse =
67
- max(dot(light_dir, normal), 0.0) * selected_color.rgb * light_color;
68
-
69
- result += diffuse;
70
- }
71
-
72
- return result;
73
- }
74
-
75
- void main() {
76
- vec2 coord2D = pos_2d;
77
-
78
- if (length(coord2D) >= 1.0) {
79
- discard;
80
- }
81
-
82
- float z_in_sphere = sqrt(1 - coord2D.x * coord2D.x - coord2D.y * coord2D.y);
83
- vec3 coord_in_sphere = vec3(coord2D, z_in_sphere);
84
-
85
- vec3 frag_pos =
86
- pos_camera_space.xyz / pos_camera_space.w + coord_in_sphere * selected_radius;
87
- vec3 frag_normal = coord_in_sphere;
88
- vec3 color = lambertian(frag_pos, frag_normal);
89
- out_color = vec4(color, selected_color.a);
90
-
91
- float depth =
92
- (pos_camera_space.z / pos_camera_space.w) + z_in_sphere * selected_radius;
93
-
94
- gl_FragDepth = project_z(depth);
95
- }
@@ -1,73 +0,0 @@
1
- #version 450
2
- #extension GL_KHR_vulkan_glsl : enable
3
-
4
- layout(location = 0) in vec3 in_position;
5
- layout(location = 1) in vec3 in_normal;
6
- layout(location = 2) in vec2 in_texcoord;
7
- layout(location = 3) in vec4 in_color;
8
-
9
- struct SceneUBO {
10
- vec3 camera_pos;
11
- mat4 view;
12
- mat4 projection;
13
- vec3 ambient_light;
14
- int point_light_count;
15
- };
16
-
17
- layout(binding = 0) uniform UBORenderable {
18
- vec3 color;
19
- int use_per_vertex_color;
20
- int use_per_vertex_radius;
21
- float radius;
22
- }
23
- ubo_renderable;
24
-
25
- layout(binding = 1) uniform UBOScene {
26
- SceneUBO scene;
27
- float window_width;
28
- float window_height;
29
- float tan_half_fov;
30
- float aspect_ratio;
31
- }
32
- ubo_scene;
33
- layout(location = 0) out vec4 pos_camera_space;
34
- layout(location = 1) out vec4 selected_color;
35
- layout(location = 2) out vec2 pos_2d;
36
- layout(location = 3) out float selected_radius;
37
-
38
- const vec2 offsets[6] = {
39
- vec2(-1.0f, 1.0f),
40
- vec2(1.0f, -1.0f),
41
- vec2(-1.0f, -1.0f),
42
- vec2(-1.0f, 1.0f),
43
- vec2(1.0f, 1.0f),
44
- vec2(1.0f, -1.0f),
45
- };
46
-
47
- void main() {
48
- float distance = length(in_position - ubo_scene.scene.camera_pos);
49
-
50
- if (ubo_renderable.use_per_vertex_radius == 0) {
51
- selected_radius = ubo_renderable.radius;
52
- } else {
53
- selected_radius = in_normal.x;
54
- }
55
-
56
- float hsize = selected_radius / (ubo_scene.tan_half_fov * distance);
57
-
58
- pos_camera_space = ubo_scene.scene.view * vec4(in_position, 1.0);
59
-
60
- pos_2d = offsets[gl_VertexIndex % 6];
61
-
62
- vec4 pos_proj = ubo_scene.scene.projection * pos_camera_space;
63
- pos_proj.xy += pos_2d * vec2(hsize, hsize * ubo_scene.window_width / ubo_scene.window_height) * pos_proj.w;
64
-
65
- gl_Position = pos_proj;
66
- gl_Position.y *= -1.0;
67
-
68
- if (ubo_renderable.use_per_vertex_color == 0) {
69
- selected_color = vec4(ubo_renderable.color, 1.0);
70
- } else {
71
- selected_color = in_color;
72
- }
73
- }
Binary file
Binary file
Binary file
@@ -1,9 +0,0 @@
1
- #version 450
2
-
3
- layout(location = 0) in vec3 color;
4
-
5
- layout(location = 0) out vec4 out_color;
6
-
7
- void main() {
8
- out_color = vec4(color, 1);
9
- }
@@ -1,12 +0,0 @@
1
- #version 450
2
-
3
- layout(location = 0) in vec4 in_position;
4
- layout(location = 1) in vec4 in_color;
5
-
6
- layout(location = 0) out vec3 frag_color;
7
-
8
- void main() {
9
- gl_Position = in_position;
10
- gl_Position.y = -gl_Position.y;
11
- frag_color = in_color.rgb;
12
- }
Binary file
Binary file
@@ -1,21 +0,0 @@
1
- #version 450
2
-
3
- layout(binding = 0) uniform sampler2D texSampler;
4
-
5
- layout(location = 0) in vec2 frag_texcoord;
6
-
7
- layout(location = 0) out vec4 out_color;
8
-
9
- layout(binding = 1) uniform UBO {
10
- vec2 lower_bound;
11
- vec2 upper_bound;
12
- float x_factor;
13
- float y_factor;
14
- int is_transposed;
15
- } ubo;
16
-
17
- void main() {
18
- vec2 coord = frag_texcoord * vec2(ubo.x_factor,ubo.y_factor);
19
- coord = clamp(coord, ubo.lower_bound, ubo.upper_bound);
20
- out_color = textureLod(texSampler, ubo.is_transposed != 0 ? coord.yx : coord, 0);
21
- }
@@ -1,15 +0,0 @@
1
- #version 450
2
-
3
- // layout(binding = 0) uniform UniformBufferObject {} ubo;
4
-
5
- layout(location = 0) in vec3 in_position;
6
- layout(location = 1) in vec3 in_normal;
7
- layout(location = 2) in vec2 in_texcoord;
8
- layout(location = 3) in vec4 in_color;
9
-
10
- layout(location = 0) out vec2 frag_texcoord;
11
-
12
- void main() {
13
- gl_Position = vec4(in_position.xy, 0.0, 1.0);
14
- frag_texcoord = in_texcoord;
15
- }
Binary file
Binary file
@@ -1,16 +0,0 @@
1
- #version 450
2
-
3
- layout(location = 0) in vec2 frag_texcoord;
4
- layout(location = 1) in vec3 selected_color;
5
-
6
- layout(location = 0) out vec4 out_color;
7
-
8
- layout(binding = 0) uniform UniformBufferObject {
9
- vec3 color;
10
- int use_per_vertex_color;
11
- }
12
- ubo;
13
-
14
- void main() {
15
- out_color = vec4(selected_color, 1);
16
- }