warp-lang 1.6.2__py3-none-macosx_10_13_universal2.whl → 1.7.0__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 (179) hide show
  1. warp/__init__.py +7 -1
  2. warp/bin/libwarp-clang.dylib +0 -0
  3. warp/bin/libwarp.dylib +0 -0
  4. warp/build.py +410 -0
  5. warp/build_dll.py +6 -14
  6. warp/builtins.py +452 -362
  7. warp/codegen.py +179 -119
  8. warp/config.py +42 -6
  9. warp/context.py +490 -271
  10. warp/dlpack.py +8 -6
  11. warp/examples/assets/nonuniform.usd +0 -0
  12. warp/examples/assets/nvidia_logo.png +0 -0
  13. warp/examples/benchmarks/benchmark_tile_load_store.py +103 -0
  14. warp/examples/core/example_sample_mesh.py +300 -0
  15. warp/examples/fem/example_apic_fluid.py +1 -1
  16. warp/examples/fem/example_burgers.py +2 -2
  17. warp/examples/fem/example_deformed_geometry.py +1 -1
  18. warp/examples/fem/example_distortion_energy.py +1 -1
  19. warp/examples/fem/example_magnetostatics.py +6 -6
  20. warp/examples/fem/utils.py +9 -3
  21. warp/examples/interop/example_jax_callable.py +116 -0
  22. warp/examples/interop/example_jax_ffi_callback.py +132 -0
  23. warp/examples/interop/example_jax_kernel.py +205 -0
  24. warp/examples/optim/example_fluid_checkpoint.py +497 -0
  25. warp/examples/tile/example_tile_matmul.py +2 -4
  26. warp/fem/__init__.py +11 -1
  27. warp/fem/adaptivity.py +4 -4
  28. warp/fem/field/nodal_field.py +22 -68
  29. warp/fem/field/virtual.py +62 -23
  30. warp/fem/geometry/adaptive_nanogrid.py +9 -10
  31. warp/fem/geometry/closest_point.py +1 -1
  32. warp/fem/geometry/deformed_geometry.py +5 -2
  33. warp/fem/geometry/geometry.py +5 -0
  34. warp/fem/geometry/grid_2d.py +12 -12
  35. warp/fem/geometry/grid_3d.py +12 -15
  36. warp/fem/geometry/hexmesh.py +5 -7
  37. warp/fem/geometry/nanogrid.py +9 -11
  38. warp/fem/geometry/quadmesh.py +13 -13
  39. warp/fem/geometry/tetmesh.py +3 -4
  40. warp/fem/geometry/trimesh.py +3 -8
  41. warp/fem/integrate.py +262 -93
  42. warp/fem/linalg.py +5 -5
  43. warp/fem/quadrature/pic_quadrature.py +37 -22
  44. warp/fem/quadrature/quadrature.py +194 -25
  45. warp/fem/space/__init__.py +1 -1
  46. warp/fem/space/basis_function_space.py +4 -2
  47. warp/fem/space/basis_space.py +25 -18
  48. warp/fem/space/hexmesh_function_space.py +2 -2
  49. warp/fem/space/partition.py +6 -2
  50. warp/fem/space/quadmesh_function_space.py +8 -8
  51. warp/fem/space/shape/cube_shape_function.py +23 -23
  52. warp/fem/space/shape/square_shape_function.py +12 -12
  53. warp/fem/space/shape/triangle_shape_function.py +1 -1
  54. warp/fem/space/tetmesh_function_space.py +3 -3
  55. warp/fem/space/trimesh_function_space.py +2 -2
  56. warp/fem/utils.py +12 -6
  57. warp/jax.py +14 -1
  58. warp/jax_experimental/__init__.py +16 -0
  59. warp/{jax_experimental.py → jax_experimental/custom_call.py} +14 -27
  60. warp/jax_experimental/ffi.py +698 -0
  61. warp/jax_experimental/xla_ffi.py +602 -0
  62. warp/math.py +89 -0
  63. warp/native/array.h +13 -0
  64. warp/native/builtin.h +29 -3
  65. warp/native/bvh.cpp +3 -1
  66. warp/native/bvh.cu +42 -14
  67. warp/native/bvh.h +2 -1
  68. warp/native/clang/clang.cpp +30 -3
  69. warp/native/cuda_util.cpp +14 -0
  70. warp/native/cuda_util.h +2 -0
  71. warp/native/exports.h +68 -63
  72. warp/native/intersect.h +26 -26
  73. warp/native/intersect_adj.h +33 -33
  74. warp/native/marching.cu +1 -1
  75. warp/native/mat.h +513 -9
  76. warp/native/mesh.h +10 -10
  77. warp/native/quat.h +99 -11
  78. warp/native/rand.h +6 -0
  79. warp/native/sort.cpp +122 -59
  80. warp/native/sort.cu +152 -15
  81. warp/native/sort.h +8 -1
  82. warp/native/sparse.cpp +43 -22
  83. warp/native/sparse.cu +52 -17
  84. warp/native/svd.h +116 -0
  85. warp/native/tile.h +301 -105
  86. warp/native/tile_reduce.h +46 -3
  87. warp/native/vec.h +68 -7
  88. warp/native/volume.cpp +85 -113
  89. warp/native/volume_builder.cu +25 -10
  90. warp/native/volume_builder.h +6 -0
  91. warp/native/warp.cpp +5 -6
  92. warp/native/warp.cu +99 -10
  93. warp/native/warp.h +19 -10
  94. warp/optim/linear.py +10 -10
  95. warp/sim/articulation.py +4 -4
  96. warp/sim/collide.py +21 -10
  97. warp/sim/import_mjcf.py +449 -155
  98. warp/sim/import_urdf.py +32 -12
  99. warp/sim/integrator_euler.py +5 -5
  100. warp/sim/integrator_featherstone.py +3 -10
  101. warp/sim/integrator_vbd.py +207 -2
  102. warp/sim/integrator_xpbd.py +5 -5
  103. warp/sim/model.py +42 -13
  104. warp/sim/utils.py +2 -2
  105. warp/sparse.py +642 -555
  106. warp/stubs.py +216 -19
  107. warp/tests/__main__.py +0 -15
  108. warp/tests/cuda/__init__.py +0 -0
  109. warp/tests/{test_mempool.py → cuda/test_mempool.py} +39 -0
  110. warp/tests/{test_streams.py → cuda/test_streams.py} +71 -0
  111. warp/tests/geometry/__init__.py +0 -0
  112. warp/tests/{test_mesh_query_point.py → geometry/test_mesh_query_point.py} +66 -63
  113. warp/tests/{test_mesh_query_ray.py → geometry/test_mesh_query_ray.py} +1 -1
  114. warp/tests/{test_volume.py → geometry/test_volume.py} +41 -6
  115. warp/tests/interop/__init__.py +0 -0
  116. warp/tests/{test_dlpack.py → interop/test_dlpack.py} +28 -5
  117. warp/tests/sim/__init__.py +0 -0
  118. warp/tests/{disabled_kinematics.py → sim/disabled_kinematics.py} +9 -10
  119. warp/tests/{test_collision.py → sim/test_collision.py} +2 -2
  120. warp/tests/{test_model.py → sim/test_model.py} +40 -0
  121. warp/tests/{test_sim_kinematics.py → sim/test_sim_kinematics.py} +2 -1
  122. warp/tests/sim/test_vbd.py +597 -0
  123. warp/tests/test_bool.py +1 -1
  124. warp/tests/test_examples.py +28 -36
  125. warp/tests/test_fem.py +23 -4
  126. warp/tests/test_linear_solvers.py +0 -11
  127. warp/tests/test_mat.py +233 -79
  128. warp/tests/test_mat_scalar_ops.py +4 -4
  129. warp/tests/test_overwrite.py +0 -60
  130. warp/tests/test_quat.py +67 -46
  131. warp/tests/test_rand.py +44 -37
  132. warp/tests/test_sparse.py +47 -6
  133. warp/tests/test_spatial.py +75 -0
  134. warp/tests/test_static.py +1 -1
  135. warp/tests/test_utils.py +84 -4
  136. warp/tests/test_vec.py +46 -34
  137. warp/tests/tile/__init__.py +0 -0
  138. warp/tests/{test_tile.py → tile/test_tile.py} +136 -51
  139. warp/tests/{test_tile_load.py → tile/test_tile_load.py} +1 -1
  140. warp/tests/{test_tile_mathdx.py → tile/test_tile_mathdx.py} +9 -6
  141. warp/tests/{test_tile_mlp.py → tile/test_tile_mlp.py} +25 -14
  142. warp/tests/{test_tile_reduce.py → tile/test_tile_reduce.py} +60 -1
  143. warp/tests/{test_tile_view.py → tile/test_tile_view.py} +1 -1
  144. warp/tests/unittest_serial.py +1 -0
  145. warp/tests/unittest_suites.py +45 -59
  146. warp/tests/unittest_utils.py +2 -1
  147. warp/thirdparty/unittest_parallel.py +3 -1
  148. warp/types.py +110 -658
  149. warp/utils.py +137 -72
  150. {warp_lang-1.6.2.dist-info → warp_lang-1.7.0.dist-info}/METADATA +29 -7
  151. {warp_lang-1.6.2.dist-info → warp_lang-1.7.0.dist-info}/RECORD +172 -162
  152. {warp_lang-1.6.2.dist-info → warp_lang-1.7.0.dist-info}/WHEEL +1 -1
  153. warp/examples/optim/example_walker.py +0 -317
  154. warp/native/cutlass_gemm.cpp +0 -43
  155. warp/native/cutlass_gemm.cu +0 -382
  156. warp/tests/test_matmul.py +0 -511
  157. warp/tests/test_matmul_lite.py +0 -411
  158. warp/tests/test_vbd.py +0 -386
  159. warp/tests/unused_test_misc.py +0 -77
  160. /warp/tests/{test_async.py → cuda/test_async.py} +0 -0
  161. /warp/tests/{test_ipc.py → cuda/test_ipc.py} +0 -0
  162. /warp/tests/{test_multigpu.py → cuda/test_multigpu.py} +0 -0
  163. /warp/tests/{test_peer.py → cuda/test_peer.py} +0 -0
  164. /warp/tests/{test_pinned.py → cuda/test_pinned.py} +0 -0
  165. /warp/tests/{test_bvh.py → geometry/test_bvh.py} +0 -0
  166. /warp/tests/{test_hash_grid.py → geometry/test_hash_grid.py} +0 -0
  167. /warp/tests/{test_marching_cubes.py → geometry/test_marching_cubes.py} +0 -0
  168. /warp/tests/{test_mesh.py → geometry/test_mesh.py} +0 -0
  169. /warp/tests/{test_mesh_query_aabb.py → geometry/test_mesh_query_aabb.py} +0 -0
  170. /warp/tests/{test_volume_write.py → geometry/test_volume_write.py} +0 -0
  171. /warp/tests/{test_jax.py → interop/test_jax.py} +0 -0
  172. /warp/tests/{test_paddle.py → interop/test_paddle.py} +0 -0
  173. /warp/tests/{test_torch.py → interop/test_torch.py} +0 -0
  174. /warp/tests/{flaky_test_sim_grad.py → sim/flaky_test_sim_grad.py} +0 -0
  175. /warp/tests/{test_coloring.py → sim/test_coloring.py} +0 -0
  176. /warp/tests/{test_sim_grad_bounce_linear.py → sim/test_sim_grad_bounce_linear.py} +0 -0
  177. /warp/tests/{test_tile_shared_memory.py → tile/test_tile_shared_memory.py} +0 -0
  178. {warp_lang-1.6.2.dist-info → warp_lang-1.7.0.dist-info/licenses}/LICENSE.md +0 -0
  179. {warp_lang-1.6.2.dist-info → warp_lang-1.7.0.dist-info}/top_level.txt +0 -0
