warp-lang 1.8.0__py3-none-manylinux_2_34_aarch64.whl → 1.8.1__py3-none-manylinux_2_34_aarch64.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 (59) hide show
  1. warp/bin/warp-clang.so +0 -0
  2. warp/bin/warp.so +0 -0
  3. warp/build_dll.py +5 -0
  4. warp/codegen.py +15 -3
  5. warp/config.py +1 -1
  6. warp/context.py +122 -24
  7. warp/examples/interop/example_jax_callable.py +34 -4
  8. warp/examples/interop/example_jax_kernel.py +27 -1
  9. warp/fem/field/virtual.py +2 -0
  10. warp/fem/integrate.py +78 -47
  11. warp/jax_experimental/ffi.py +201 -53
  12. warp/native/array.h +4 -4
  13. warp/native/builtin.h +8 -4
  14. warp/native/coloring.cpp +5 -1
  15. warp/native/cuda_util.cpp +1 -1
  16. warp/native/intersect.h +2 -2
  17. warp/native/mat.h +3 -3
  18. warp/native/mesh.h +1 -1
  19. warp/native/quat.h +6 -2
  20. warp/native/rand.h +7 -7
  21. warp/native/sparse.cu +1 -1
  22. warp/native/svd.h +23 -8
  23. warp/native/tile.h +20 -1
  24. warp/native/tile_radix_sort.h +5 -1
  25. warp/native/tile_reduce.h +16 -25
  26. warp/native/tuple.h +2 -2
  27. warp/native/vec.h +4 -4
  28. warp/native/warp.cpp +1 -1
  29. warp/native/warp.cu +15 -2
  30. warp/native/warp.h +1 -1
  31. warp/render/render_opengl.py +52 -51
  32. warp/render/render_usd.py +0 -1
  33. warp/sim/collide.py +1 -2
  34. warp/sim/integrator_vbd.py +10 -2
  35. warp/sparse.py +1 -1
  36. warp/tape.py +2 -0
  37. warp/tests/sim/test_cloth.py +89 -6
  38. warp/tests/sim/test_coloring.py +76 -1
  39. warp/tests/test_assert.py +53 -0
  40. warp/tests/test_atomic_cas.py +127 -114
  41. warp/tests/test_mat.py +22 -0
  42. warp/tests/test_quat.py +22 -0
  43. warp/tests/test_sparse.py +32 -0
  44. warp/tests/test_static.py +48 -0
  45. warp/tests/test_tape.py +38 -0
  46. warp/tests/test_vec.py +38 -408
  47. warp/tests/test_vec_constructors.py +325 -0
  48. warp/tests/tile/test_tile.py +31 -143
  49. warp/tests/tile/test_tile_mathdx.py +2 -2
  50. warp/tests/tile/test_tile_matmul.py +179 -0
  51. warp/tests/tile/test_tile_reduce.py +100 -11
  52. warp/tests/tile/test_tile_shared_memory.py +12 -12
  53. warp/tests/tile/test_tile_sort.py +59 -55
  54. warp/tests/unittest_suites.py +10 -0
  55. {warp_lang-1.8.0.dist-info → warp_lang-1.8.1.dist-info}/METADATA +4 -4
  56. {warp_lang-1.8.0.dist-info → warp_lang-1.8.1.dist-info}/RECORD +59 -57
  57. {warp_lang-1.8.0.dist-info → warp_lang-1.8.1.dist-info}/WHEEL +0 -0
  58. {warp_lang-1.8.0.dist-info → warp_lang-1.8.1.dist-info}/licenses/LICENSE.md +0 -0
  59. {warp_lang-1.8.0.dist-info → warp_lang-1.8.1.dist-info}/top_level.txt +0 -0
warp/fem/integrate.py CHANGED
@@ -56,7 +56,7 @@ from warp.fem.types import (
56
56
  )
57
57
  from warp.fem.utils import type_zero_element
