warp-lang 1.7.2rc1__py3-none-macosx_10_13_universal2.whl → 1.8.1__py3-none-macosx_10_13_universal2.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.

Potentially problematic release.


This version of warp-lang might be problematic. Click here for more details.

Files changed (192) hide show
  1. warp/__init__.py +3 -1
  2. warp/__init__.pyi +3489 -1
  3. warp/autograd.py +45 -122
  4. warp/bin/libwarp.dylib +0 -0
  5. warp/build.py +241 -252
  6. warp/build_dll.py +130 -26
  7. warp/builtins.py +1907 -384
  8. warp/codegen.py +272 -104
  9. warp/config.py +12 -1
  10. warp/constants.py +1 -1
  11. warp/context.py +770 -238
  12. warp/dlpack.py +1 -1
  13. warp/examples/benchmarks/benchmark_cloth.py +2 -2
  14. warp/examples/benchmarks/benchmark_tile_sort.py +155 -0
  15. warp/examples/core/example_sample_mesh.py +1 -1
  16. warp/examples/core/example_spin_lock.py +93 -0
  17. warp/examples/core/example_work_queue.py +118 -0
  18. warp/examples/fem/example_adaptive_grid.py +5 -5
  19. warp/examples/fem/example_apic_fluid.py +1 -1
  20. warp/examples/fem/example_burgers.py +1 -1
  21. warp/examples/fem/example_convection_diffusion.py +9 -6
  22. warp/examples/fem/example_darcy_ls_optimization.py +489 -0
  23. warp/examples/fem/example_deformed_geometry.py +1 -1
  24. warp/examples/fem/example_diffusion.py +2 -2
  25. warp/examples/fem/example_diffusion_3d.py +1 -1
  26. warp/examples/fem/example_distortion_energy.py +1 -1
  27. warp/examples/fem/example_elastic_shape_optimization.py +387 -0
  28. warp/examples/fem/example_magnetostatics.py +5 -3
  29. warp/examples/fem/example_mixed_elasticity.py +5 -3
  30. warp/examples/fem/example_navier_stokes.py +11 -9
  31. warp/examples/fem/example_nonconforming_contact.py +5 -3
  32. warp/examples/fem/example_streamlines.py +8 -3
  33. warp/examples/fem/utils.py +9 -8
  34. warp/examples/interop/example_jax_callable.py +34 -4
  35. warp/examples/interop/example_jax_ffi_callback.py +2 -2
  36. warp/examples/interop/example_jax_kernel.py +27 -1
  37. warp/examples/optim/example_drone.py +1 -1
  38. warp/examples/sim/example_cloth.py +1 -1
  39. warp/examples/sim/example_cloth_self_contact.py +48 -54
  40. warp/examples/tile/example_tile_block_cholesky.py +502 -0
  41. warp/examples/tile/example_tile_cholesky.py +2 -1
  42. warp/examples/tile/example_tile_convolution.py +1 -1
  43. warp/examples/tile/example_tile_filtering.py +1 -1
  44. warp/examples/tile/example_tile_matmul.py +1 -1
  45. warp/examples/tile/example_tile_mlp.py +2 -0
  46. warp/fabric.py +7 -7
  47. warp/fem/__init__.py +5 -0
  48. warp/fem/adaptivity.py +1 -1
  49. warp/fem/cache.py +152 -63
  50. warp/fem/dirichlet.py +2 -2
  51. warp/fem/domain.py +136 -6
  52. warp/fem/field/field.py +141 -99
  53. warp/fem/field/nodal_field.py +85 -39
  54. warp/fem/field/virtual.py +99 -52
  55. warp/fem/geometry/adaptive_nanogrid.py +91 -86
  56. warp/fem/geometry/closest_point.py +13 -0
  57. warp/fem/geometry/deformed_geometry.py +102 -40
  58. warp/fem/geometry/element.py +56 -2
  59. warp/fem/geometry/geometry.py +323 -22
  60. warp/fem/geometry/grid_2d.py +157 -62
  61. warp/fem/geometry/grid_3d.py +116 -20
  62. warp/fem/geometry/hexmesh.py +86 -20
  63. warp/fem/geometry/nanogrid.py +166 -86
  64. warp/fem/geometry/partition.py +59 -25
  65. warp/fem/geometry/quadmesh.py +86 -135
  66. warp/fem/geometry/tetmesh.py +47 -119
  67. warp/fem/geometry/trimesh.py +77 -270
  68. warp/fem/integrate.py +181 -95
  69. warp/fem/linalg.py +25 -58
  70. warp/fem/operator.py +124 -27
  71. warp/fem/quadrature/pic_quadrature.py +36 -14
  72. warp/fem/quadrature/quadrature.py +40 -16
  73. warp/fem/space/__init__.py +1 -1
  74. warp/fem/space/basis_function_space.py +66 -46
  75. warp/fem/space/basis_space.py +17 -4
  76. warp/fem/space/dof_mapper.py +1 -1
  77. warp/fem/space/function_space.py +2 -2
  78. warp/fem/space/grid_2d_function_space.py +4 -1
  79. warp/fem/space/hexmesh_function_space.py +4 -2
  80. warp/fem/space/nanogrid_function_space.py +3 -1
  81. warp/fem/space/partition.py +11 -2
  82. warp/fem/space/quadmesh_function_space.py +4 -1
  83. warp/fem/space/restriction.py +5 -2
  84. warp/fem/space/shape/__init__.py +10 -8
  85. warp/fem/space/tetmesh_function_space.py +4 -1
  86. warp/fem/space/topology.py +52 -21
  87. warp/fem/space/trimesh_function_space.py +4 -1
  88. warp/fem/utils.py +53 -8
  89. warp/jax.py +1 -2
  90. warp/jax_experimental/ffi.py +210 -67
  91. warp/jax_experimental/xla_ffi.py +37 -24
  92. warp/math.py +171 -1
  93. warp/native/array.h +103 -4
  94. warp/native/builtin.h +182 -35
  95. warp/native/coloring.cpp +6 -2
  96. warp/native/cuda_util.cpp +1 -1
  97. warp/native/exports.h +118 -63
  98. warp/native/intersect.h +5 -5
  99. warp/native/mat.h +8 -13
  100. warp/native/mathdx.cpp +11 -5
  101. warp/native/matnn.h +1 -123
  102. warp/native/mesh.h +1 -1
  103. warp/native/quat.h +34 -6
  104. warp/native/rand.h +7 -7
  105. warp/native/sparse.cpp +121 -258
  106. warp/native/sparse.cu +181 -274
  107. warp/native/spatial.h +305 -17
  108. warp/native/svd.h +23 -8
  109. warp/native/tile.h +603 -73
  110. warp/native/tile_radix_sort.h +1112 -0
  111. warp/native/tile_reduce.h +239 -13
  112. warp/native/tile_scan.h +240 -0
  113. warp/native/tuple.h +189 -0
  114. warp/native/vec.h +10 -20
  115. warp/native/warp.cpp +36 -4
  116. warp/native/warp.cu +588 -52
  117. warp/native/warp.h +47 -74
  118. warp/optim/linear.py +5 -1
  119. warp/paddle.py +7 -8
  120. warp/py.typed +0 -0
  121. warp/render/render_opengl.py +110 -80
  122. warp/render/render_usd.py +124 -62
  123. warp/sim/__init__.py +9 -0
  124. warp/sim/collide.py +253 -80
  125. warp/sim/graph_coloring.py +8 -1
  126. warp/sim/import_mjcf.py +4 -3
  127. warp/sim/import_usd.py +11 -7
  128. warp/sim/integrator.py +5 -2
  129. warp/sim/integrator_euler.py +1 -1
  130. warp/sim/integrator_featherstone.py +1 -1
  131. warp/sim/integrator_vbd.py +761 -322
  132. warp/sim/integrator_xpbd.py +1 -1
  133. warp/sim/model.py +265 -260
  134. warp/sim/utils.py +10 -7
  135. warp/sparse.py +303 -166
  136. warp/tape.py +54 -51
  137. warp/tests/cuda/test_conditional_captures.py +1046 -0
  138. warp/tests/cuda/test_streams.py +1 -1
  139. warp/tests/geometry/test_volume.py +2 -2
  140. warp/tests/interop/test_dlpack.py +9 -9
  141. warp/tests/interop/test_jax.py +0 -1
  142. warp/tests/run_coverage_serial.py +1 -1
  143. warp/tests/sim/disabled_kinematics.py +2 -2
  144. warp/tests/sim/{test_vbd.py → test_cloth.py} +378 -112
  145. warp/tests/sim/test_collision.py +159 -51
  146. warp/tests/sim/test_coloring.py +91 -2
  147. warp/tests/test_array.py +254 -2
  148. warp/tests/test_array_reduce.py +2 -2
  149. warp/tests/test_assert.py +53 -0
  150. warp/tests/test_atomic_cas.py +312 -0
  151. warp/tests/test_codegen.py +142 -19
  152. warp/tests/test_conditional.py +47 -1
  153. warp/tests/test_ctypes.py +0 -20
  154. warp/tests/test_devices.py +8 -0
  155. warp/tests/test_fabricarray.py +4 -2
  156. warp/tests/test_fem.py +58 -25
  157. warp/tests/test_func.py +42 -1
  158. warp/tests/test_grad.py +1 -1
  159. warp/tests/test_lerp.py +1 -3
  160. warp/tests/test_map.py +481 -0
  161. warp/tests/test_mat.py +23 -24
  162. warp/tests/test_quat.py +28 -15
  163. warp/tests/test_rounding.py +10 -38
  164. warp/tests/test_runlength_encode.py +7 -7
  165. warp/tests/test_smoothstep.py +1 -1
  166. warp/tests/test_sparse.py +83 -2
  167. warp/tests/test_spatial.py +507 -1
  168. warp/tests/test_static.py +48 -0
  169. warp/tests/test_struct.py +2 -2
  170. warp/tests/test_tape.py +38 -0
  171. warp/tests/test_tuple.py +265 -0
  172. warp/tests/test_types.py +2 -2
  173. warp/tests/test_utils.py +24 -18
  174. warp/tests/test_vec.py +38 -408
  175. warp/tests/test_vec_constructors.py +325 -0
  176. warp/tests/tile/test_tile.py +438 -131
  177. warp/tests/tile/test_tile_mathdx.py +518 -14
  178. warp/tests/tile/test_tile_matmul.py +179 -0
  179. warp/tests/tile/test_tile_reduce.py +307 -5
  180. warp/tests/tile/test_tile_shared_memory.py +136 -7
  181. warp/tests/tile/test_tile_sort.py +121 -0
  182. warp/tests/unittest_suites.py +14 -6
  183. warp/types.py +462 -308
  184. warp/utils.py +647 -86
  185. {warp_lang-1.7.2rc1.dist-info → warp_lang-1.8.1.dist-info}/METADATA +20 -6
  186. {warp_lang-1.7.2rc1.dist-info → warp_lang-1.8.1.dist-info}/RECORD +189 -175
  187. warp/stubs.py +0 -3381
  188. warp/tests/sim/test_xpbd.py +0 -399
  189. warp/tests/test_mlp.py +0 -282
  190. {warp_lang-1.7.2rc1.dist-info → warp_lang-1.8.1.dist-info}/WHEEL +0 -0
  191. {warp_lang-1.7.2rc1.dist-info → warp_lang-1.8.1.dist-info}/licenses/LICENSE.md +0 -0
  192. {warp_lang-1.7.2rc1.dist-info → warp_lang-1.8.1.dist-info}/top_level.txt +0 -0