warp/utils.py CHANGED
@@ -13,13 +13,15 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
+ from __future__ import annotations
17
+
16
18
  import cProfile
17
19
  import ctypes
18
20
  import os
19
21
  import sys
20
22
  import time
21
23
  import warnings
22
- from typing import Any, Optional
24
+ from typing import Any, Callable, Dict, List, Optional, Union
23
25
 
24
26
  import numpy as np
25
27
 
@@ -141,6 +143,8 @@ def radix_sort_pairs(keys, values, count: int):
141
143
  runtime.core.radix_sort_pairs_int_host(keys.ptr, values.ptr, count)
142
144
  elif keys.dtype == wp.float32 and values.dtype == wp.int32:
143
145
  runtime.core.radix_sort_pairs_float_host(keys.ptr, values.ptr, count)
146
+ elif keys.dtype == wp.int64 and values.dtype == wp.int32:
147
+ runtime.core.radix_sort_pairs_int64_host(keys.ptr, values.ptr, count)
144
148
  else:
145
149
  raise RuntimeError("Unsupported data type")
146
150
  elif keys.device.is_cuda:
@@ -148,6 +152,90 @@ def radix_sort_pairs(keys, values, count: int):
148
152
  runtime.core.radix_sort_pairs_int_device(keys.ptr, values.ptr, count)
