gstaichi 0.1.21.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.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/bin/SPIRV-Tools-shared.dll +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/SPIRV-Tools-diff.lib +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/SPIRV-Tools-link.lib +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/SPIRV-Tools-lint.lib +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/SPIRV-Tools-opt.lib +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/SPIRV-Tools-reduce.lib +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/SPIRV-Tools-shared.lib +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/lib/SPIRV-Tools.lib +0 -0
- {gstaichi-0.1.21.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.21.dev0.data/data/include/GLFW/glfw3.h +0 -6389
- gstaichi-0.1.21.dev0.data/data/include/GLFW/glfw3native.h +0 -594
- gstaichi-0.1.21.dev0.data/data/lib/cmake/glfw3/glfw3Config.cmake +0 -3
- gstaichi-0.1.21.dev0.data/data/lib/cmake/glfw3/glfw3ConfigVersion.cmake +0 -65
- gstaichi-0.1.21.dev0.data/data/lib/cmake/glfw3/glfw3Targets-release.cmake +0 -19
- gstaichi-0.1.21.dev0.data/data/lib/cmake/glfw3/glfw3Targets.cmake +0 -107
- gstaichi-0.1.21.dev0.data/data/lib/glfw3.lib +0 -0
- gstaichi-0.1.21.dev0.dist-info/RECORD +0 -198
- gstaichi-0.1.21.dev0.dist-info/entry_points.txt +0 -2
- gstaichi-0.1.21.dev0.dist-info/top_level.txt +0 -1
- taichi/CHANGELOG.md +0 -17
- 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.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools/cmake/SPIRV-ToolsConfig.cmake +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools/cmake/SPIRV-ToolsTarget-release.cmake +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools/cmake/SPIRV-ToolsTarget.cmake +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-diff/cmake/SPIRV-Tools-diffConfig.cmake +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-diff/cmake/SPIRV-Tools-diffTargets-release.cmake +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-diff/cmake/SPIRV-Tools-diffTargets.cmake +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-link/cmake/SPIRV-Tools-linkConfig.cmake +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-link/cmake/SPIRV-Tools-linkTargets-release.cmake +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-link/cmake/SPIRV-Tools-linkTargets.cmake +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-lint/cmake/SPIRV-Tools-lintConfig.cmake +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-lint/cmake/SPIRV-Tools-lintTargets-release.cmake +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-lint/cmake/SPIRV-Tools-lintTargets.cmake +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-opt/cmake/SPIRV-Tools-optConfig.cmake +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-opt/cmake/SPIRV-Tools-optTargets-release.cmake +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-opt/cmake/SPIRV-Tools-optTargets.cmake +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-reduce/cmake/SPIRV-Tools-reduceConfig.cmake +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-reduce/cmake/SPIRV-Tools-reduceTarget-release.cmake +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/SPIRV-Tools-reduce/cmake/SPIRV-Tools-reduceTarget.cmake +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv-tools/instrument.hpp +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv-tools/libspirv.h +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv-tools/libspirv.hpp +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv-tools/linker.hpp +0 -0
- {gstaichi-0.1.21.dev0.data → gstaichi-0.1.25.dev0.data}/data/include/spirv-tools/optimizer.hpp +0 -0
- {gstaichi-0.1.21.dev0.dist-info → gstaichi-0.1.25.dev0.dist-info}/WHEEL +0 -0
- {gstaichi-0.1.21.dev0.dist-info → gstaichi-0.1.25.dev0.dist-info}/licenses/LICENSE +0 -0
@@ -1,244 +0,0 @@
|
|
1
|
-
# type: ignore
|
2
|
-
|
3
|
-
"""
|
4
|
-
Data representation of all JSON data structures following the GfxRuntime140
|
5
|
-
convention.
|
6
|
-
"""
|
7
|
-
|
8
|
-
from typing import Any, Dict, List, Optional
|
9
|
-
|
10
|
-
from taichi.aot.utils import dump_json_data_model, json_data_model
|
11
|
-
|
12
|
-
|
13
|
-
@json_data_model
|
14
|
-
class FieldAttributes:
|
15
|
-
def __init__(self, j: Dict[str, Any]) -> None:
|
16
|
-
dtype = j["dtype"]
|
17
|
-
dtype_name = j["dtype_name"]
|
18
|
-
element_shape = j["element_shape"]
|
19
|
-
field_name = j["field_name"]
|
20
|
-
is_scalar = j["is_scalar"]
|
21
|
-
mem_offset_in_parent = j["mem_offset_in_parent"]
|
22
|
-
shape = j["shape"]
|
23
|
-
|
24
|
-
self.dtype: int = int(dtype)
|
25
|
-
self.dtype_name: str = str(dtype_name)
|
26
|
-
self.element_shape: List[int] = [int(x) for x in element_shape]
|
27
|
-
self.field_name: str = str(field_name)
|
28
|
-
self.is_scalar: bool = bool(is_scalar)
|
29
|
-
self.mem_offset_in_parent: int = int(mem_offset_in_parent)
|
30
|
-
self.shape: List[int] = [int(x) for x in shape]
|
31
|
-
|
32
|
-
|
33
|
-
@json_data_model
|
34
|
-
class ArgumentAttributes:
|
35
|
-
def __init__(self, j: Dict[str, Any]) -> None:
|
36
|
-
index = j["key"][0]
|
37
|
-
dtype = j["value"]["dtype"]
|
38
|
-
element_shape = j["value"]["element_shape"]
|
39
|
-
field_dim = j["value"]["field_dim"]
|
40
|
-
fmt = j["value"]["format"]
|
41
|
-
is_array = j["value"]["is_array"]
|
42
|
-
offset_in_mem = j["value"]["offset_in_mem"]
|
43
|
-
stride = j["value"]["stride"]
|
44
|
-
# (penguinliong) Note that the name field is optional for kernels.
|
45
|
-
# Kernels are always launched by indexed arguments and this is for
|
46
|
-
# debugging and header generation only.
|
47
|
-
name = j["value"]["name"] if "name" in j["value"] and len(j["value"]["name"]) > 0 else None
|
48
|
-
ptype = j["value"]["ptype"] if "ptype" in j["value"] else None
|
49
|
-
|
50
|
-
self.dtype: int = int(dtype)
|
51
|
-
self.element_shape: List[int] = [int(x) for x in element_shape]
|
52
|
-
self.field_dim: int = int(field_dim)
|
53
|
-
self.format: int = int(fmt)
|
54
|
-
self.index: int = int(index)
|
55
|
-
self.is_array: bool = bool(is_array)
|
56
|
-
self.offset_in_mem: int = int(offset_in_mem)
|
57
|
-
self.stride: int = int(stride)
|
58
|
-
self.name: Optional[str] = str(name) if name is not None else None
|
59
|
-
self.ptype: Optional[int] = int(ptype) if ptype is not None else None
|
60
|
-
|
61
|
-
|
62
|
-
@json_data_model
|
63
|
-
class ContextAttributes:
|
64
|
-
def __init__(self, j: Dict[str, Any]) -> None:
|
65
|
-
arg_attribs_vec_ = j["arg_attribs_vec_"]
|
66
|
-
args_bytes_ = j["args_bytes_"]
|
67
|
-
arr_access = j["arr_access"]
|
68
|
-
ret_attribs_vec_ = j["ret_attribs_vec_"]
|
69
|
-
rets_bytes_ = j["rets_bytes_"]
|
70
|
-
|
71
|
-
self.arg_attribs_vec_: List[ArgumentAttributes] = [ArgumentAttributes(x) for x in arg_attribs_vec_]
|
72
|
-
self.arg_attribs_vec_.sort(key=lambda x: x.index)
|
73
|
-
self.args_bytes_: int = int(args_bytes_)
|
74
|
-
self.arr_access: List[int] = [int(x["value"]) for x in arr_access]
|
75
|
-
self.ret_attribs_vec_: List[ArgumentAttributes] = [ArgumentAttributes(x) for x in ret_attribs_vec_]
|
76
|
-
self.rets_bytes_: int = int(rets_bytes_)
|
77
|
-
|
78
|
-
|
79
|
-
@json_data_model
|
80
|
-
class Buffer:
|
81
|
-
def __init__(self, j: Dict[str, Any]) -> None:
|
82
|
-
root_id = j["root_id"][0]
|
83
|
-
ty = j["type"]
|
84
|
-
|
85
|
-
self.root_id: int = int(root_id)
|
86
|
-
self.type: int = int(ty)
|
87
|
-
|
88
|
-
|
89
|
-
@json_data_model
|
90
|
-
class BufferBinding:
|
91
|
-
def __init__(self, j: Dict[str, Any]) -> None:
|
92
|
-
binding = j["binding"]
|
93
|
-
buffer = j["buffer"]
|
94
|
-
|
95
|
-
self.binding: int = int(binding)
|
96
|
-
self.buffer: Buffer = Buffer(buffer)
|
97
|
-
|
98
|
-
|
99
|
-
@json_data_model
|
100
|
-
class TextureBinding:
|
101
|
-
def __init__(self, j: Dict[str, Any]) -> None:
|
102
|
-
arg_id = j["arg_id"]
|
103
|
-
binding = j["binding"]
|
104
|
-
is_storage = j["is_storage"]
|
105
|
-
|
106
|
-
self.arg_id: int = int(arg_id)
|
107
|
-
self.binding: int = int(binding)
|
108
|
-
self.is_storage: bool = bool(is_storage)
|
109
|
-
|
110
|
-
|
111
|
-
@json_data_model
|
112
|
-
class RangeForAttributes:
|
113
|
-
def __init__(self, j: Dict[str, Any]) -> None:
|
114
|
-
begin = j["begin"]
|
115
|
-
const_begin = j["const_begin"]
|
116
|
-
const_end = j["const_end"]
|
117
|
-
end = j["end"]
|
118
|
-
|
119
|
-
self.begin: int = int(begin)
|
120
|
-
self.const_begin: bool = bool(const_begin)
|
121
|
-
self.const_end: bool = bool(const_end)
|
122
|
-
self.end: int = int(end)
|
123
|
-
|
124
|
-
|
125
|
-
@json_data_model
|
126
|
-
class TaskAttributes:
|
127
|
-
def __init__(self, j: Dict[str, Any]) -> None:
|
128
|
-
advisory_num_threads_per_group = j["advisory_num_threads_per_group"]
|
129
|
-
advisory_total_num_threads = j["advisory_total_num_threads"]
|
130
|
-
buffer_binds = j["buffer_binds"]
|
131
|
-
name = j["name"]
|
132
|
-
range_for_attribs = j["range_for_attribs"] if "range_for_attribs" in j else None
|
133
|
-
task_type = j["task_type"]
|
134
|
-
texture_binds = j["texture_binds"]
|
135
|
-
|
136
|
-
self.advisory_num_threads_per_group: int = int(advisory_num_threads_per_group)
|
137
|
-
self.advisory_total_num_threads: int = int(advisory_total_num_threads)
|
138
|
-
self.buffer_binds: List[BufferBinding] = [BufferBinding(x) for x in buffer_binds]
|
139
|
-
self.name: str = str(name)
|
140
|
-
self.range_for_attribs: Optional[RangeForAttributes] = (
|
141
|
-
RangeForAttributes(range_for_attribs) if range_for_attribs is not None else None
|
142
|
-
)
|
143
|
-
self.task_type: int = int(task_type)
|
144
|
-
self.texture_binds: List[TextureBinding] = [TextureBinding(x) for x in texture_binds]
|
145
|
-
|
146
|
-
|
147
|
-
@json_data_model
|
148
|
-
class DeviceCapabilityLevel:
|
149
|
-
def __init__(self, j: Dict[str, Any]) -> None:
|
150
|
-
key = j["key"]
|
151
|
-
value = j["value"]
|
152
|
-
|
153
|
-
self.key: str = str(key)
|
154
|
-
self.value: int = int(value)
|
155
|
-
|
156
|
-
|
157
|
-
@json_data_model
|
158
|
-
class KernelAttributes:
|
159
|
-
def __init__(self, j: Dict[str, Any]) -> None:
|
160
|
-
ctx_attribs = j["ctx_attribs"]
|
161
|
-
is_jit_evaluator = j["is_jit_evaluator"]
|
162
|
-
name = j["name"]
|
163
|
-
tasks_attribs = j["tasks_attribs"]
|
164
|
-
|
165
|
-
self.ctx_attribs: ContextAttributes = ContextAttributes(ctx_attribs)
|
166
|
-
self.is_jit_evaluator: bool = bool(is_jit_evaluator)
|
167
|
-
self.name: str = str(name)
|
168
|
-
self.tasks_attribs: List[TaskAttributes] = [TaskAttributes(x) for x in tasks_attribs]
|
169
|
-
|
170
|
-
|
171
|
-
@json_data_model
|
172
|
-
class Metadata:
|
173
|
-
def __init__(self, j: Dict[str, Any]) -> None:
|
174
|
-
fields = j["fields"]
|
175
|
-
kernels = j["kernels"]
|
176
|
-
required_caps = j["required_caps"]
|
177
|
-
root_buffer_size = j["root_buffer_size"]
|
178
|
-
|
179
|
-
self.fields: List[FieldAttributes] = [FieldAttributes(x) for x in fields]
|
180
|
-
self.kernels: List[KernelAttributes] = [KernelAttributes(x) for x in kernels]
|
181
|
-
self.required_caps: List[DeviceCapabilityLevel] = [DeviceCapabilityLevel(x) for x in required_caps]
|
182
|
-
self.root_buffer_size: int = int(root_buffer_size)
|
183
|
-
|
184
|
-
|
185
|
-
def from_json_metadata(j: Dict[str, Any]) -> Metadata:
|
186
|
-
return Metadata(j)
|
187
|
-
|
188
|
-
|
189
|
-
def to_json_metadata(meta_data: Metadata) -> Dict[str, Any]:
|
190
|
-
return dump_json_data_model(meta_data)
|
191
|
-
|
192
|
-
|
193
|
-
@json_data_model
|
194
|
-
class SymbolicArgument:
|
195
|
-
def __init__(self, j: Dict[str, Any]) -> None:
|
196
|
-
dtype_id = j["dtype_id"]
|
197
|
-
element_shape = j["element_shape"]
|
198
|
-
field_dim = j["field_dim"]
|
199
|
-
name = j["name"]
|
200
|
-
num_channels = j["num_channels"]
|
201
|
-
tag = j["tag"]
|
202
|
-
|
203
|
-
self.dtype_id: int = int(dtype_id)
|
204
|
-
self.element_shape: List[int] = [int(x) for x in element_shape]
|
205
|
-
self.field_dim: int = int(field_dim)
|
206
|
-
self.name: str = str(name)
|
207
|
-
self.num_channels: int = int(num_channels)
|
208
|
-
self.tag: int = int(tag)
|
209
|
-
|
210
|
-
|
211
|
-
@json_data_model
|
212
|
-
class Dispatch:
|
213
|
-
def __init__(self, j: Dict[str, Any]) -> None:
|
214
|
-
kernel_name = j["kernel_name"]
|
215
|
-
symbolic_args = j["symbolic_args"]
|
216
|
-
|
217
|
-
self.kernel_name: str = str(kernel_name)
|
218
|
-
self.symbolic_args: List[SymbolicArgument] = [SymbolicArgument(x) for x in symbolic_args]
|
219
|
-
|
220
|
-
|
221
|
-
@json_data_model
|
222
|
-
class GraphData:
|
223
|
-
def __init__(self, j: Dict[str, Any]) -> None:
|
224
|
-
dispatches = j["dispatches"]
|
225
|
-
|
226
|
-
self.dispatches = [Dispatch(x) for x in dispatches]
|
227
|
-
|
228
|
-
|
229
|
-
@json_data_model
|
230
|
-
class Graph:
|
231
|
-
def __init__(self, j: Dict[str, Any]) -> None:
|
232
|
-
key = j["key"]
|
233
|
-
value = j["value"]
|
234
|
-
|
235
|
-
self.key = str(key)
|
236
|
-
self.value = GraphData(value)
|
237
|
-
|
238
|
-
|
239
|
-
def from_json_graph(j: Dict[str, Any]) -> Graph:
|
240
|
-
return Graph(j)
|
241
|
-
|
242
|
-
|
243
|
-
def to_json_graph(graph: Graph) -> Dict[str, Any]:
|
244
|
-
return dump_json_data_model(graph)
|