warp-lang 1.6.2__py3-none-win_amd64.whl → 1.7.1__py3-none-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.
Potentially problematic release.
This version of warp-lang might be problematic. Click here for more details.
- warp/__init__.py +7 -1
- warp/autograd.py +12 -2
- warp/bin/warp-clang.dll +0 -0
- warp/bin/warp.dll +0 -0
- warp/build.py +410 -0
- warp/build_dll.py +6 -14
- warp/builtins.py +463 -372
- warp/codegen.py +196 -124
- warp/config.py +42 -6
- warp/context.py +496 -271
- warp/dlpack.py +8 -6
- warp/examples/assets/nonuniform.usd +0 -0
- warp/examples/assets/nvidia_logo.png +0 -0
- warp/examples/benchmarks/benchmark_cloth.py +1 -1
- warp/examples/benchmarks/benchmark_tile_load_store.py +103 -0
- warp/examples/core/example_sample_mesh.py +300 -0
- warp/examples/distributed/example_jacobi_mpi.py +507 -0
- warp/examples/fem/example_apic_fluid.py +1 -1
- warp/examples/fem/example_burgers.py +2 -2
- warp/examples/fem/example_deformed_geometry.py +1 -1
- warp/examples/fem/example_distortion_energy.py +1 -1
- warp/examples/fem/example_magnetostatics.py +6 -6
- warp/examples/fem/utils.py +9 -3
- warp/examples/interop/example_jax_callable.py +116 -0
- warp/examples/interop/example_jax_ffi_callback.py +132 -0
- warp/examples/interop/example_jax_kernel.py +205 -0
- warp/examples/optim/example_fluid_checkpoint.py +497 -0
- warp/examples/tile/example_tile_matmul.py +2 -4
- warp/fem/__init__.py +11 -1
- warp/fem/adaptivity.py +4 -4
- warp/fem/field/field.py +11 -1
- warp/fem/field/nodal_field.py +56 -88
- warp/fem/field/virtual.py +62 -23
- warp/fem/geometry/adaptive_nanogrid.py +16 -13
- warp/fem/geometry/closest_point.py +1 -1
- warp/fem/geometry/deformed_geometry.py +5 -2
- warp/fem/geometry/geometry.py +5 -0
- warp/fem/geometry/grid_2d.py +12 -12
- warp/fem/geometry/grid_3d.py +12 -15
- warp/fem/geometry/hexmesh.py +5 -7
- warp/fem/geometry/nanogrid.py +9 -11
- warp/fem/geometry/quadmesh.py +13 -13
- warp/fem/geometry/tetmesh.py +3 -4
- warp/fem/geometry/trimesh.py +7 -20
- warp/fem/integrate.py +262 -93
- warp/fem/linalg.py +5 -5
- warp/fem/quadrature/pic_quadrature.py +37 -22
- warp/fem/quadrature/quadrature.py +194 -25
- warp/fem/space/__init__.py +1 -1
- warp/fem/space/basis_function_space.py +4 -2
- warp/fem/space/basis_space.py +25 -18
- warp/fem/space/hexmesh_function_space.py +2 -2
- warp/fem/space/partition.py +6 -2
- warp/fem/space/quadmesh_function_space.py +8 -8
- warp/fem/space/shape/cube_shape_function.py +23 -23
- warp/fem/space/shape/square_shape_function.py +12 -12
- warp/fem/space/shape/triangle_shape_function.py +1 -1
- warp/fem/space/tetmesh_function_space.py +3 -3
- warp/fem/space/trimesh_function_space.py +2 -2
- warp/fem/utils.py +12 -6
- warp/jax.py +14 -1
- warp/jax_experimental/__init__.py +16 -0
- warp/{jax_experimental.py → jax_experimental/custom_call.py} +28 -29
- warp/jax_experimental/ffi.py +702 -0
- warp/jax_experimental/xla_ffi.py +602 -0
- warp/math.py +89 -0
- warp/native/array.h +13 -0
- warp/native/builtin.h +29 -3
- warp/native/bvh.cpp +3 -1
- warp/native/bvh.cu +42 -14
- warp/native/bvh.h +2 -1
- warp/native/clang/clang.cpp +30 -3
- warp/native/cuda_util.cpp +14 -0
- warp/native/cuda_util.h +2 -0
- warp/native/exports.h +68 -63
- warp/native/intersect.h +26 -26
- warp/native/intersect_adj.h +33 -33
- warp/native/marching.cu +1 -1
- warp/native/mat.h +513 -9
- warp/native/mesh.h +10 -10
- warp/native/quat.h +99 -11
- warp/native/rand.h +6 -0
- warp/native/sort.cpp +122 -59
- warp/native/sort.cu +152 -15
- warp/native/sort.h +8 -1
- warp/native/sparse.cpp +43 -22
- warp/native/sparse.cu +52 -17
- warp/native/svd.h +116 -0
- warp/native/tile.h +312 -116
- warp/native/tile_reduce.h +46 -3
- warp/native/vec.h +68 -7
- warp/native/volume.cpp +85 -113
- warp/native/volume_builder.cu +25 -10
- warp/native/volume_builder.h +6 -0
- warp/native/warp.cpp +5 -6
- warp/native/warp.cu +100 -11
- warp/native/warp.h +19 -10
- warp/optim/linear.py +10 -10
- warp/render/render_opengl.py +19 -17
- warp/render/render_usd.py +93 -3
- warp/sim/articulation.py +4 -4
- warp/sim/collide.py +32 -19
- warp/sim/import_mjcf.py +449 -155
- warp/sim/import_urdf.py +32 -12
- warp/sim/inertia.py +189 -156
- warp/sim/integrator_euler.py +8 -5
- warp/sim/integrator_featherstone.py +3 -10
- warp/sim/integrator_vbd.py +207 -2
- warp/sim/integrator_xpbd.py +8 -5
- warp/sim/model.py +71 -25
- warp/sim/render.py +4 -0
- warp/sim/utils.py +2 -2
- warp/sparse.py +642 -555
- warp/stubs.py +217 -20
- warp/tests/__main__.py +0 -15
- warp/tests/assets/torus.usda +1 -1
- warp/tests/cuda/__init__.py +0 -0
- warp/tests/{test_mempool.py → cuda/test_mempool.py} +39 -0
- warp/tests/{test_streams.py → cuda/test_streams.py} +71 -0
- warp/tests/geometry/__init__.py +0 -0
- warp/tests/{test_mesh_query_point.py → geometry/test_mesh_query_point.py} +66 -63
- warp/tests/{test_mesh_query_ray.py → geometry/test_mesh_query_ray.py} +1 -1
- warp/tests/{test_volume.py → geometry/test_volume.py} +41 -6
- warp/tests/interop/__init__.py +0 -0
- warp/tests/{test_dlpack.py → interop/test_dlpack.py} +28 -5
- warp/tests/sim/__init__.py +0 -0
- warp/tests/{disabled_kinematics.py → sim/disabled_kinematics.py} +9 -10
- warp/tests/{test_collision.py → sim/test_collision.py} +236 -205
- warp/tests/sim/test_inertia.py +161 -0
- warp/tests/{test_model.py → sim/test_model.py} +40 -0
- warp/tests/{flaky_test_sim_grad.py → sim/test_sim_grad.py} +4 -0
- warp/tests/{test_sim_kinematics.py → sim/test_sim_kinematics.py} +2 -1
- warp/tests/sim/test_vbd.py +597 -0
- warp/tests/sim/test_xpbd.py +399 -0
- warp/tests/test_bool.py +1 -1
- warp/tests/test_codegen.py +24 -3
- warp/tests/test_examples.py +40 -38
- warp/tests/test_fem.py +98 -14
- warp/tests/test_linear_solvers.py +0 -11
- warp/tests/test_mat.py +577 -156
- warp/tests/test_mat_scalar_ops.py +4 -4
- warp/tests/test_overwrite.py +0 -60
- warp/tests/test_quat.py +356 -151
- warp/tests/test_rand.py +44 -37
- warp/tests/test_sparse.py +47 -6
- warp/tests/test_spatial.py +75 -0
- warp/tests/test_static.py +1 -1
- warp/tests/test_utils.py +84 -4
- warp/tests/test_vec.py +336 -178
- warp/tests/tile/__init__.py +0 -0
- warp/tests/{test_tile.py → tile/test_tile.py} +136 -51
- warp/tests/{test_tile_load.py → tile/test_tile_load.py} +98 -1
- warp/tests/{test_tile_mathdx.py → tile/test_tile_mathdx.py} +9 -6
- warp/tests/{test_tile_mlp.py → tile/test_tile_mlp.py} +25 -14
- warp/tests/{test_tile_reduce.py → tile/test_tile_reduce.py} +60 -1
- warp/tests/{test_tile_view.py → tile/test_tile_view.py} +1 -1
- warp/tests/unittest_serial.py +1 -0
- warp/tests/unittest_suites.py +45 -62
- warp/tests/unittest_utils.py +2 -1
- warp/thirdparty/unittest_parallel.py +3 -1
- warp/types.py +175 -666
- warp/utils.py +137 -72
- {warp_lang-1.6.2.dist-info → warp_lang-1.7.1.dist-info}/METADATA +46 -12
- {warp_lang-1.6.2.dist-info → warp_lang-1.7.1.dist-info}/RECORD +184 -171
- {warp_lang-1.6.2.dist-info → warp_lang-1.7.1.dist-info}/WHEEL +1 -1
- {warp_lang-1.6.2.dist-info → warp_lang-1.7.1.dist-info/licenses}/LICENSE.md +0 -26
- warp/examples/optim/example_walker.py +0 -317
- warp/native/cutlass_gemm.cpp +0 -43
- warp/native/cutlass_gemm.cu +0 -382
- warp/tests/test_matmul.py +0 -511
- warp/tests/test_matmul_lite.py +0 -411
- warp/tests/test_vbd.py +0 -386
- warp/tests/unused_test_misc.py +0 -77
- /warp/tests/{test_async.py → cuda/test_async.py} +0 -0
- /warp/tests/{test_ipc.py → cuda/test_ipc.py} +0 -0
- /warp/tests/{test_multigpu.py → cuda/test_multigpu.py} +0 -0
- /warp/tests/{test_peer.py → cuda/test_peer.py} +0 -0
- /warp/tests/{test_pinned.py → cuda/test_pinned.py} +0 -0
- /warp/tests/{test_bvh.py → geometry/test_bvh.py} +0 -0
- /warp/tests/{test_hash_grid.py → geometry/test_hash_grid.py} +0 -0
- /warp/tests/{test_marching_cubes.py → geometry/test_marching_cubes.py} +0 -0
- /warp/tests/{test_mesh.py → geometry/test_mesh.py} +0 -0
- /warp/tests/{test_mesh_query_aabb.py → geometry/test_mesh_query_aabb.py} +0 -0
- /warp/tests/{test_volume_write.py → geometry/test_volume_write.py} +0 -0
- /warp/tests/{test_jax.py → interop/test_jax.py} +0 -0
- /warp/tests/{test_paddle.py → interop/test_paddle.py} +0 -0
- /warp/tests/{test_torch.py → interop/test_torch.py} +0 -0
- /warp/tests/{test_coloring.py → sim/test_coloring.py} +0 -0
- /warp/tests/{test_sim_grad_bounce_linear.py → sim/test_sim_grad_bounce_linear.py} +0 -0
- /warp/tests/{test_tile_shared_memory.py → tile/test_tile_shared_memory.py} +0 -0
- {warp_lang-1.6.2.dist-info → warp_lang-1.7.1.dist-info}/top_level.txt +0 -0
warp/sim/articulation.py
CHANGED
|
@@ -30,7 +30,7 @@ def compute_2d_rotational_dofs(
|
|
|
30
30
|
"""
|
|
31
31
|
Computes the rotation quaternion and 3D angular velocity given the joint axes, coordinates and velocities.
|
|
32
32
|
"""
|
|
33
|
-
q_off = wp.quat_from_matrix(wp.
|
|
33
|
+
q_off = wp.quat_from_matrix(wp.matrix_from_cols(axis_0, axis_1, wp.cross(axis_0, axis_1)))
|
|
34
34
|
|
|
35
35
|
# body local axes
|
|
36
36
|
local_0 = wp.quat_rotate(q_off, wp.vec3(1.0, 0.0, 0.0))
|
|
@@ -60,7 +60,7 @@ def invert_2d_rotational_dofs(
|
|
|
60
60
|
"""
|
|
61
61
|
Computes generalized joint position and velocity coordinates for a 2D rotational joint given the joint axes, relative orientations and angular velocity differences between the two bodies the joint connects.
|
|
62
62
|
"""
|
|
63
|
-
q_off = wp.quat_from_matrix(wp.
|
|
63
|
+
q_off = wp.quat_from_matrix(wp.matrix_from_cols(axis_0, axis_1, wp.cross(axis_0, axis_1)))
|
|
64
64
|
q_pc = wp.quat_inverse(q_off) * wp.quat_inverse(q_p) * q_c * q_off
|
|
65
65
|
|
|
66
66
|
# decompose to a compound rotation each axis
|
|
@@ -106,7 +106,7 @@ def compute_3d_rotational_dofs(
|
|
|
106
106
|
"""
|
|
107
107
|
Computes the rotation quaternion and 3D angular velocity given the joint axes, coordinates and velocities.
|
|
108
108
|
"""
|
|
109
|
-
q_off = wp.quat_from_matrix(wp.
|
|
109
|
+
q_off = wp.quat_from_matrix(wp.matrix_from_cols(axis_0, axis_1, axis_2))
|
|
110
110
|
|
|
111
111
|
# body local axes
|
|
112
112
|
local_0 = wp.quat_rotate(q_off, wp.vec3(1.0, 0.0, 0.0))
|
|
@@ -136,7 +136,7 @@ def invert_3d_rotational_dofs(
|
|
|
136
136
|
"""
|
|
137
137
|
Computes generalized joint position and velocity coordinates for a 3D rotational joint given the joint axes, relative orientations and angular velocity differences between the two bodies the joint connects.
|
|
138
138
|
"""
|
|
139
|
-
q_off = wp.quat_from_matrix(wp.
|
|
139
|
+
q_off = wp.quat_from_matrix(wp.matrix_from_cols(axis_0, axis_1, axis_2))
|
|
140
140
|
q_pc = wp.quat_inverse(q_off) * wp.quat_inverse(q_p) * q_c * q_off
|
|
141
141
|
|
|
142
142
|
# decompose to a compound rotation each axis
|
warp/sim/collide.py
CHANGED
|
@@ -17,10 +17,12 @@
|
|
|
17
17
|
Collision handling functions and kernels.
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
|
+
from typing import Optional
|
|
21
|
+
|
|
20
22
|
import numpy as np
|
|
21
23
|
|
|
22
24
|
import warp as wp
|
|
23
|
-
from warp.sim.model import Model
|
|
25
|
+
from warp.sim.model import Model, State
|
|
24
26
|
|
|
25
27
|
from .model import PARTICLE_FLAG_ACTIVE, ModelShapeGeometry
|
|
26
28
|
|
|
@@ -612,9 +614,9 @@ def volume_grad(volume: wp.uint64, p: wp.vec3):
|
|
|
612
614
|
@wp.func
|
|
613
615
|
def counter_increment(counter: wp.array(dtype=int), counter_index: int, tids: wp.array(dtype=int), tid: int):
|
|
614
616
|
# increment counter, remember which thread received which counter value
|
|
615
|
-
|
|
616
|
-
tids[tid] =
|
|
617
|
-
return
|
|
617
|
+
count = wp.atomic_add(counter, counter_index, 1)
|
|
618
|
+
tids[tid] = count
|
|
619
|
+
return count
|
|
618
620
|
|
|
619
621
|
|
|
620
622
|
@wp.func_replay(counter_increment)
|
|
@@ -627,10 +629,10 @@ def limited_counter_increment(
|
|
|
627
629
|
counter: wp.array(dtype=int), counter_index: int, tids: wp.array(dtype=int), tid: int, index_limit: int
|
|
628
630
|
):
|
|
629
631
|
# increment counter but only if it is smaller than index_limit, remember which thread received which counter value
|
|
630
|
-
|
|
631
|
-
if
|
|
632
|
-
tids[tid] =
|
|
633
|
-
return
|
|
632
|
+
count = wp.atomic_add(counter, counter_index, 1)
|
|
633
|
+
if count < index_limit or index_limit < 0:
|
|
634
|
+
tids[tid] = count
|
|
635
|
+
return count
|
|
634
636
|
tids[tid] = -1
|
|
635
637
|
return -1
|
|
636
638
|
|
|
@@ -1545,6 +1547,8 @@ def handle_contact_pairs(
|
|
|
1545
1547
|
# reached contact point limit
|
|
1546
1548
|
return
|
|
1547
1549
|
index = counter_increment(contact_count, 0, contact_tids, tid)
|
|
1550
|
+
if index == -1:
|
|
1551
|
+
return
|
|
1548
1552
|
contact_shape0[index] = shape_a
|
|
1549
1553
|
contact_shape1[index] = shape_b
|
|
1550
1554
|
# transform from world into body frame (so the contact point includes the shape transform)
|
|
@@ -1556,17 +1560,23 @@ def handle_contact_pairs(
|
|
|
1556
1560
|
contact_thickness[index] = thickness
|
|
1557
1561
|
|
|
1558
1562
|
|
|
1559
|
-
def collide(
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
+
def collide(
|
|
1564
|
+
model: Model,
|
|
1565
|
+
state: State,
|
|
1566
|
+
edge_sdf_iter: int = 10,
|
|
1567
|
+
iterate_mesh_vertices: bool = True,
|
|
1568
|
+
requires_grad: Optional[bool] = None,
|
|
1569
|
+
) -> None:
|
|
1570
|
+
"""Generate contact points for the particles and rigid bodies in the model for use in contact-dynamics kernels.
|
|
1563
1571
|
|
|
1564
1572
|
Args:
|
|
1565
|
-
model:
|
|
1566
|
-
state:
|
|
1567
|
-
edge_sdf_iter:
|
|
1568
|
-
iterate_mesh_vertices:
|
|
1569
|
-
|
|
1573
|
+
model: The model to be simulated.
|
|
1574
|
+
state: The state of the model.
|
|
1575
|
+
edge_sdf_iter: Number of search iterations for finding closest contact points between edges and SDF.
|
|
1576
|
+
iterate_mesh_vertices: Whether to iterate over all vertices of a mesh for contact generation
|
|
1577
|
+
(used for capsule/box <> mesh collision).
|
|
1578
|
+
requires_grad: Whether to duplicate contact arrays for gradient computation
|
|
1579
|
+
(if ``None``, uses ``model.requires_grad``).
|
|
1570
1580
|
"""
|
|
1571
1581
|
|
|
1572
1582
|
if requires_grad is None:
|
|
@@ -1682,16 +1692,19 @@ def collide(model, state, edge_sdf_iter: int = 10, iterate_mesh_vertices: bool =
|
|
|
1682
1692
|
model.rigid_contact_normal = wp.empty_like(model.rigid_contact_normal)
|
|
1683
1693
|
model.rigid_contact_thickness = wp.empty_like(model.rigid_contact_thickness)
|
|
1684
1694
|
model.rigid_contact_count = wp.zeros_like(model.rigid_contact_count)
|
|
1685
|
-
model.rigid_contact_tids = wp.
|
|
1695
|
+
model.rigid_contact_tids = wp.full_like(model.rigid_contact_tids, -1)
|
|
1686
1696
|
model.rigid_contact_shape0 = wp.empty_like(model.rigid_contact_shape0)
|
|
1687
1697
|
model.rigid_contact_shape1 = wp.empty_like(model.rigid_contact_shape1)
|
|
1698
|
+
|
|
1688
1699
|
if model.rigid_contact_pairwise_counter is not None:
|
|
1689
1700
|
model.rigid_contact_pairwise_counter = wp.zeros_like(model.rigid_contact_pairwise_counter)
|
|
1690
1701
|
else:
|
|
1691
1702
|
model.rigid_contact_count.zero_()
|
|
1692
|
-
model.rigid_contact_tids.
|
|
1703
|
+
model.rigid_contact_tids.fill_(-1)
|
|
1704
|
+
|
|
1693
1705
|
if model.rigid_contact_pairwise_counter is not None:
|
|
1694
1706
|
model.rigid_contact_pairwise_counter.zero_()
|
|
1707
|
+
|
|
1695
1708
|
model.rigid_contact_shape0.fill_(-1)
|
|
1696
1709
|
model.rigid_contact_shape1.fill_(-1)
|
|
1697
1710
|
|