149
153
  elif keys.dtype == wp.float32 and values.dtype == wp.int32:
150
154
  runtime.core.radix_sort_pairs_float_device(keys.ptr, values.ptr, count)
155
+ elif keys.dtype == wp.int64 and values.dtype == wp.int32:
156
+ runtime.core.radix_sort_pairs_int64_device(keys.ptr, values.ptr, count)
157
+ else:
158
+ raise RuntimeError("Unsupported data type")
159
+
160
+
161
+ def segmented_sort_pairs(
162
+ keys,
163
+ values,
164
+ count: int,
165
+ segment_start_indices: wp.array(dtype=wp.int32),
166
+ segment_end_indices: wp.array(dtype=wp.int32) = None,
167
+ ):
168
+ """Sort key-value pairs within segments.
169
+
170
+ This function performs a segmented sort of key-value pairs, where the sorting is done independently within each segment.
171
+ The segments are defined by their start and optionally end indices.
172
+
173
+ Args:
174
+ keys: Array of keys to sort. Must be of type int32 or float32.
175
+ values: Array of values to sort along with keys. Must be of type int32.
176
+ count: Number of elements to sort.
177
+ segment_start_indices: Array containing start index of each segment. Must be of type int32.
178
+ If segment_end_indices is None, this array must have length at least num_segments + 1,
179
+ and segment_end_indices will be inferred as segment_start_indices[1:].
180
+ If segment_end_indices is provided, this array must have length at least num_segments.
181
+ segment_end_indices: Optional array containing end index of each segment. Must be of type int32 if provided.
182
+ If None, segment_end_indices will be inferred from segment_start_indices[1:].
183
+ If provided, must have length at least num_segments.
184
+
185
+ Raises:
186
+ RuntimeError: If array storage devices don't match, if storage size is insufficient,
187
+ if segment_start_indices is not of type int32, or if data types are unsupported.
188
+ """
189
+ if keys.device != values.device:
190
+ raise RuntimeError("Array storage devices do not match")
191
+
192
+ if count == 0:
193
+ return
194
+
195
+ if keys.size < 2 * count or values.size < 2 * count:
196
+ raise RuntimeError("Array storage must be large enough to contain 2*count elements")
197
+
198
+ from warp.context import runtime
199
+
200
+ if segment_start_indices.dtype != wp.int32:
201
+ raise RuntimeError("segment_start_indices array must be of type int32")
202
+
203
+ # Handle case where segment_end_indices is not provided
204
+ if segment_end_indices is None:
205
+ num_segments = max(0, segment_start_indices.size - 1)
206
+
207
+ segment_end_indices = segment_start_indices[1:]
208
+ segment_end_indices_ptr = segment_end_indices.ptr
209
+ segment_start_indices_ptr = segment_start_indices.ptr
210
+ else:
211
+ if segment_end_indices.dtype != wp.int32:
212
+ raise RuntimeError("segment_end_indices array must be of type int32")
213
+
214
+ num_segments = segment_start_indices.size
215
+
216
+ segment_end_indices_ptr = segment_end_indices.ptr
217
+ segment_start_indices_ptr = segment_start_indices.ptr
218
+
219
+ if keys.device.is_cpu:
220
+ if keys.dtype == wp.int32 and values.dtype == wp.int32:
221
+ runtime.core.segmented_sort_pairs_int_host(
222
+ keys.ptr, values.ptr, count, segment_start_indices_ptr, segment_end_indices_ptr, num_segments
223
+ )
224
+ elif keys.dtype == wp.float32 and values.dtype == wp.int32:
225
+ runtime.core.segmented_sort_pairs_float_host(
226
+ keys.ptr, values.ptr, count, segment_start_indices_ptr, segment_end_indices_ptr, num_segments
227
+ )
228
+ else:
229
+ raise RuntimeError("Unsupported data type")
230
+ elif keys.device.is_cuda:
231
+ if keys.dtype == wp.int32 and values.dtype == wp.int32:
232
+ runtime.core.segmented_sort_pairs_int_device(
233
+ keys.ptr, values.ptr, count, segment_start_indices_ptr, segment_end_indices_ptr, num_segments
234
+ )
235
+ elif keys.dtype == wp.float32 and values.dtype == wp.int32:
236
+ runtime.core.segmented_sort_pairs_float_device(
237
+ keys.ptr, values.ptr, count, segment_start_indices_ptr, segment_end_indices_ptr, num_segments
238
+ )
151
239
  else:
152
240
  raise RuntimeError("Unsupported data type")
153
241
 
@@ -673,37 +761,38 @@ class ScopedTimer:
673
761
 
674
762
  def __init__(
675
763
  self,
676
- name,
677
- active=True,
678
- print=True,
679
- detailed=False,
680
- dict=None,
681
- use_nvtx=False,
682
- color="rapids",
683
- synchronize=False,
684
- cuda_filter=0,
685
- report_func=None,
686
- skip_tape=False,
764
+ name: str,
765
+ active: bool = True,
766
+ print: bool = True,
767
+ detailed: bool = False,
768
+ dict: Optional[Dict[str, List[float]]] = None,
769
+ use_nvtx: bool = False,
770
+ color: Union[int, str] = "rapids",
771
+ synchronize: bool = False,
772
+ cuda_filter: int = 0,
773
+ report_func: Optional[Callable[[List[TimingResult], str], None]] = None,
774
+ skip_tape: bool = False,
687
775
  ):
688
776
  """Context manager object for a timer
689
777
 
690
778
  Parameters:
691
- name (str): Name of timer
692
- active (bool): Enables this timer
693
- print (bool): At context manager exit, print elapsed time to sys.stdout
694
- detailed (bool): Collects additional profiling data using cProfile and calls ``print_stats()`` at context exit
695
- dict (dict): A dictionary of lists to which the elapsed time will be appended using ``name`` as a key
696
- use_nvtx (bool): If true, timing functionality is replaced by an NVTX range
697
- color (int or str): ARGB value (e.g. 0x00FFFF) or color name (e.g. 'cyan') associated with the NVTX range
698
- synchronize (bool): Synchronize the CPU thread with any outstanding CUDA work to return accurate GPU timings
699
- cuda_filter (int): Filter flags for CUDA activity timing, e.g. ``warp.TIMING_KERNEL`` or ``warp.TIMING_ALL``
700
- report_func (Callable): A callback function to print the activity report (``wp.timing_print()`` is used by default)
701
- skip_tape (bool): If true, the timer will not be recorded in the tape
779
+ name: Name of timer
780
+ active: Enables this timer
781
+ print: At context manager exit, print elapsed time to ``sys.stdout``
782
+ detailed: Collects additional profiling data using cProfile and calls ``print_stats()`` at context exit
783
+ dict: A dictionary of lists to which the elapsed time will be appended using ``name`` as a key
784
+ use_nvtx: If true, timing functionality is replaced by an NVTX range
785
+ color: ARGB value (e.g. 0x00FFFF) or color name (e.g. 'cyan') associated with the NVTX range
786
+ synchronize: Synchronize the CPU thread with any outstanding CUDA work to return accurate GPU timings
787
+ cuda_filter: Filter flags for CUDA activity timing, e.g. ``warp.TIMING_KERNEL`` or ``warp.TIMING_ALL``
788
+ report_func: A callback function to print the activity report.
789
+ If ``None``, :func:`wp.timing_print() <timing_print>` will be used.
790
+ skip_tape: If true, the timer will not be recorded in the tape
702
791
 
703
792
  Attributes:
704
793
  extra_msg (str): Can be set to a string that will be added to the printout at context exit.
705
794
  elapsed (float): The duration of the ``with`` block used with this object
706
- timing_results (list[TimingResult]): The list of activity timing results, if collection was requested using ``cuda_filter``
795
+ timing_results (List[TimingResult]): The list of activity timing results, if collection was requested using ``cuda_filter``
707
796
  """