@@ -492,7 +492,7 @@ class TestStreams(unittest.TestCase):
492
492
 
493
493
  # Can't get the stream on a CPU device
494
494
  with self.assertRaises(RuntimeError):
495
- cpu_stream = cpu_device.stream # noqa: F841
495
+ cpu_stream = cpu_device.stream
496
496
 
497
497
  @unittest.skipUnless(len(wp.get_cuda_devices()) > 1, "Requires at least two CUDA devices")
498
498
  @unittest.skipUnless(check_p2p(), "Peer-to-Peer transfers not supported")
@@ -893,7 +893,7 @@ def test_volume_from_numpy_3d(test, device):
893
893
  nums = np.ceil((maxs - mins) / (voxel_size)).astype(dtype=int)
894
894
  centers = np.array([[-1.0, -1.0, -1.0], [0.0, 0.0, 0.0], [1.0, 1.0, 1.0]])
895
895
  rad = 2.5
896
- sphere_sdf_np = np.zeros(tuple(nums) + (3,))
896
+ sphere_sdf_np = np.zeros((*tuple(nums), 3))
897
897
  for x in range(nums[0]):
898
898
  for y in range(nums[1]):
899
899
  for z in range(nums[2]):
@@ -935,7 +935,7 @@ def test_volume_aniso_transform(test, device):
935
935
  def test_volume_write(test, device):
