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
@@ -1,12 +1,16 @@
1
1
  from typing import Optional
2
- import warp as wp
3
-
4
- from warp.fem.types import ElementIndex, Coords, Sample
5
- from warp.fem.types import OUTSIDE, make_free_sample
6
- from warp.fem.cache import cached_arg_value, TemporaryStore, borrow_temporary, borrow_temporary_like
7
2
 
3
+ import warp as wp
4
+ from warp.fem.cache import (
5
+ TemporaryStore,
6
+ borrow_temporary,
7
+ borrow_temporary_like,
8
+ cached_arg_value,
9
+ )
10
+ from warp.fem.types import OUTSIDE, Coords, ElementIndex, Sample, make_free_sample
11
+
12
+ from .element import LinearEdge, Square
8
13
  from .geometry import Geometry
9
- from .element import Square, LinearEdge
10
14
 
11
15
  # from .closest_point import project_on_tet_at_origin
12
16
 
@@ -120,7 +124,7 @@ class Quadmesh2D(Geometry):
120
124
  )
121
125
 
122
126
  @wp.func
123
- def cell_deformation_gradient(cell_arg: CellArg, s:Sample):
127
+ def cell_deformation_gradient(cell_arg: CellArg, s: Sample):
124
128
  """Deformation gradient at `coords`"""
125
129
  quad_idx = cell_arg.quad_vertex_indices[s.element_index]
126
130
 
@@ -135,7 +139,7 @@ class Quadmesh2D(Geometry):
135
139
  )
136
140
 
137
141
  @wp.func
138
- def cell_inverse_deformation_gradient(cell_arg: CellArg, s:Sample):
142
+ def cell_inverse_deformation_gradient(cell_arg: CellArg, s: Sample):
139
143
  return wp.inverse(Quadmesh2D.cell_deformation_gradient(cell_arg, s))
140
144
 
141
145
  @wp.func
@@ -178,20 +182,20 @@ class Quadmesh2D(Geometry):
178
182
  ] * args.cell_arg.positions[edge_idx[1]]
179
183
 
180
184
  @wp.func
181
- def side_deformation_gradient(args: SideArg, s:Sample):
185
+ def side_deformation_gradient(args: SideArg, s: Sample):
182
186
  edge_idx = args.edge_vertex_indices[s.element_index]
183
187
  v0 = args.cell_arg.positions[edge_idx[0]]
184
188
  v1 = args.cell_arg.positions[edge_idx[1]]
185
189
  return v1 - v0
186
190
 
187
191
  @wp.func
188
- def side_inner_inverse_deformation_gradient(args: SideArg, s:Sample):
192
+ def side_inner_inverse_deformation_gradient(args: SideArg, s: Sample):
189
193
  cell_index = Quadmesh2D.side_inner_cell_index(args, s.element_index)
190
194
  cell_coords = Quadmesh2D.side_inner_cell_coords(args, s.element_index, s.element_coords)
191
195
  return Quadmesh2D.cell_inverse_deformation_gradient(args.cell_arg, make_free_sample(cell_index, cell_coords))
192
196
 
193
197
  @wp.func
194
- def side_outer_inverse_deformation_gradient(args: SideArg, s:Sample):
198
+ def side_outer_inverse_deformation_gradient(args: SideArg, s: Sample):
195
199
  cell_index = Quadmesh2D.side_outer_cell_index(args, s.element_index)
196
200
  cell_coords = Quadmesh2D.side_outer_cell_coords(args, s.element_index, s.element_coords)
197
201
  return Quadmesh2D.cell_inverse_deformation_gradient(args.cell_arg, make_free_sample(cell_index, cell_coords))
@@ -352,7 +356,7 @@ class Quadmesh2D(Geometry):
352
356
  wp.copy(
353
357
  dest=edge_count.array, src=vertex_unique_edge_offsets.array, src_offset=self.vertex_count() - 1, count=1
354
358
  )
355
- wp.synchronize_stream(wp.get_stream())
359
+ wp.synchronize_stream(wp.get_stream(device))
356
360
  edge_count = int(edge_count.array.numpy()[0])
357
361
  else:
358
362
  edge_count = int(vertex_unique_edge_offsets.array.numpy()[self.vertex_count() - 1])
@@ -1,13 +1,24 @@
1
1
  from typing import Optional
2
- import warp as wp
3
2
 
4
- from warp.fem.types import ElementIndex, Coords, Sample, make_free_sample
5
- from warp.fem.types import NULL_ELEMENT_INDEX, OUTSIDE
6
- from warp.fem.cache import cached_arg_value, TemporaryStore, borrow_temporary, borrow_temporary_like
3
+ import warp as wp
4
+ from warp.fem.cache import (
5
+ TemporaryStore,
6
+ borrow_temporary,
7
+ borrow_temporary_like,
8
+ cached_arg_value,
9
+ )
10
+ from warp.fem.types import (
11
+ NULL_ELEMENT_INDEX,
12
+ OUTSIDE,
13
+ Coords,
14
+ ElementIndex,
15
+ Sample,
16
+ make_free_sample,
17
+ )
7
18
 
8
- from .geometry import Geometry
9
- from .element import Triangle, Tetrahedron
10
19
  from .closest_point import project_on_tet_at_origin
20
+ from .element import Tetrahedron, Triangle
21
+ from .geometry import Geometry
11
22
 
12
23
 
13
24
  @wp.struct
@@ -401,7 +412,7 @@ class Tetmesh(Geometry):
401
412
  wp.copy(
402
413
  dest=face_count.array, src=vertex_unique_face_offsets.array, src_offset=self.vertex_count() - 1, count=1
403
414
  )
404
- wp.synchronize_stream(wp.get_stream())
415
+ wp.synchronize_stream(wp.get_stream(device))
405
416
  face_count = int(face_count.array.numpy()[0])
406
417
  else:
407
418
  face_count = int(vertex_unique_face_offsets.array.numpy()[self.vertex_count() - 1])
@@ -497,7 +508,7 @@ class Tetmesh(Geometry):
497
508
  src_offset=self.vertex_count() - 1,
498
509
  count=1,
499
510
  )
500
- wp.synchronize_stream(wp.get_stream())
511
+ wp.synchronize_stream(wp.get_stream(device))
501
512
  self._edge_count = int(edge_count.array.numpy()[0])
502
513
  else:
503
514
  self._edge_count = int(vertex_unique_edge_offsets.array.numpy()[self.vertex_count() - 1])
@@ -1,13 +1,24 @@
1
1
  from typing import Optional
2
- import warp as wp
3
2
 
4
- from warp.fem.types import ElementIndex, Coords, Sample, make_free_sample
5
- from warp.fem.types import NULL_ELEMENT_INDEX, OUTSIDE
6
- from warp.fem.cache import cached_arg_value, TemporaryStore, borrow_temporary, borrow_temporary_like
3
+ import warp as wp
4
+ from warp.fem.cache import (
5
+ TemporaryStore,
6
+ borrow_temporary,
7
+ borrow_temporary_like,
8
+ cached_arg_value,
9
+ )
10
+ from warp.fem.types import (
11
+ NULL_ELEMENT_INDEX,
12
+ OUTSIDE,
13
+ Coords,
14
+ ElementIndex,
15
+ Sample,
16
+ make_free_sample,
17
+ )
7
18
 
8
- from .geometry import Geometry
9
- from .element import Triangle, LinearEdge
10
19
  from .closest_point import project_on_tri_at_origin
20
+ from .element import LinearEdge, Triangle
21
+ from .geometry import Geometry
11
22
 
12
23
 
13
24
  @wp.struct
@@ -365,7 +376,7 @@ class Trimesh2D(Geometry):
365
376
  wp.copy(
366
377
  dest=edge_count.array, src=vertex_unique_edge_offsets.array, src_offset=self.vertex_count() - 1, count=1
367
378
  )
368
- wp.synchronize_stream(wp.get_stream())
379
+ wp.synchronize_stream(wp.get_stream(device))
369
380
  edge_count = int(edge_count.array.numpy()[0])
370
381
  else:
371
382
  edge_count = int(vertex_unique_edge_offsets.array.numpy()[self.vertex_count() - 1])