58
58
  from warp.sparse import BsrMatrix, bsr_set_from_triplets, bsr_zeros
59
- from warp.types import type_size
59
+ from warp.types import is_array, type_size
60
60
  from warp.utils import array_cast
61
61
 
62
62
 
@@ -1328,21 +1328,28 @@ def _launch_integrate_kernel(
1328
1328
  device=device,
1329
1329
  )
1330
1330
 
1331
- dispatch_kernel = make_linear_dispatch_kernel(test, quadrature, accumulate_dtype)
1332
- wp.launch(
1333
- kernel=dispatch_kernel,
1334
- dim=(test.space_restriction.node_count(), test.node_dof_count),
1335
- inputs=[
1336
- qp_arg,
1337
- domain_elt_arg,
1338
- domain_elt_index_arg,
1339
- test_arg,
1340
- test.space.space_arg_value(device),
1341
- local_result.array,
1342
- output_view,
1343
- ],
1344
- device=device,
1345
- )
1331
+ if test.TAYLOR_DOF_COUNT == 0:
1332
+ wp.utils.warn(
1333
+ f"Test field is never evaluated in integrand '{integrand.name}', result will be zero",
1334
+ category=UserWarning,
1335
+ stacklevel=2,
1336
+ )
1337
+ else:
1338
+ dispatch_kernel = make_linear_dispatch_kernel(test, quadrature, accumulate_dtype)
1339
+ wp.launch(
1340
+ kernel=dispatch_kernel,
1341
+ dim=(test.space_restriction.node_count(), test.node_dof_count),
1342
+ inputs=[
1343
+ qp_arg,
1344
+ domain_elt_arg,
1345
+ domain_elt_index_arg,
1346
+ test_arg,
1347
+ test.space.space_arg_value(device),
1348
+ local_result.array,
1349
+ output_view,
1350
+ ],
1351
+ device=device,
1352
+ )
1346
1353
 
1347
1354
  local_result.release()
1348
1355
 
@@ -1459,34 +1466,42 @@ def _launch_integrate_kernel(
1459
1466
  dtype=vec_array_dtype,
1460
1467
  )
1461
1468
 
1462
- dispatch_kernel = make_bilinear_dispatch_kernel(test, trial, quadrature, accumulate_dtype)
1469
+ if test.TAYLOR_DOF_COUNT * trial.TAYLOR_DOF_COUNT == 0:
1470
+ wp.utils.warn(
1471
+ f"Test and/or trial fields are never evaluated in integrand '{integrand.name}', result will be zero",
1472
+ category=UserWarning,
1473
+ stacklevel=2,
1474
+ )
1475
+ triplet_rows.fill_(-1)
1476
+ else:
1477
+ dispatch_kernel = make_bilinear_dispatch_kernel(test, trial, quadrature, accumulate_dtype)
1463
1478
 
1464
- trial_partition_arg = trial.space_partition.partition_arg_value(device)
1465
- trial_topology_arg = trial.space_partition.space_topology.topo_arg_value(device)
1466
- wp.launch(
1467
- kernel=dispatch_kernel,
1468
- dim=(
1469
- test.space_restriction.node_count(),
1470
- test.node_dof_count,
1471
- trial.node_dof_count,
1472
- trial.space.topology.MAX_NODES_PER_ELEMENT,
1473
- ),
1474
- inputs=[
1475
- qp_arg,
1476
- domain_elt_arg,
1477
- domain_elt_index_arg,
1478
- test_arg,
1479
- test.space.space_arg_value(device),
1480
- trial_partition_arg,
1481
- trial_topology_arg,
1482
- trial.space.space_arg_value(device),
1483
- local_result_as_vec,
1484
- triplet_rows,
1485
- triplet_cols,
1486
- triplet_values,
1487
- ],
1488
- device=device,
1489
- )
1479
+ trial_partition_arg = trial.space_partition.partition_arg_value(device)
1480
+ trial_topology_arg = trial.space_partition.space_topology.topo_arg_value(device)
1481
+ wp.launch(
1482
+ kernel=dispatch_kernel,
1483
+ dim=(
1484
+ test.space_restriction.node_count(),
1485
+ test.node_dof_count,
1486
+ trial.node_dof_count,
1487
+ trial.space.topology.MAX_NODES_PER_ELEMENT,
1488
+ ),
1489
+ inputs=[
1490
+ qp_arg,
1491
+ domain_elt_arg,
1492
+ domain_elt_index_arg,
1493
+ test_arg,
1494
+ test.space.space_arg_value(device),
1495
+ trial_partition_arg,
1496
+ trial_topology_arg,
1497
+ trial.space.space_arg_value(device),
1498
+ local_result_as_vec,
1499
+ triplet_rows,
1500
+ triplet_cols,
1501
+ triplet_values,
1502
+ ],
1503
+ device=device,
1504
+ )
1490
1505
 
