warp-lang 1.2.0__py3-none-manylinux2014_x86_64.whl → 1.2.2__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.

Potentially problematic release.


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

warp/bin/warp-clang.so CHANGED
Binary file
warp/config.py CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  from typing import Optional
9
9
 
10
- version: str = "1.2.0"
10
+ version: str = "1.2.2"
11
11
 
12
12
  verify_fp: bool = False # verify inputs and outputs are finite after each launch
13
13
  verify_cuda: bool = False # if true will check CUDA errors after each kernel launch / memory operation
warp/context.py CHANGED
@@ -1488,8 +1488,9 @@ class Module:
1488
1488
 
1489
1489
  # functions source
1490
1490
  for function in module.functions.values():
1491
- # include all overloads
1492
- for sig, func in function.user_overloads.items():
1491
+ # include all concrete and generic overloads
1492
+ overloads = itertools.chain(function.user_overloads.items(), function.user_templates.items())
1493
+ for sig, func in overloads:
1493
1494
  # signature
1494
1495
  ch.update(bytes(sig, "utf-8"))
1495
1496
 
@@ -3632,6 +3633,9 @@ def is_mempool_access_supported(target_device: Devicelike, peer_device: Deviceli
3632
3633
 
3633
3634
  init()
3634
3635
 
3636
+ target_device = runtime.get_device(target_device)
3637
+ peer_device = runtime.get_device(peer_device)
3638
+
3635
3639
  return target_device.is_mempool_supported and is_peer_access_supported(target_device, peer_device)
3636
3640
 
3637
3641
 
@@ -4041,7 +4045,7 @@ def full(
4041
4045
  # a sequence, assume it's a vector or matrix value
4042
4046
  try:
4043
4047
  # try to convert to a numpy array first
4044
- na = np.array(value, copy=False)
4048
+ na = np.asarray(value)
4045
4049
  except Exception as e:
4046
4050
  raise ValueError(f"Failed to interpret the value as a vector or matrix: {e}") from e
4047
4051
 
@@ -687,10 +687,22 @@ def test_equality(test, device, dtype, register_kernels=False):
687
687
  vec4 = wp.types.vector(length=4, dtype=wptype)
688
688
  vec5 = wp.types.vector(length=5, dtype=wptype)
689
689
 
690
- def check_equality(
690
+ def check_unsigned_equality(
691
691
  v20: wp.array(dtype=vec2),
692
692
  v21: wp.array(dtype=vec2),
693
693
  v22: wp.array(dtype=vec2),
694
+ v30: wp.array(dtype=vec3),
695
+ v40: wp.array(dtype=vec4),
696
+ v50: wp.array(dtype=vec5),
697
+ ):
698
+ wp.expect_eq(v20[0], v20[0])
699
+ wp.expect_neq(v21[0], v20[0])
700
+ wp.expect_neq(v22[0], v20[0])
701
+ wp.expect_eq(v30[0], v30[0])
702
+ wp.expect_eq(v40[0], v40[0])
703
+ wp.expect_eq(v50[0], v50[0])
704
+
705
+ def check_signed_equality(
694
706
  v30: wp.array(dtype=vec3),
695
707
  v31: wp.array(dtype=vec3),
696
708
  v32: wp.array(dtype=vec3),
@@ -707,29 +719,21 @@ def test_equality(test, device, dtype, register_kernels=False):
707
719
  v54: wp.array(dtype=vec5),
708
720
  v55: wp.array(dtype=vec5),
709
721
  ):
710
- wp.expect_eq(v20[0], v20[0])
711
- wp.expect_neq(v21[0], v20[0])
712
- wp.expect_neq(v22[0], v20[0])
713
-
714
- wp.expect_eq(v30[0], v30[0])
715
722
  wp.expect_neq(v31[0], v30[0])
716
723
  wp.expect_neq(v32[0], v30[0])
717
724
  wp.expect_neq(v33[0], v30[0])
718
-
719
- wp.expect_eq(v40[0], v40[0])
720
725
  wp.expect_neq(v41[0], v40[0])
721
726
  wp.expect_neq(v42[0], v40[0])
722
727
  wp.expect_neq(v43[0], v40[0])
723
728
  wp.expect_neq(v44[0], v40[0])
724
-
725
- wp.expect_eq(v50[0], v50[0])
726
729
  wp.expect_neq(v51[0], v50[0])
727
730
  wp.expect_neq(v52[0], v50[0])
728
731
  wp.expect_neq(v53[0], v50[0])
729
732
  wp.expect_neq(v54[0], v50[0])
730
733
  wp.expect_neq(v55[0], v50[0])
731
734
 
732
- kernel = getkernel(check_equality, suffix=dtype.__name__)
735
+ unsigned_kernel = getkernel(check_unsigned_equality, suffix=dtype.__name__)
736
+ signed_kernel = getkernel(check_signed_equality, suffix=dtype.__name__)
733
737
 
734
738
  if register_kernels:
735
739
  return
@@ -739,49 +743,64 @@ def test_equality(test, device, dtype, register_kernels=False):
739
743
  v22 = wp.array([3.0, 2.0], dtype=vec2, requires_grad=True, device=device)
740
744
 
741
745
  v30 = wp.array([1.0, 2.0, 3.0], dtype=vec3, requires_grad=True, device=device)
742
- v31 = wp.array([-1.0, 2.0, 3.0], dtype=vec3, requires_grad=True, device=device)
743
- v32 = wp.array([1.0, -2.0, 3.0], dtype=vec3, requires_grad=True, device=device)
744
- v33 = wp.array([1.0, 2.0, -3.0], dtype=vec3, requires_grad=True, device=device)
745
-
746
746
  v40 = wp.array([1.0, 2.0, 3.0, 4.0], dtype=vec4, requires_grad=True, device=device)
747
- v41 = wp.array([-1.0, 2.0, 3.0, 4.0], dtype=vec4, requires_grad=True, device=device)
748
- v42 = wp.array([1.0, -2.0, 3.0, 4.0], dtype=vec4, requires_grad=True, device=device)
749
- v43 = wp.array([1.0, 2.0, -3.0, 4.0], dtype=vec4, requires_grad=True, device=device)
750
- v44 = wp.array([1.0, 2.0, 3.0, -4.0], dtype=vec4, requires_grad=True, device=device)
751
-
752
747
  v50 = wp.array([1.0, 2.0, 3.0, 4.0, 5.0], dtype=vec5, requires_grad=True, device=device)
753
- v51 = wp.array([-1.0, 2.0, 3.0, 4.0, 5.0], dtype=vec5, requires_grad=True, device=device)
754
- v52 = wp.array([1.0, -2.0, 3.0, 4.0, 5.0], dtype=vec5, requires_grad=True, device=device)
755
- v53 = wp.array([1.0, 2.0, -3.0, 4.0, 5.0], dtype=vec5, requires_grad=True, device=device)
756
- v54 = wp.array([1.0, 2.0, 3.0, -4.0, 5.0], dtype=vec5, requires_grad=True, device=device)
757
- v55 = wp.array([1.0, 2.0, 3.0, 4.0, -5.0], dtype=vec5, requires_grad=True, device=device)
748
+
758
749
  wp.launch(
759
- kernel,
750
+ unsigned_kernel,
760
751
  dim=1,
761
752
  inputs=[
762
753
  v20,
763
754
  v21,
764
755
  v22,
765
756
  v30,
766
- v31,
767
- v32,
768
- v33,
769
757
  v40,
770
- v41,
771
- v42,
772
- v43,
773
- v44,
774
758
  v50,
775
- v51,
776
- v52,
777
- v53,
778
- v54,
779
- v55,
780
759
  ],
781
760
  outputs=[],
782
761
  device=device,
783
762
  )
784
763
 
764
+ if dtype not in np_unsigned_int_types:
765
+ v31 = wp.array([-1.0, 2.0, 3.0], dtype=vec3, requires_grad=True, device=device)
766
+ v32 = wp.array([1.0, -2.0, 3.0], dtype=vec3, requires_grad=True, device=device)
767
+ v33 = wp.array([1.0, 2.0, -3.0], dtype=vec3, requires_grad=True, device=device)
768
+
769
+ v41 = wp.array([-1.0, 2.0, 3.0, 4.0], dtype=vec4, requires_grad=True, device=device)
770
+ v42 = wp.array([1.0, -2.0, 3.0, 4.0], dtype=vec4, requires_grad=True, device=device)
771
+ v43 = wp.array([1.0, 2.0, -3.0, 4.0], dtype=vec4, requires_grad=True, device=device)
772
+ v44 = wp.array([1.0, 2.0, 3.0, -4.0], dtype=vec4, requires_grad=True, device=device)
773
+
774
+ v51 = wp.array([-1.0, 2.0, 3.0, 4.0, 5.0], dtype=vec5, requires_grad=True, device=device)
775
+ v52 = wp.array([1.0, -2.0, 3.0, 4.0, 5.0], dtype=vec5, requires_grad=True, device=device)
776
+ v53 = wp.array([1.0, 2.0, -3.0, 4.0, 5.0], dtype=vec5, requires_grad=True, device=device)
777
+ v54 = wp.array([1.0, 2.0, 3.0, -4.0, 5.0], dtype=vec5, requires_grad=True, device=device)
778
+ v55 = wp.array([1.0, 2.0, 3.0, 4.0, -5.0], dtype=vec5, requires_grad=True, device=device)
779
+
780
+ wp.launch(
781
+ signed_kernel,
782
+ dim=1,
783
+ inputs=[
784
+ v30,
785
+ v31,
786
+ v32,
787
+ v33,
788
+ v40,
789
+ v41,
790
+ v42,
791
+ v43,
792
+ v44,
793
+ v50,
794
+ v51,
795
+ v52,
796
+ v53,
797
+ v54,
798
+ v55,
799
+ ],
800
+ outputs=[],
801
+ device=device,
802
+ )
803
+
785
804
 
786
805
  def test_scalar_multiplication(test, device, dtype, register_kernels=False):
787
806
  rng = np.random.default_rng(123)
warp/types.py CHANGED
@@ -1650,9 +1650,10 @@ class array(Array):
1650
1650
  try:
1651
1651
  # Performance note: try first, ask questions later
1652
1652
  device = warp.context.runtime.get_device(device)
1653
- except:
1654
- warp.context.init()
1655
- raise
1653
+ except Exception:
1654
+ # Fallback to using the public API for retrieving the device,
1655
+ # which takes take of initializing Warp if needed.
1656
+ device = warp.context.get_device(device)
1656
1657
 
1657
1658
  if device.is_cuda:
1658
1659
  desc = data.__cuda_array_interface__
@@ -1684,7 +1685,7 @@ class array(Array):
1684
1685
  if dtype == Any:
1685
1686
  # infer dtype from data
1686
1687
  try:
1687
- arr = np.array(data, copy=False, ndmin=1)
1688
+ arr = np.asarray(data)
1688
1689
  except Exception as e:
1689
1690
  raise RuntimeError(f"Failed to convert input data to an array: {e}") from e
1690
1691
  dtype = np_dtype_to_warp_type.get(arr.dtype)
@@ -1723,7 +1724,7 @@ class array(Array):
1723
1724
  f"Failed to convert input data to an array with Warp type {warp.context.type_str(dtype)}"
1724
1725
  )
1725
1726
  try:
1726
- arr = np.array(data, dtype=npdtype, copy=False, ndmin=1)
1727
+ arr = np.asarray(data, dtype=npdtype)
1727
1728
  except Exception as e:
1728
1729
  raise RuntimeError(f"Failed to convert input data to an array with type {npdtype}: {e}") from e
1729
1730
 
@@ -1779,9 +1780,10 @@ class array(Array):
1779
1780
  try:
1780
1781
  # Performance note: try first, ask questions later
1781
1782
  device = warp.context.runtime.get_device(device)
1782
- except:
1783
- warp.context.init()
1784
- raise
1783
+ except Exception:
1784
+ # Fallback to using the public API for retrieving the device,
1785
+ # which takes take of initializing Warp if needed.
1786
+ device = warp.context.get_device(device)
1785
1787
 
1786
1788
  if device.is_cpu and not copy and not pinned:
1787
1789
  # reference numpy memory directly
@@ -1805,9 +1807,10 @@ class array(Array):
1805
1807
  try:
1806
1808
  # Performance note: try first, ask questions later
1807
1809
  device = warp.context.runtime.get_device(device)
1808
- except:
1809
- warp.context.init()
1810
- raise
1810
+ except Exception:
1811
+ # Fallback to using the public API for retrieving the device,
1812
+ # which takes take of initializing Warp if needed.
1813
+ device = warp.context.get_device(device)
1811
1814
 
1812
1815
  check_array_shape(shape)
1813
1816
  ndim = len(shape)
@@ -1852,9 +1855,10 @@ class array(Array):
1852
1855
  try:
1853
1856
  # Performance note: try first, ask questions later
1854
1857
  device = warp.context.runtime.get_device(device)
1855
- except:
1856
- warp.context.init()
1857
- raise
1858
+ except Exception:
1859
+ # Fallback to using the public API for retrieving the device,
1860
+ # which takes take of initializing Warp if needed.
1861
+ device = warp.context.get_device(device)
1858
1862
 
1859
1863
  check_array_shape(shape)
1860
1864
  ndim = len(shape)
@@ -2329,7 +2333,7 @@ class array(Array):
2329
2333
  a = self.to("cpu", requires_grad=False)
2330
2334
  # convert through __array_interface__
2331
2335
  # Note: this handles arrays of structs using `descr`, so the result will be a structured NumPy array
2332
- return np.array(a, copy=False)
2336
+ return np.asarray(a)
2333
2337
  else:
2334
2338
  # return an empty numpy array with the correct dtype and shape
2335
2339
  if isinstance(self.dtype, warp.codegen.Struct):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: warp-lang
3
- Version: 1.2.0
3
+ Version: 1.2.2
4
4
  Summary: A Python framework for high-performance simulation and graphics programming
5
5
  Author-email: NVIDIA <mmacklin@nvidia.com>
6
6
  License: NVIDIA Software License
@@ -108,7 +108,10 @@ print(lengths)
108
108
 
109
109
  ## Running Examples
110
110
 
111
- The `examples` directory contains a number of scripts that show how to implement different simulation methods using the Warp API. Most examples will generate USD files containing time-sampled animations (stored in the current working directory). Before running examples, users should ensure that the ``usd-core``, ``matplotlib``, and ``pyglet`` packages are installed using:
111
+ The [warp/examples](./warp/examples/) directory contains a number of scripts categorized under different subdirectories
112
+ that show how to implement different simulation methods using the Warp API.
113
+ Most examples will generate USD files containing time-sampled animations (stored in the current working directory).
114
+ Before running examples, users should ensure that the ``usd-core``, ``matplotlib``, and ``pyglet`` packages are installed using:
112
115
 
113
116
  pip install usd-core matplotlib pyglet
114
117
 
@@ -4,9 +4,9 @@ warp/build.py,sha256=LmRSU00pdlN1P31XS1_FhXgu_k7GzKkAzPd0LacZClo,3690
4
4
  warp/build_dll.py,sha256=p9eTXMhKbI0uTkpqeY5DxOmVhupfaykM-a-re6fXBXg,15896
5
5
  warp/builtins.py,sha256=AlHPF8WTvTOF2DGo8nQJ_OmZ5nzkoTi_qPLDlc6fPg0,122322
6
6
  warp/codegen.py,sha256=MJC5a63p-eXelMivb0Tyg6hU_ZCuqx8nMDSE7Om0BV0,103205
7
- warp/config.py,sha256=Spi7LsenwhcJubEYYMAmlzYEoVdGQ1qPNJjeqEICsv8,1879
7
+ warp/config.py,sha256=gRyon6yrUl16-XDLbTYV7PfuXBMWTLOiAnx129lWIzs,1879
8
8
  warp/constants.py,sha256=ckfEqwbg109RJDW98SILe_yfOBEFolOATVjt0mU2py4,1321
9
- warp/context.py,sha256=J0w1vzGBh1r0JXz-A0bf1rytV5E5WtZEv2gPGxt4yzg,213400
9
+ warp/context.py,sha256=QEGden9SZLlWFUhEwHJEXSNOLOMaFTxMA79DQzzOXaA,213608
10
10
  warp/dlpack.py,sha256=z242iSS70YF-5IP-GVE83R7HbHB5aRMmiYiQlAbyNis,16568
11
11
  warp/fabric.py,sha256=__Dbd9TmF5bqxUh411dpiAGxrlsfDAwZ8benjXN3Jco,11316
12
12
  warp/jax.py,sha256=QKJXfpz1jjaRD-Yp4C4wC4jUv8jHj0en3MW0VXKq0ZA,5280
@@ -15,9 +15,9 @@ warp/sparse.py,sha256=57Ar8OknSZ5P0apLLm_hnhxWlj0bh6U-mbu2qfYDcis,42356
15
15
  warp/stubs.py,sha256=wS3_3Joiutw9cecEzae5GyYHIOUH6wl8CdLeozueqks,57977
16
16
  warp/tape.py,sha256=hH3Qb9CiKHmq5OUIHRTZjZdYDXR2noHFNiB9HrIl5ZU,47864
17
17
  warp/torch.py,sha256=5hRCNL5jJzrh3hAcn1DdYfTvdOA5fvBy0VQnHviZpkE,11760
18
- warp/types.py,sha256=1OlIRSbwHFDbOPcnCxOi5lQcGCY6kn2Iwp-5kuntML8,169680
18
+ warp/types.py,sha256=xKBWVRektFwU4r5FPL8ePR-ZR6_ue30wzVMfz2iHaK0,170236
19
19
  warp/utils.py,sha256=UoTCl9kGlPJBlsgvhM726VsnMkUsQSamxLQ0vgR1h5s,34148
20
- warp/bin/warp-clang.so,sha256=xb3cMPnm75SkqEdGNRasxJPSD-WjSJfekR5jmpsCJ9E,66204032
20
+ warp/bin/warp-clang.so,sha256=mKEvTDt6X2fkaD0XJUdTHcwUI-_18rtTls9z5nTYdKA,66199872
21
21
  warp/bin/warp.so,sha256=riEf32U_pt1CNMMOdnlYXlew7_olGsPxwB8XObD89sM,110600160
22
22
  warp/examples/__init__.py,sha256=ul3vRFtQ17_zIZIWJaCnCY28KZTGOUHQA4wA_IW_qaw,606
23
23
  warp/examples/browse.py,sha256=6v7F0vpZz5ZtYGkg8hIpxhbIZ2ECv46cIKAmKVtV1S4,848
@@ -329,7 +329,7 @@ warp/tests/test_types.py,sha256=gQcQXTFK41QkfMKGP9fXd_WTtdlFNiPotAY6TpdvEsM,2211
329
329
  warp/tests/test_utils.py,sha256=_LixxYRl-7sj4YbcdSZNjaTrh72MRiadLr8iElvW0v4,18801
330
330
  warp/tests/test_vec.py,sha256=50B7gKFzMTNGmp0amBndlfLIF6yOk4GKMRPEu-mxmdg,42423
331
331
  warp/tests/test_vec_lite.py,sha256=zcTogrKDqYJsJXlAvR8zsSYiVsCB-mqphark6ULehcA,2343
332
- warp/tests/test_vec_scalar_ops.py,sha256=lRnkyH-MCeoCKpnp_x03mfx4BIjBrUvWkdNFva2Ot6o,84906
332
+ warp/tests/test_vec_scalar_ops.py,sha256=A7B5gDXpyEExHahORUkHaErO9NB5Zt6mHwxT1iStvTk,85526
333
333
  warp/tests/test_verify_fp.py,sha256=KQuFVhAfjQ8YQHWWHP6vj7SX8zatGRJmfMDTotc7JBQ,2343
334
334
  warp/tests/test_volume.py,sha256=QlvrJUpZ8Wq1PAd5a0o-YqTJEMbFf3qNkhikXjmRHhI,33909
335
335
  warp/tests/test_volume_write.py,sha256=VMy40l3ioInNovw-ooz7-o1vdVPK-kMkEXd1-cb309E,11531
@@ -352,8 +352,8 @@ warp/thirdparty/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
352
352
  warp/thirdparty/appdirs.py,sha256=2UXPK-AkDGoN5APeqAMMYkkfgf3Q_aUEZxcfkIxlQn0,24254
353
353
  warp/thirdparty/dlpack.py,sha256=OzMyVi5uQU01n0yEquDotgYvEAmfXT93QaIV4p4QqB4,4273
354
354
  warp/thirdparty/unittest_parallel.py,sha256=5z6oi9tsk2fOxhP4fx8hXRGveDTLM9fcESfzMWxJLFs,20998
355
- warp_lang-1.2.0.dist-info/LICENSE.md,sha256=Gq_TN0Xfat8Ftq2Rlvc31NgxdpLGVB-34kp-4eoeDV0,19265
356
- warp_lang-1.2.0.dist-info/METADATA,sha256=JEx5lbyT9BHlLuQzlBUxBXLSE79bcDchLWtHJi6c15I,20549
357
- warp_lang-1.2.0.dist-info/WHEEL,sha256=tlJxHuB9B338XjSv8YGiDebYqhyHpN1cFwihGfSw9Hw,110
358
- warp_lang-1.2.0.dist-info/top_level.txt,sha256=8pupHORyKoiN_BYWlTmv5OFBWdhqpppiBYQV5KxgEvg,5
359
- warp_lang-1.2.0.dist-info/RECORD,,
355
+ warp_lang-1.2.2.dist-info/LICENSE.md,sha256=Gq_TN0Xfat8Ftq2Rlvc31NgxdpLGVB-34kp-4eoeDV0,19265
356
+ warp_lang-1.2.2.dist-info/METADATA,sha256=pFezgRswKflUhG_fCs5O56jEEZvH_MHJ92tIXXlKQso,20615
357
+ warp_lang-1.2.2.dist-info/WHEEL,sha256=tlJxHuB9B338XjSv8YGiDebYqhyHpN1cFwihGfSw9Hw,110
358
+ warp_lang-1.2.2.dist-info/top_level.txt,sha256=8pupHORyKoiN_BYWlTmv5OFBWdhqpppiBYQV5KxgEvg,5
359
+ warp_lang-1.2.2.dist-info/RECORD,,