936
936
  codecs = ["none", "zip", "blosc"]
937
937
  try:
938
- import blosc # noqa: F401 I001
938
+ import blosc # noqa: F401
939
939
  except ImportError:
940
940
  codecs.pop()
941
941
 
@@ -412,8 +412,8 @@ def test_dlpack_warp_to_jax(test, device):
412
412
 
413
413
  test.assertEqual(a.ptr, j1.unsafe_buffer_pointer())
414
414
  test.assertEqual(a.ptr, j2.unsafe_buffer_pointer())
415
- test.assertEqual(a.device, wp.device_from_jax(list(j1.devices())[0]))
416
- test.assertEqual(a.device, wp.device_from_jax(list(j2.devices())[0]))
415
+ test.assertEqual(a.device, wp.device_from_jax(next(iter(j1.devices()))))
416
+ test.assertEqual(a.device, wp.device_from_jax(next(iter(j2.devices()))))
417
417
  test.assertEqual(a.shape, j1.shape)
418
418
  test.assertEqual(a.shape, j2.shape)
419
419
 
@@ -460,8 +460,8 @@ def test_dlpack_warp_to_jax_v2(test, device):
460
460
 
461
461
  test.assertEqual(a.ptr, j1.unsafe_buffer_pointer())
462
462
  test.assertEqual(a.ptr, j2.unsafe_buffer_pointer())