708
797
  self.name = name
709
798
  self.active = active and self.enabled
@@ -799,7 +888,7 @@ class ScopedTimer:
799
888
 
800
889
  # Allow temporarily enabling/disabling mempool allocators
801
890
  class ScopedMempool:
802
- def __init__(self, device, enable: bool):
891
+ def __init__(self, device: Devicelike, enable: bool):
803
892
  self.device = wp.get_device(device)
804
893
  self.enable = enable
805
894
 
@@ -813,7 +902,7 @@ class ScopedMempool:
813
902
 
814
903
  # Allow temporarily enabling/disabling mempool access
815
904
  class ScopedMempoolAccess:
816
- def __init__(self, target_device, peer_device, enable: bool):
905
+ def __init__(self, target_device: Devicelike, peer_device: Devicelike, enable: bool):
817
906
  self.target_device = target_device
818
907
  self.peer_device = peer_device
819
908
  self.enable = enable
@@ -828,7 +917,7 @@ class ScopedMempoolAccess:
828
917
 
829
918
  # Allow temporarily enabling/disabling peer access
830
919
  class ScopedPeerAccess:
831
- def __init__(self, target_device, peer_device, enable: bool):
920
+ def __init__(self, target_device: Devicelike, peer_device: Devicelike, enable: bool):
832
921
  self.target_device = target_device
