warp-lang 1.0.0b5__py3-none-manylinux2014_x86_64.whl → 1.0.0b6__py3-none-manylinux2014_x86_64.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 (187) hide show
  1. docs/conf.py +3 -4
  2. examples/env/env_ant.py +1 -1
  3. examples/env/env_cartpole.py +1 -1
  4. examples/env/env_humanoid.py +1 -1
  5. examples/example_dem.py +28 -26
  6. examples/example_diffray.py +37 -30
  7. examples/example_fluid.py +7 -3
  8. examples/example_jacobian_ik.py +1 -1
  9. examples/example_mesh_intersect.py +10 -7
  10. examples/example_nvdb.py +3 -3
  11. examples/example_render_opengl.py +19 -10
  12. examples/example_sim_cartpole.py +9 -5
  13. examples/example_sim_cloth.py +29 -25
  14. examples/example_sim_fk_grad.py +2 -2
  15. examples/example_sim_fk_grad_torch.py +3 -3
  16. examples/example_sim_grad_bounce.py +11 -8
  17. examples/example_sim_grad_cloth.py +12 -9
  18. examples/example_sim_granular.py +2 -2
  19. examples/example_sim_granular_collision_sdf.py +13 -13
  20. examples/example_sim_neo_hookean.py +3 -3
  21. examples/example_sim_particle_chain.py +2 -2
  22. examples/example_sim_quadruped.py +8 -5
  23. examples/example_sim_rigid_chain.py +8 -5
  24. examples/example_sim_rigid_contact.py +13 -10
  25. examples/example_sim_rigid_fem.py +2 -2
  26. examples/example_sim_rigid_gyroscopic.py +2 -2
  27. examples/example_sim_rigid_kinematics.py +1 -1
  28. examples/example_sim_trajopt.py +3 -2
  29. examples/fem/example_apic_fluid.py +5 -7
  30. examples/fem/example_diffusion_mgpu.py +18 -16
  31. warp/__init__.py +3 -2
  32. warp/bin/warp.so +0 -0
  33. warp/build_dll.py +29 -9
  34. warp/builtins.py +206 -7
  35. warp/codegen.py +58 -38
  36. warp/config.py +3 -1
  37. warp/context.py +234 -128
  38. warp/fem/__init__.py +2 -2
  39. warp/fem/cache.py +2 -1
  40. warp/fem/field/nodal_field.py +18 -17
  41. warp/fem/geometry/hexmesh.py +11 -6
  42. warp/fem/geometry/quadmesh_2d.py +16 -12
  43. warp/fem/geometry/tetmesh.py +19 -8
  44. warp/fem/geometry/trimesh_2d.py +18 -7
  45. warp/fem/integrate.py +341 -196
  46. warp/fem/quadrature/__init__.py +1 -1
  47. warp/fem/quadrature/pic_quadrature.py +138 -53
  48. warp/fem/quadrature/quadrature.py +81 -9
  49. warp/fem/space/__init__.py +1 -1
  50. warp/fem/space/basis_space.py +169 -51
  51. warp/fem/space/grid_2d_function_space.py +2 -2
  52. warp/fem/space/grid_3d_function_space.py +2 -2
  53. warp/fem/space/hexmesh_function_space.py +2 -2
  54. warp/fem/space/partition.py +9 -6
  55. warp/fem/space/quadmesh_2d_function_space.py +2 -2
  56. warp/fem/space/shape/cube_shape_function.py +27 -15
  57. warp/fem/space/shape/square_shape_function.py +29 -18
  58. warp/fem/space/tetmesh_function_space.py +2 -2
  59. warp/fem/space/topology.py +10 -0
  60. warp/fem/space/trimesh_2d_function_space.py +2 -2
  61. warp/fem/utils.py +10 -5
  62. warp/native/array.h +49 -8
  63. warp/native/builtin.h +31 -14
  64. warp/native/cuda_util.cpp +8 -3
  65. warp/native/cuda_util.h +1 -0
  66. warp/native/exports.h +1177 -1108
  67. warp/native/intersect.h +4 -4
  68. warp/native/intersect_adj.h +8 -8
  69. warp/native/mat.h +65 -6
  70. warp/native/mesh.h +126 -5
  71. warp/native/quat.h +28 -4
  72. warp/native/vec.h +76 -14
  73. warp/native/warp.cu +1 -6
  74. warp/render/render_opengl.py +261 -109
  75. warp/sim/import_mjcf.py +13 -7
  76. warp/sim/import_urdf.py +14 -14
  77. warp/sim/inertia.py +17 -18
  78. warp/sim/model.py +67 -67
  79. warp/sim/render.py +1 -1
  80. warp/sparse.py +6 -6
  81. warp/stubs.py +19 -81
  82. warp/tape.py +1 -1
  83. warp/tests/__main__.py +3 -6
  84. warp/tests/{test_class_kernel.py → aux_test_class_kernel.py} +9 -1
  85. warp/tests/aux_test_conditional_unequal_types_kernels.py +21 -0
  86. warp/tests/{test_dependent.py → aux_test_dependent.py} +2 -2
  87. warp/tests/{test_reference.py → aux_test_reference.py} +1 -1
  88. warp/tests/aux_test_unresolved_func.py +14 -0
  89. warp/tests/aux_test_unresolved_symbol.py +14 -0
  90. warp/tests/{test_kinematics.py → disabled_kinematics.py} +10 -12
  91. warp/tests/run_coverage_serial.py +31 -0
  92. warp/tests/test_adam.py +102 -106
  93. warp/tests/test_arithmetic.py +39 -40
  94. warp/tests/test_array.py +46 -48
  95. warp/tests/test_array_reduce.py +25 -19
  96. warp/tests/test_atomic.py +62 -26
  97. warp/tests/test_bool.py +16 -11
  98. warp/tests/test_builtins_resolution.py +1292 -0
  99. warp/tests/test_bvh.py +9 -12
  100. warp/tests/test_closest_point_edge_edge.py +53 -57
  101. warp/tests/test_codegen.py +164 -134
  102. warp/tests/test_compile_consts.py +13 -19
  103. warp/tests/test_conditional.py +30 -32
  104. warp/tests/test_copy.py +9 -12
  105. warp/tests/test_ctypes.py +90 -98
  106. warp/tests/test_dense.py +20 -14
  107. warp/tests/test_devices.py +34 -35
  108. warp/tests/test_dlpack.py +74 -75
  109. warp/tests/test_examples.py +215 -97
  110. warp/tests/test_fabricarray.py +15 -21
  111. warp/tests/test_fast_math.py +14 -11
  112. warp/tests/test_fem.py +280 -97
  113. warp/tests/test_fp16.py +19 -15
  114. warp/tests/test_func.py +177 -194
  115. warp/tests/test_generics.py +71 -77
  116. warp/tests/test_grad.py +83 -32
  117. warp/tests/test_grad_customs.py +7 -9
  118. warp/tests/test_hash_grid.py +6 -10
  119. warp/tests/test_import.py +9 -23
  120. warp/tests/test_indexedarray.py +19 -21
  121. warp/tests/test_intersect.py +15 -9
  122. warp/tests/test_large.py +17 -19
  123. warp/tests/test_launch.py +14 -17
  124. warp/tests/test_lerp.py +63 -63
  125. warp/tests/test_lvalue.py +84 -35
  126. warp/tests/test_marching_cubes.py +9 -13
  127. warp/tests/test_mat.py +388 -3004
  128. warp/tests/test_mat_lite.py +9 -12
  129. warp/tests/test_mat_scalar_ops.py +2889 -0
  130. warp/tests/test_math.py +10 -11
  131. warp/tests/test_matmul.py +104 -100
  132. warp/tests/test_matmul_lite.py +72 -98
  133. warp/tests/test_mesh.py +35 -32
  134. warp/tests/test_mesh_query_aabb.py +18 -25
  135. warp/tests/test_mesh_query_point.py +39 -23
  136. warp/tests/test_mesh_query_ray.py +9 -21
  137. warp/tests/test_mlp.py +8 -9
  138. warp/tests/test_model.py +89 -93
  139. warp/tests/test_modules_lite.py +15 -25
  140. warp/tests/test_multigpu.py +87 -114
  141. warp/tests/test_noise.py +10 -12
  142. warp/tests/test_operators.py +14 -21
  143. warp/tests/test_options.py +10 -11
  144. warp/tests/test_pinned.py +16 -18
  145. warp/tests/test_print.py +16 -20
  146. warp/tests/test_quat.py +121 -88
  147. warp/tests/test_rand.py +12 -13
  148. warp/tests/test_reload.py +27 -32
  149. warp/tests/test_rounding.py +7 -10
  150. warp/tests/test_runlength_encode.py +105 -106
  151. warp/tests/test_smoothstep.py +8 -9
  152. warp/tests/test_snippet.py +13 -22
  153. warp/tests/test_sparse.py +30 -29
  154. warp/tests/test_spatial.py +179 -174
  155. warp/tests/test_streams.py +100 -107
  156. warp/tests/test_struct.py +98 -67
  157. warp/tests/test_tape.py +11 -17
  158. warp/tests/test_torch.py +89 -86
  159. warp/tests/test_transient_module.py +9 -12
  160. warp/tests/test_types.py +328 -50
  161. warp/tests/test_utils.py +217 -218
  162. warp/tests/test_vec.py +133 -2133
  163. warp/tests/test_vec_lite.py +8 -11
  164. warp/tests/test_vec_scalar_ops.py +2099 -0
  165. warp/tests/test_volume.py +391 -382
  166. warp/tests/test_volume_write.py +122 -135
  167. warp/tests/unittest_serial.py +35 -0
  168. warp/tests/unittest_suites.py +291 -0
  169. warp/tests/{test_base.py → unittest_utils.py} +138 -25
  170. warp/tests/{test_misc.py → unused_test_misc.py} +13 -5
  171. warp/tests/{test_debug.py → walkthough_debug.py} +2 -15
  172. warp/thirdparty/unittest_parallel.py +257 -54
  173. warp/types.py +119 -98
  174. warp/utils.py +14 -0
  175. {warp_lang-1.0.0b5.dist-info → warp_lang-1.0.0b6.dist-info}/METADATA +2 -1
  176. {warp_lang-1.0.0b5.dist-info → warp_lang-1.0.0b6.dist-info}/RECORD +182 -178
  177. {warp_lang-1.0.0b5.dist-info → warp_lang-1.0.0b6.dist-info}/WHEEL +1 -1
  178. warp/tests/test_all.py +0 -239
  179. warp/tests/test_conditional_unequal_types_kernels.py +0 -14
  180. warp/tests/test_coverage.py +0 -38
  181. warp/tests/test_unresolved_func.py +0 -7
  182. warp/tests/test_unresolved_symbol.py +0 -7
  183. /warp/tests/{test_compile_consts_dummy.py → aux_test_compile_consts_dummy.py} +0 -0
  184. /warp/tests/{test_reference_reference.py → aux_test_reference_reference.py} +0 -0
  185. /warp/tests/{test_square.py → aux_test_square.py} +0 -0
  186. {warp_lang-1.0.0b5.dist-info → warp_lang-1.0.0b6.dist-info}/LICENSE.md +0 -0
  187. {warp_lang-1.0.0b5.dist-info → warp_lang-1.0.0b6.dist-info}/top_level.txt +0 -0