463
- test.assertEqual(a.device, wp.device_from_jax(list(j1.devices())[0]))
464
- test.assertEqual(a.device, wp.device_from_jax(list(j2.devices())[0]))
463
+ test.assertEqual(a.device, wp.device_from_jax(next(iter(j1.devices()))))
464
+ test.assertEqual(a.device, wp.device_from_jax(next(iter(j2.devices()))))
465
465
  test.assertEqual(a.shape, j1.shape)
466
466
  test.assertEqual(a.shape, j2.shape)
467
467
 
@@ -543,15 +543,15 @@ def test_dlpack_jax_to_warp(test, device):
543
543
  j = jax.numpy.arange(N, dtype=jax.numpy.float32)
544
544
 
545
545
  # use generic dlpack conversion
546
- a1 = wp.from_dlpack(jax.dlpack.to_dlpack(j))
546
+ a1 = wp.from_dlpack(j)
547
547
 
548
548
  # use jax wrapper
549
549
  a2 = wp.from_jax(j)
550
550
 
551
551
  test.assertEqual(a1.ptr, j.unsafe_buffer_pointer())
552
552
  test.assertEqual(a2.ptr, j.unsafe_buffer_pointer())
553
- test.assertEqual(a1.device, wp.device_from_jax(list(j.devices())[0]))
554
- test.assertEqual(a2.device, wp.device_from_jax(list(j.devices())[0]))
553
+ test.assertEqual(a1.device, wp.device_from_jax(next(iter(j.devices()))))
554
+ test.assertEqual(a2.device, wp.device_from_jax(next(iter(j.devices()))))
555
555
  test.assertEqual(a1.shape, j.shape)
556
556
  test.assertEqual(a2.shape, j.shape)
557
557
 
@@ -586,8 +586,8 @@ def test_dlpack_jax_to_warp_v2(test, device):
586
586
 
587
587
  test.assertEqual(a1.ptr, j.unsafe_buffer_pointer())
588
588
  test.assertEqual(a2.ptr, j.unsafe_buffer_pointer())
589
- test.assertEqual(a1.device, wp.device_from_jax(list(j.devices())[0]))
590
- test.assertEqual(a2.device, wp.device_from_jax(list(j.devices())[0]))
589
+ test.assertEqual(a1.device, wp.device_from_jax(next(iter(j.devices()))))
590
+ test.assertEqual(a2.device, wp.device_from_jax(next(iter(j.devices()))))
591
591
  test.assertEqual(a1.shape, j.shape)
592
592
  test.assertEqual(a2.shape, j.shape)
593
593
 
@@ -319,7 +319,6 @@ try:
319
319
  os.environ["XLA_PYTHON_CLIENT_ALLOCATOR"] = "platform"
320
320
 
321
321
  import jax
322
- import jax.dlpack
323
322
 
324
323
  # NOTE: we must enable 64-bit types in Jax to test the full gamut of types
325
324
  jax.config.update("jax_enable_x64", True)
@@ -28,7 +28,7 @@ cover = coverage.Coverage(config_file=True, messages=True)
28
28
  cover.start()
29
29
 
30
30
  with cover.collect():
31
- import unittest_serial # noqa: E402
31
+ import unittest_serial
32
32
 
33
33
  unittest_serial.run_specified()
34
34
 
@@ -123,7 +123,7 @@ def build_complex_joint_mechanism(chain_length):
123
123
  parent_xform=tf1,
124
124
  child_xform=tf2,
125
125
  )
126
- builder.joint_q[-7:] = [0.5, -0.9, 1.4] + list(wp.quat_rpy(0.3, -0.5, 0.7))
126
+ builder.joint_q[-7:] = [0.5, -0.9, 1.4, *wp.quat_rpy(0.3, -0.5, 0.7)]
127
127
  builder.joint_qd[-6:] = [1.0, -1.0, 0.5, 0.8, -0.3, 0.1]
128
128
 
129
129
  b8 = builder.add_body(com=com2)
@@ -133,7 +133,7 @@ def build_complex_joint_mechanism(chain_length):
133
133
  parent_xform=tf1,
134
134
  child_xform=tf2,
135
135
  )
136
- builder.joint_q[-7:] = [-0.3, -0.7, 0.2] + list(wp.quat_rpy(0.1, 0.1, 0.4))
136
+ builder.joint_q[-7:] = [-0.3, -0.7, 0.2, *wp.quat_rpy(0.1, 0.1, 0.4)]
137
137
  builder.joint_qd[-6:] = [-0.34, 0.5, -0.6, -0.4, 0.2, 0.1]
138
138
 
139
139
  # D6 joint that behaves like a fixed joint