833
922
  self.peer_device = peer_device
834
923
  self.enable = enable
@@ -842,7 +931,7 @@ class ScopedPeerAccess:
842
931
 
843
932
 
844
933
  class ScopedCapture:
845
- def __init__(self, device=None, stream=None, force_module_load=None, external=False):
934
+ def __init__(self, device: Devicelike = None, stream=None, force_module_load=None, external=False):
846
935
  self.device = device
847
936
  self.stream = stream
848
937
  self.force_module_load = force_module_load
@@ -868,27 +957,6 @@ class ScopedCapture:
868
957
  self.active = False
869
958
 
870
959
 
871
- # helper kernels for adj_matmul
872
- @wp.kernel
873
- def add_kernel_2d(x: wp.array2d(dtype=Any), acc: wp.array2d(dtype=Any), beta: Any):
874
- i, j = wp.tid()
875
-
876
- x[i, j] = x[i, j] + beta * acc[i, j]
877
-
878
-
879
- @wp.kernel
880
- def add_kernel_3d(x: wp.array3d(dtype=Any), acc: wp.array3d(dtype=Any), beta: Any):
881
- i, j, k = wp.tid()
882
-
883
- x[i, j, k] = x[i, j, k] + beta * acc[i, j, k]
884
-
885
-
886
- # explicit instantiations of generic kernels for adj_matmul
887
- for T in [wp.float16, wp.float32, wp.float64]:
888
- wp.overload(add_kernel_2d, [wp.array2d(dtype=T), wp.array2d(dtype=T), T])
889
- wp.overload(add_kernel_3d, [wp.array3d(dtype=T), wp.array3d(dtype=T), T])
890
-
891
-
892
960
  def check_p2p():
893
961
  """Check if the machine is configured properly for peer-to-peer transfers.
894
962
 
@@ -927,31 +995,28 @@ class timing_result_t(ctypes.Structure):
927
995
 
928
996
 
929
997
  class TimingResult:
930
- """Timing result for a single activity.
998
+ """Timing result for a single activity."""
931
999
 
932
- Parameters:
933
- raw_result (warp.utils.timing_result_t): The result structure obtained from C++ (internal use only)
1000
+ def __init__(self, device, name, filter, elapsed):
1001
+ self.device: warp.context.Device = device
1002
+ """The device where the activity was recorded."""
934
1003
 