warp/tests/test_all.py DELETED
@@ -1,239 +0,0 @@
1
- # Copyright (c) 2022 NVIDIA CORPORATION. All rights reserved.
2
- # NVIDIA CORPORATION and its licensors retain all intellectual property
3
- # and proprietary rights in and to this software, related documentation
4
- # and any modifications thereto. Any use, reproduction, disclosure or
5
- # distribution of this software and related documentation without an express
6
- # license agreement from NVIDIA CORPORATION is strictly prohibited.
7
-
8
- import os
9
- import unittest
10
-
11
- import warp as wp
12
- import warp.tests.test_adam
13
- import warp.tests.test_arithmetic
14
- import warp.tests.test_array
15
- import warp.tests.test_atomic
16
- import warp.tests.test_bool
17
- import warp.tests.test_bvh
18
- import warp.tests.test_closest_point_edge_edge
19
- import warp.tests.test_codegen
20
- import warp.tests.test_compile_consts
21
- import warp.tests.test_conditional
22
- import warp.tests.test_copy
23
- import warp.tests.test_ctypes
24
- import warp.tests.test_devices
25
- import warp.tests.test_dlpack
26
- import warp.tests.test_examples
27
- import warp.tests.test_fabricarray
28
- import warp.tests.test_fast_math
29
- import warp.tests.test_fem
30
- import warp.tests.test_fp16
31
- import warp.tests.test_func
32
- import warp.tests.test_generics
33
- import warp.tests.test_grad
34
- import warp.tests.test_grad_customs
35
- import warp.tests.test_hash_grid
36
- import warp.tests.test_import
37
- import warp.tests.test_indexedarray
38
- import warp.tests.test_intersect
39
- import warp.tests.test_large
40
- import warp.tests.test_launch
41
- import warp.tests.test_lerp
42
- import warp.tests.test_lvalue
43
- import warp.tests.test_mat
44
- import warp.tests.test_math
45
- import warp.tests.test_matmul
46
- import warp.tests.test_mesh
47
- import warp.tests.test_mesh_query_aabb
48
- import warp.tests.test_mesh_query_point
49
- import warp.tests.test_mesh_query_ray
50
- import warp.tests.test_mlp
51
- import warp.tests.test_model
52
- import warp.tests.test_modules_lite
53
- import warp.tests.test_multigpu
54
- import warp.tests.test_noise
55
- import warp.tests.test_operators
56
- import warp.tests.test_options
57
- import warp.tests.test_pinned
58
- import warp.tests.test_print
59
- import warp.tests.test_quat
60
- import warp.tests.test_rand
61
- import warp.tests.test_reload
62
- import warp.tests.test_rounding
63
- import warp.tests.test_smoothstep
64
- import warp.tests.test_snippet
65
- import warp.tests.test_sparse
66
- import warp.tests.test_spatial
67
- import warp.tests.test_streams
68
- import warp.tests.test_struct
69
- import warp.tests.test_tape
70
- import warp.tests.test_torch
71
- import warp.tests.test_transient_module
72
- import warp.tests.test_vec
73
- import warp.tests.test_volume
74
- from warp.tests.test_base import get_test_devices
75
-
76
- # Uncomment to run the tests on all devices
77
- # import warp.tests.test_base
78
- # warp.tests.test_base.test_mode = "all"
79
-
80
-
81
- def register_tests(parent):
82
- tests = []
83
-
84
- tests.append(warp.tests.test_codegen.register(parent))
85
- tests.append(warp.tests.test_mesh_query_aabb.register(parent))
86
- tests.append(warp.tests.test_mesh_query_point.register(parent))
87
- tests.append(warp.tests.test_mesh_query_ray.register(parent))
88
- tests.append(warp.tests.test_bvh.register(parent))
89
- tests.append(warp.tests.test_conditional.register(parent))
90
- tests.append(warp.tests.test_operators.register(parent))
91
- tests.append(warp.tests.test_rounding.register(parent))
92
- tests.append(warp.tests.test_hash_grid.register(parent))
93
- tests.append(warp.tests.test_ctypes.register(parent))
94
- tests.append(warp.tests.test_rand.register(parent))
95
- tests.append(warp.tests.test_noise.register(parent))
96
- tests.append(warp.tests.test_tape.register(parent))
97
- tests.append(warp.tests.test_compile_consts.register(parent))
98
- tests.append(warp.tests.test_volume.register(parent))
99
- tests.append(warp.tests.test_mlp.register(parent))
100
- tests.append(warp.tests.test_grad.register(parent))
101
- tests.append(warp.tests.test_grad_customs.register(parent))
102
- tests.append(warp.tests.test_intersect.register(parent))
103
- tests.append(warp.tests.test_array.register(parent))
104
- tests.append(warp.tests.test_launch.register(parent))
105
- tests.append(warp.tests.test_large.register(parent))
106
- tests.append(warp.tests.test_import.register(parent))
107
- tests.append(warp.tests.test_func.register(parent))
108
- tests.append(warp.tests.test_fp16.register(parent))
109
- tests.append(warp.tests.test_reload.register(parent))
110
- tests.append(warp.tests.test_struct.register(parent))
111
- tests.append(warp.tests.test_closest_point_edge_edge.register(parent))
112
- tests.append(warp.tests.test_multigpu.register(parent))
113
- tests.append(warp.tests.test_quat.register(parent))
114
- tests.append(warp.tests.test_atomic.register(parent))
115
- tests.append(warp.tests.test_adam.register(parent))
116
- tests.append(warp.tests.test_transient_module.register(parent))
117
- tests.append(warp.tests.test_lerp.register(parent))
118
- tests.append(warp.tests.test_smoothstep.register(parent))
119
- tests.append(warp.tests.test_model.register(parent))
120
- tests.append(warp.tests.test_fast_math.register(parent))
121
- tests.append(warp.tests.test_streams.register(parent))
122
- tests.append(warp.tests.test_torch.register(parent))
123
- tests.append(warp.tests.test_pinned.register(parent))
124
- tests.append(warp.tests.test_print.register(parent))
125
- tests.append(warp.tests.test_matmul.register(parent))
126
- tests.append(warp.tests.test_options.register(parent))
127
- tests.append(warp.tests.test_dlpack.register(parent))
128
- tests.append(warp.tests.test_vec.register(parent))
129
- tests.append(warp.tests.test_mat.register(parent))
130
- tests.append(warp.tests.test_arithmetic.register(parent))
131
- tests.append(warp.tests.test_spatial.register(parent))
132
- tests.append(warp.tests.test_sparse.register(parent))
133
- tests.append(warp.tests.test_math.register(parent))
134
- tests.append(warp.tests.test_generics.register(parent))
135
- tests.append(warp.tests.test_indexedarray.register(parent))
136
- tests.append(warp.tests.test_copy.register(parent))
137
- tests.append(warp.tests.test_mesh.register(parent))
138
- tests.append(warp.tests.test_fabricarray.register(parent))
139
- tests.append(warp.tests.test_bool.register(parent))
140
- tests.append(warp.tests.test_examples.register(parent)) # Needs to be before test_fem for now
141
- tests.append(warp.tests.test_fem.register(parent))
142
- tests.append(warp.tests.test_lvalue.register(parent))
143
- tests.append(warp.tests.test_devices.register(parent))
144
- tests.append(warp.tests.test_modules_lite.register(parent))
145
- tests.append(warp.tests.test_snippet.register(parent))
146
-
147
- return tests
148
-
149
-
150
- class TeamCityTestResult(unittest.TextTestResult):
151
- """This class will report each test result to TeamCity"""
152
-
153
- def __init__(self, stream, descriptions, verbosity):
154
- super(TeamCityTestResult, self).__init__(stream, descriptions, verbosity)
155
-
156
- def addSuccess(self, test):
157
- super(TeamCityTestResult, self).addSuccess(test)
158
- self.reportSuccess(test)
159
-
160
- def addError(self, test, err):
161
- super(TeamCityTestResult, self).addError(test, err)
162
- self.reportFailure(test)
163
-
164
- def addFailure(self, test, err):
165
- super(TeamCityTestResult, self).addFailure(test, err)
166
- self.reportFailure(test)
167
-
168
- def addSkip(self, test, reason):
169
- super(TeamCityTestResult, self).addSkip(test, reason)
170
-
171
- def addExpectedFailure(self, test, err):
172
- super(TeamCityTestResult, self).addExpectedFailure(test, err)
173
- self.reportSuccess(test)
174
-
175
- def addUnexpectedSuccess(self, test):
176
- super(TeamCityTestResult, self).addUnexpectedSuccess(test)
177
- self.reportFailure(test)
178
-
179
- def reportSuccess(self, test):
180
- test_id = test.id()
181
- print(f"##teamcity[testStarted name='{test_id}']")
182
- print(f"##teamcity[testFinished name='{test_id}']")
183
-
184
- def reportFailure(self, test):
185
- test_id = test.id()
186
- print(f"##teamcity[testStarted name='{test_id}']")
187
- print(f"##teamcity[testFailed name='{test_id}']")
188
- print(f"##teamcity[testFinished name='{test_id}']")
189
-
190
-
191
- class TeamCityTestRunner(unittest.TextTestRunner):
192
- """Test runner that will report test results to TeamCity if running in TeamCity"""
193
-
194
- def __init__(self, **kwargs):
195
- self.running_in_teamcity = os.environ.get("TEAMCITY_VERSION") is not None
196
- if self.running_in_teamcity:
197
- kwargs["resultclass"] = TeamCityTestResult
198
- super(TeamCityTestRunner, self).__init__(**kwargs)
199
-
200
- def run(self, test, name):
201
- if self.running_in_teamcity:
202
- print(f"##teamcity[testSuiteStarted name='{name}']")
203
-
204
- result = super(TeamCityTestRunner, self).run(test)
205
-
206
- if self.running_in_teamcity:
207
- print(f"##teamcity[testSuiteFinished name='{name}']")
208
- if not result.wasSuccessful():
209
- print("##teamcity[buildStatus status='FAILURE']")
210
-
211
- return result
212
-
213
-
214
- def run():
215
- test_suite = unittest.TestSuite()
216
-
217
- tests = register_tests(unittest.TestCase)
218
-
219
- for test in tests:
220
- test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(test))
221
-
222
- # force rebuild of all kernels
223
- wp.build.clear_kernel_cache()
224
-
225
- # load all modules
226
- for device in get_test_devices():
227
- wp.force_load(device)
228
-
229
- runner = TeamCityTestRunner(verbosity=2, failfast=False)
230
- ret = not runner.run(test_suite, "WarpTests").wasSuccessful()
231
- return ret
232
-
233
-
234
- if __name__ == "__main__":
235
- ret = run()
236
-
237
- import sys
238
-
239
- sys.exit(ret)
@@ -1,14 +0,0 @@
1
- # This file defines a kernel that fails on codegen.py
2
-
3
- import warp as wp
4
-
5
-
6
- @wp.kernel
7
- def unequal_types_kernel():
8
- x = wp.int32(10)
9
- y = 10
10
- z = True
11
-
12
- # Throws a TypeError
13
- if x == y == z:
14
- pass
@@ -1,38 +0,0 @@
1
- import os
2
-
3
- import coverage
4
-
5
- cover = coverage.Coverage(
6
- source=["warp", "warp.sim", "warp.render"],
7
- omit=[
8
- "build*.py",
9
- "copyright.py",
10
- "setup.py",
11
- os.path.join("warp", "stubs.py"),
12
- os.path.join("warp", "tests", "*.py"),
13
- os.path.join("warp", "thirdparty", "appdirs.py"),
14
- os.path.join("warp", "fem", "**", "*.py"),
15
- os.path.join("warp", "render", "render_opengl.py"),
16
- ],
17
- )
18
-
19
- cover.config.disable_warnings = [
20
- "module-not-measured",
21
- "module-not-imported",
22
- "no-data-collected",
23
- "couldnt-parse",
24
- ]
25
-
26
- cover.exclude("@wp")
27
- cover.exclude("@warp")
28
- cover.start()
29
-
30
- import test_all # noqa: E402
31
-
32
- test_all.run()
33
-
34
-
35
- cover.stop()
36
- cover.save()
37
-
38
- cover.html_report()
@@ -1,7 +0,0 @@
1
- import warp as wp
2
-
3
-
4
- @wp.kernel
5
- def unresolved_func_kernel():
6
- # this should trigger an exception due to unresolved function
7
- x = wp.missing_func(42)
@@ -1,7 +0,0 @@
1
- import warp as wp
2
-
3
-
4
- @wp.kernel
5
- def unresolved_symbol_kernel():
6
- # this should trigger an exception due to unresolved symbol
7
- x = missing_symbol
File without changes