1491
1506
  local_result.release()
1492
1507
 
@@ -2207,6 +2222,9 @@ def _launch_interpolate_kernel(
2207
2222
  return
2208
2223
 
2209
2224
  if quadrature is None:
2225
+ if dest is not None and (not is_array(dest) or dest.shape[0] != dim):
2226
+ raise ValueError(f"dest must be a warp array with {dim} rows")
2227
+
2210
2228
  wp.launch(
2211
2229
  kernel=kernel,
2212
2230
  dim=dim,
@@ -2216,21 +2234,34 @@ def _launch_interpolate_kernel(
2216
2234
  return
2217
2235
 
2218
2236
  qp_arg = quadrature.arg_value(device)
2237
+ qp_eval_count = quadrature.evaluation_point_count()
2238
+ qp_index_count = quadrature.total_point_count()
2239
+
2240
+ if qp_eval_count != qp_index_count:
2241
+ wp.utils.warn(
2242
+ f"Quadrature used for interpolation of {integrand.name} has different number of evaluation and indexed points, this may lead to incorrect results",
2243
+ category=UserWarning,
2244
+ stacklevel=2,
2245
+ )
2246
+
2219
2247
  qp_element_index_arg = quadrature.element_index_arg_value(device)
2220
2248
  if trial is None:
2249
+ if dest is not None and (not is_array(dest) or dest.shape[0] != qp_index_count):
2250
+ raise ValueError(f"dest must be a warp array with {qp_index_count} rows")
2251
+
2221
2252
  wp.launch(
2222
2253
  kernel=kernel,
2223
- dim=quadrature.evaluation_point_count(),
2254
+ dim=qp_eval_count,
2224
2255
  inputs=[qp_arg, qp_element_index_arg, elt_arg, elt_index_arg, field_arg_values, value_struct_values, dest],
2225
2256
  device=device,
2226
2257
  )
2227
2258
  return
2228
2259
 
2229
- nnz = quadrature.total_point_count() * trial.space.topology.MAX_NODES_PER_ELEMENT
2260
+ nnz = qp_eval_count * trial.space.topology.MAX_NODES_PER_ELEMENT
2230
2261
 
2231
- if dest.nrow != quadrature.total_point_count() or dest.ncol != trial.space_partition.node_count():
2262
+ if dest.nrow != qp_index_count or dest.ncol != trial.space_partition.node_count():
2232
2263
  raise RuntimeError(
2233
- f"'dest' matrix must have {quadrature.total_point_count()} rows and {trial.space_partition.node_count()} columns of blocks"
2264
+ f"'dest' matrix must have {qp_index_count} rows and {trial.space_partition.node_count()} columns of blocks"
2234
2265
  )
2235
2266
  if dest.block_shape[1] != trial.node_dof_count:
2236
2267
  raise RuntimeError(f"'dest' matrix blocks must have {trial.node_dof_count} columns")