935
- Attributes:
936
- device (warp.Device): The device where the activity was recorded.
937
- name (str): The activity name.
938
- filter (int): The type of activity (e.g., ``warp.TIMING_KERNEL``).
939
- elapsed (float): The elapsed time in milliseconds.
940
- """
1004
+ self.name: str = name
1005
+ """The activity name."""
941
1006
 
942
- def __init__(self, device, name, filter, elapsed):
943
- self.device = device
944
- self.name = name
945
- self.filter = filter
946
- self.elapsed = elapsed
1007
+ self.filter: int = filter
1008
+ """The type of activity (e.g., ``warp.TIMING_KERNEL``)."""
1009
+
1010
+ self.elapsed: float = elapsed
1011
+ """The elapsed time in milliseconds."""
947
1012
 
948
1013
 
949
- def timing_begin(cuda_filter=TIMING_ALL, synchronize=True):
1014
+ def timing_begin(cuda_filter: int = TIMING_ALL, synchronize: bool = True) -> None:
950
1015
  """Begin detailed activity timing.
951
1016
 
952
1017
  Parameters:
953
- cuda_filter (int): Filter flags for CUDA activity timing, e.g. ``warp.TIMING_KERNEL`` or ``warp.TIMING_ALL``
954
- synchronize (bool): Whether to synchronize all CUDA devices before timing starts
1018
+ cuda_filter: Filter flags for CUDA activity timing, e.g. ``warp.TIMING_KERNEL`` or ``warp.TIMING_ALL``
1019
+ synchronize: Whether to synchronize all CUDA devices before timing starts
955
1020
  """
956
1021
 
957
1022
  if synchronize:
@@ -960,14 +1025,14 @@ def timing_begin(cuda_filter=TIMING_ALL, synchronize=True):
960
1025
  warp.context.runtime.core.cuda_timing_begin(cuda_filter)
961
1026
 
962
1027
 
963
- def timing_end(synchronize=True):
1028
+ def timing_end(synchronize: bool = True) -> List[TimingResult]:
964
1029
  """End detailed activity timing.
965
1030
 
966
1031
  Parameters:
967
- synchronize (bool): Whether to synchronize all CUDA devices before timing ends
1032
+ synchronize: Whether to synchronize all CUDA devices before timing ends
968
1033
 
969
1034
  Returns:
970
- list[TimingResult]: A list of ``TimingResult`` objects for all recorded activities.
1035
+ A list of :class:`TimingResult` objects for all recorded activities.
971
1036
  """
972
1037
 
973
1038
  if synchronize:
@@ -1006,12 +1071,12 @@ def timing_end(synchronize=True):
1006
1071
  return results
1007
1072
 
1008
1073
 
1009
- def timing_print(results, indent=""):
1074
+ def timing_print(results: List[TimingResult], indent: str = "") -> None:
1010
1075
  """Print timing results.
1011
1076
 
1012
1077
  Parameters:
1013
- results (list[TimingResult]): List of ``TimingResult`` objects.
1014
- indent (str): Optional indentation for the output.
1078
+ results: List of :class:`TimingResult` objects to print.
1079
+ indent: Optional indentation to prepend to all output lines.
1015
1080
  """
1016
1081
 
1017
1082
  if not results:
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: warp-lang
3
- Version: 1.6.2
3
+ Version: 1.7.0
4
4
  Summary: A Python framework for high-performance simulation and graphics programming
5
5
  Author-email: NVIDIA Corporation <warp-python@nvidia.com>
6
6
  License: Apache-2.0
@@ -32,6 +32,7 @@ Requires-Dist: usd-core; extra == "extras"
32
32
  Requires-Dist: matplotlib; extra == "extras"
33
33
  Requires-Dist: pillow; extra == "extras"
34
34
  Requires-Dist: pyglet; extra == "extras"
35
+ Dynamic: license-file
35
36
 
36
37
  [![PyPI version](https://badge.fury.io/py/warp-lang.svg)](https://badge.fury.io/py/warp-lang)
37
38
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
@@ -81,9 +82,9 @@ the `pip install` command, e.g.
81
82
 
82
83
  | Platform | Install Command |
83
84
  | --------------- | ----------------------------------------------------------------------------------------------------------------------------- |
84
- | Linux aarch64 | `pip install https://github.com/NVIDIA/warp/releases/download/v1.6.2/warp_lang-1.6.2+cu11-py3-none-manylinux2014_aarch64.whl` |
85
- | Linux x86-64 | `pip install https://github.com/NVIDIA/warp/releases/download/v1.6.2/warp_lang-1.6.2+cu11-py3-none-manylinux2014_x86_64.whl` |
86
- | Windows x86-64 | `pip install https://github.com/NVIDIA/warp/releases/download/v1.6.2/warp_lang-1.6.2+cu11-py3-none-win_amd64.whl` |
85
+ | Linux aarch64 | `pip install https://github.com/NVIDIA/warp/releases/download/v1.7.0/warp_lang-1.7.0+cu11-py3-none-manylinux2014_aarch64.whl` |
86
+ | Linux x86-64 | `pip install https://github.com/NVIDIA/warp/releases/download/v1.7.0/warp_lang-1.7.0+cu11-py3-none-manylinux2014_x86_64.whl` |
87
+ | Windows x86-64 | `pip install https://github.com/NVIDIA/warp/releases/download/v1.7.0/warp_lang-1.7.0+cu11-py3-none-win_amd64.whl` |
87
88
 
88
89
  The `--force-reinstall` option may need to be used to overwrite a previous installation.
89
90
 
@@ -99,6 +100,15 @@ pip install -U --pre warp-lang --extra-index-url=https://pypi.nvidia.com/
99
100
 
100
101
  Note that the nightly builds are built with the CUDA 12 runtime and are not published for macOS.
101
102
 
103
+ If you plan to install nightly builds regularly, you can simplify future installations by adding NVIDIA's package
104
+ repository as an extra index via the `PIP_EXTRA_INDEX_URL` environment variable. For example:
105
+
106
+ ```text
107
+ export PIP_EXTRA_INDEX_URL="https://pypi.nvidia.com"
108
+ ```
109
+
110
+ This ensures the index is automatically used for `pip` commands, avoiding the need to specify it explicitly.
111
+
102
112
  ### CUDA Requirements
103
113
 
104
114
  * Warp packages built with CUDA Toolkit 11.x require NVIDIA driver 470 or newer.
@@ -250,16 +260,16 @@ python -m warp.tests
250
260
  <td align="center">raymarch</td>
251
261
  </tr>
252
262
  <tr>
263
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/core/example_sample_mesh.py"><img src="https://media.githubusercontent.com/media/NVIDIA/warp/refs/heads/main/docs/img/examples/core_sample_mesh.png"></a></td>
253
264
  <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/core/example_sph.py"><img src="https://media.githubusercontent.com/media/NVIDIA/warp/refs/heads/main/docs/img/examples/core_sph.png"></a></td>
254
265
  <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/core/example_torch.py"><img src="https://media.githubusercontent.com/media/NVIDIA/warp/refs/heads/main/docs/img/examples/core_torch.png"></a></td>
255
266
  <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/core/example_wave.py"><img src="https://media.githubusercontent.com/media/NVIDIA/warp/refs/heads/main/docs/img/examples/core_wave.png"></a></td>
256
- <td></td>
257
267
  </tr>
258
268
  <tr>
269
+ <td align="center">sample mesh</td>
259
270
  <td align="center">sph</td>
260
271
  <td align="center">torch</td>
261
272
  <td align="center">wave</td>
262
- <td align="center"></td>
263
273
  </tr>
264
274
  </tbody>
265
275
  </table>
@@ -323,6 +333,18 @@ python -m warp.tests
323
333
  <td align="center">trajectory</td>
324
334
  <td align="center">soft body properties</td>
325
335
  </tr>
336
+ <tr>
337
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/optim/example_fluid_checkpoint.py"><img src="https://media.githubusercontent.com/media/NVIDIA/warp/refs/heads/main/docs/img/examples/optim_fluid_checkpoint.png"></a></td>
338
+ <td></td>
339
+ <td></td>
340
+ <td></td>
341
+ </tr>
342
+ <tr>
343
+ <td align="center">fluid checkpoint</td>
344
+ <td align="center"></td>
345
+ <td align="center"></td>
346
+ <td align="center"></td>
347
+ </tr>
326
348
  </tbody>
327
349
  </table>
328
350