warp-lang 1.9.0__py3-none-win_amd64.whl → 1.10.0rc2__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.

Files changed (350) hide show
  1. warp/__init__.py +301 -287
  2. warp/__init__.pyi +2220 -313
  3. warp/_src/__init__.py +14 -0
  4. warp/_src/autograd.py +1075 -0
  5. warp/_src/build.py +618 -0
  6. warp/_src/build_dll.py +640 -0
  7. warp/{builtins.py → _src/builtins.py} +1497 -226
  8. warp/_src/codegen.py +4359 -0
  9. warp/{config.py → _src/config.py} +178 -169
  10. warp/_src/constants.py +57 -0
  11. warp/_src/context.py +8294 -0
  12. warp/_src/dlpack.py +462 -0
  13. warp/_src/fabric.py +355 -0
  14. warp/_src/fem/__init__.py +14 -0
  15. warp/_src/fem/adaptivity.py +508 -0
  16. warp/_src/fem/cache.py +687 -0
  17. warp/_src/fem/dirichlet.py +188 -0
  18. warp/{fem → _src/fem}/domain.py +40 -30
  19. warp/_src/fem/field/__init__.py +131 -0
  20. warp/_src/fem/field/field.py +701 -0
  21. warp/{fem → _src/fem}/field/nodal_field.py +30 -15
  22. warp/{fem → _src/fem}/field/restriction.py +1 -1
  23. warp/{fem → _src/fem}/field/virtual.py +53 -27
  24. warp/_src/fem/geometry/__init__.py +32 -0
  25. warp/{fem → _src/fem}/geometry/adaptive_nanogrid.py +77 -163
  26. warp/_src/fem/geometry/closest_point.py +97 -0
  27. warp/{fem → _src/fem}/geometry/deformed_geometry.py +14 -22
  28. warp/{fem → _src/fem}/geometry/element.py +32 -10
  29. warp/{fem → _src/fem}/geometry/geometry.py +48 -20
  30. warp/{fem → _src/fem}/geometry/grid_2d.py +12 -23
  31. warp/{fem → _src/fem}/geometry/grid_3d.py +12 -23
  32. warp/{fem → _src/fem}/geometry/hexmesh.py +40 -63
  33. warp/{fem → _src/fem}/geometry/nanogrid.py +255 -248
  34. warp/{fem → _src/fem}/geometry/partition.py +121 -63
  35. warp/{fem → _src/fem}/geometry/quadmesh.py +26 -45
  36. warp/{fem → _src/fem}/geometry/tetmesh.py +40 -63
  37. warp/{fem → _src/fem}/geometry/trimesh.py +26 -45
  38. warp/{fem → _src/fem}/integrate.py +164 -158
  39. warp/_src/fem/linalg.py +383 -0
  40. warp/_src/fem/operator.py +396 -0
  41. warp/_src/fem/polynomial.py +229 -0
  42. warp/{fem → _src/fem}/quadrature/pic_quadrature.py +15 -20
  43. warp/{fem → _src/fem}/quadrature/quadrature.py +95 -47
  44. warp/_src/fem/space/__init__.py +248 -0
  45. warp/{fem → _src/fem}/space/basis_function_space.py +20 -11
  46. warp/_src/fem/space/basis_space.py +679 -0
  47. warp/{fem → _src/fem}/space/dof_mapper.py +3 -3
  48. warp/{fem → _src/fem}/space/function_space.py +14 -13
  49. warp/{fem → _src/fem}/space/grid_2d_function_space.py +4 -7
  50. warp/{fem → _src/fem}/space/grid_3d_function_space.py +4 -4
  51. warp/{fem → _src/fem}/space/hexmesh_function_space.py +4 -10
  52. warp/{fem → _src/fem}/space/nanogrid_function_space.py +3 -9
  53. warp/{fem → _src/fem}/space/partition.py +117 -60
  54. warp/{fem → _src/fem}/space/quadmesh_function_space.py +4 -10
  55. warp/{fem → _src/fem}/space/restriction.py +66 -33
  56. warp/_src/fem/space/shape/__init__.py +152 -0
  57. warp/{fem → _src/fem}/space/shape/cube_shape_function.py +9 -9
  58. warp/{fem → _src/fem}/space/shape/shape_function.py +8 -9
  59. warp/{fem → _src/fem}/space/shape/square_shape_function.py +6 -6
  60. warp/{fem → _src/fem}/space/shape/tet_shape_function.py +3 -3
  61. warp/{fem → _src/fem}/space/shape/triangle_shape_function.py +3 -3
  62. warp/{fem → _src/fem}/space/tetmesh_function_space.py +3 -9
  63. warp/_src/fem/space/topology.py +459 -0
  64. warp/{fem → _src/fem}/space/trimesh_function_space.py +3 -9
  65. warp/_src/fem/types.py +112 -0
  66. warp/_src/fem/utils.py +486 -0
  67. warp/_src/jax.py +186 -0
  68. warp/_src/jax_experimental/__init__.py +14 -0
  69. warp/_src/jax_experimental/custom_call.py +387 -0
  70. warp/_src/jax_experimental/ffi.py +1284 -0
  71. warp/_src/jax_experimental/xla_ffi.py +656 -0
  72. warp/_src/marching_cubes.py +708 -0
  73. warp/_src/math.py +414 -0
  74. warp/_src/optim/__init__.py +14 -0
  75. warp/_src/optim/adam.py +163 -0
  76. warp/_src/optim/linear.py +1606 -0
  77. warp/_src/optim/sgd.py +112 -0
  78. warp/_src/paddle.py +406 -0
  79. warp/_src/render/__init__.py +14 -0
  80. warp/_src/render/imgui_manager.py +289 -0
  81. warp/_src/render/render_opengl.py +3636 -0
  82. warp/_src/render/render_usd.py +937 -0
  83. warp/_src/render/utils.py +160 -0
  84. warp/_src/sparse.py +2716 -0
  85. warp/_src/tape.py +1206 -0
  86. warp/{thirdparty → _src/thirdparty}/unittest_parallel.py +9 -2
  87. warp/_src/torch.py +391 -0
  88. warp/_src/types.py +5870 -0
  89. warp/_src/utils.py +1693 -0
  90. warp/autograd.py +12 -1054
  91. warp/bin/warp-clang.dll +0 -0
  92. warp/bin/warp.dll +0 -0
  93. warp/build.py +8 -588
  94. warp/build_dll.py +6 -471
  95. warp/codegen.py +6 -4246
  96. warp/constants.py +6 -39
  97. warp/context.py +12 -7851
  98. warp/dlpack.py +6 -444
  99. warp/examples/distributed/example_jacobi_mpi.py +4 -5
  100. warp/examples/fem/example_adaptive_grid.py +1 -1
  101. warp/examples/fem/example_apic_fluid.py +1 -1
  102. warp/examples/fem/example_burgers.py +8 -8
  103. warp/examples/fem/example_diffusion.py +1 -1
  104. warp/examples/fem/example_distortion_energy.py +1 -1
  105. warp/examples/fem/example_mixed_elasticity.py +2 -2
  106. warp/examples/fem/example_navier_stokes.py +1 -1
  107. warp/examples/fem/example_nonconforming_contact.py +7 -7
  108. warp/examples/fem/example_stokes.py +1 -1
  109. warp/examples/fem/example_stokes_transfer.py +1 -1
  110. warp/examples/fem/utils.py +2 -2
  111. warp/examples/interop/example_jax_callable.py +1 -1
  112. warp/examples/interop/example_jax_ffi_callback.py +1 -1
  113. warp/examples/interop/example_jax_kernel.py +3 -2
  114. warp/examples/tile/example_tile_mcgp.py +191 -0
  115. warp/fabric.py +6 -337
  116. warp/fem/__init__.py +159 -97
  117. warp/fem/adaptivity.py +7 -489
  118. warp/fem/cache.py +9 -648
  119. warp/fem/dirichlet.py +6 -184
  120. warp/fem/field/__init__.py +8 -109
  121. warp/fem/field/field.py +7 -652
  122. warp/fem/geometry/__init__.py +7 -18
  123. warp/fem/geometry/closest_point.py +11 -77
  124. warp/fem/linalg.py +18 -366
  125. warp/fem/operator.py +11 -369
  126. warp/fem/polynomial.py +9 -209
  127. warp/fem/space/__init__.py +5 -211
  128. warp/fem/space/basis_space.py +6 -662
  129. warp/fem/space/shape/__init__.py +41 -118
  130. warp/fem/space/topology.py +6 -437
  131. warp/fem/types.py +6 -81
  132. warp/fem/utils.py +11 -444
  133. warp/jax.py +8 -165
  134. warp/jax_experimental/__init__.py +14 -1
  135. warp/jax_experimental/custom_call.py +8 -342
  136. warp/jax_experimental/ffi.py +17 -853
  137. warp/jax_experimental/xla_ffi.py +5 -596
  138. warp/marching_cubes.py +5 -689
  139. warp/math.py +16 -393
  140. warp/native/array.h +385 -37
  141. warp/native/builtin.h +316 -39
  142. warp/native/bvh.cpp +43 -9
  143. warp/native/bvh.cu +62 -27
  144. warp/native/bvh.h +310 -309
  145. warp/native/clang/clang.cpp +102 -97
  146. warp/native/coloring.cpp +0 -1
  147. warp/native/crt.h +208 -0
  148. warp/native/exports.h +156 -0
  149. warp/native/hashgrid.cu +2 -0
  150. warp/native/intersect.h +24 -1
  151. warp/native/intersect_tri.h +44 -35
  152. warp/native/mat.h +1456 -276
  153. warp/native/mesh.cpp +4 -4
  154. warp/native/mesh.cu +4 -2
  155. warp/native/mesh.h +176 -61
  156. warp/native/quat.h +0 -52
  157. warp/native/scan.cu +2 -0
  158. warp/native/sort.cu +22 -13
  159. warp/native/sort.h +2 -0
  160. warp/native/sparse.cu +7 -3
  161. warp/native/spatial.h +12 -0
  162. warp/native/tile.h +837 -70
  163. warp/native/tile_radix_sort.h +1 -1
  164. warp/native/tile_reduce.h +394 -46
  165. warp/native/tile_scan.h +4 -4
  166. warp/native/vec.h +469 -53
  167. warp/native/version.h +23 -0
  168. warp/native/volume.cpp +1 -1
  169. warp/native/volume.cu +1 -0
  170. warp/native/volume.h +1 -1
  171. warp/native/volume_builder.cu +2 -0
  172. warp/native/warp.cpp +60 -32
  173. warp/native/warp.cu +313 -201
  174. warp/native/warp.h +14 -11
  175. warp/optim/__init__.py +6 -3
  176. warp/optim/adam.py +6 -145
  177. warp/optim/linear.py +14 -1585
  178. warp/optim/sgd.py +6 -94
  179. warp/paddle.py +6 -388
  180. warp/render/__init__.py +8 -4
  181. warp/render/imgui_manager.py +7 -267
  182. warp/render/render_opengl.py +6 -3616
  183. warp/render/render_usd.py +6 -918
  184. warp/render/utils.py +6 -142
  185. warp/sparse.py +37 -2563
  186. warp/tape.py +6 -1188
  187. warp/tests/__main__.py +1 -1
  188. warp/tests/cuda/test_async.py +4 -4
  189. warp/tests/cuda/test_conditional_captures.py +1 -1
  190. warp/tests/cuda/test_multigpu.py +1 -1
  191. warp/tests/cuda/test_streams.py +58 -1
  192. warp/tests/geometry/test_bvh.py +157 -22
  193. warp/tests/geometry/test_hash_grid.py +38 -0
  194. warp/tests/geometry/test_marching_cubes.py +0 -1
  195. warp/tests/geometry/test_mesh.py +5 -3
  196. warp/tests/geometry/test_mesh_query_aabb.py +5 -12
  197. warp/tests/geometry/test_mesh_query_point.py +5 -2
  198. warp/tests/geometry/test_mesh_query_ray.py +15 -3
  199. warp/tests/geometry/test_volume_write.py +5 -5
  200. warp/tests/interop/test_dlpack.py +14 -14
  201. warp/tests/interop/test_jax.py +1382 -79
  202. warp/tests/interop/test_paddle.py +1 -1
  203. warp/tests/test_adam.py +0 -1
  204. warp/tests/test_arithmetic.py +9 -9
  205. warp/tests/test_array.py +529 -100
  206. warp/tests/test_array_reduce.py +3 -3
  207. warp/tests/test_atomic.py +12 -8
  208. warp/tests/test_atomic_bitwise.py +209 -0
  209. warp/tests/test_atomic_cas.py +4 -4
  210. warp/tests/test_bool.py +2 -2
  211. warp/tests/test_builtins_resolution.py +5 -571
  212. warp/tests/test_codegen.py +34 -15
  213. warp/tests/test_conditional.py +1 -1
  214. warp/tests/test_context.py +6 -6
  215. warp/tests/test_copy.py +242 -161
  216. warp/tests/test_ctypes.py +3 -3
  217. warp/tests/test_devices.py +24 -2
  218. warp/tests/test_examples.py +16 -84
  219. warp/tests/test_fabricarray.py +35 -35
  220. warp/tests/test_fast_math.py +0 -2
  221. warp/tests/test_fem.py +60 -14
  222. warp/tests/test_fixedarray.py +3 -3
  223. warp/tests/test_func.py +8 -5
  224. warp/tests/test_generics.py +1 -1
  225. warp/tests/test_indexedarray.py +24 -24
  226. warp/tests/test_intersect.py +39 -9
  227. warp/tests/test_large.py +1 -1
  228. warp/tests/test_lerp.py +3 -1
  229. warp/tests/test_linear_solvers.py +1 -1
  230. warp/tests/test_map.py +49 -4
  231. warp/tests/test_mat.py +52 -62
  232. warp/tests/test_mat_constructors.py +4 -5
  233. warp/tests/test_mat_lite.py +1 -1
  234. warp/tests/test_mat_scalar_ops.py +121 -121
  235. warp/tests/test_math.py +34 -0
  236. warp/tests/test_module_aot.py +4 -4
  237. warp/tests/test_modules_lite.py +28 -2
  238. warp/tests/test_print.py +11 -11
  239. warp/tests/test_quat.py +93 -58
  240. warp/tests/test_runlength_encode.py +1 -1
  241. warp/tests/test_scalar_ops.py +38 -10
  242. warp/tests/test_smoothstep.py +1 -1
  243. warp/tests/test_sparse.py +126 -15
  244. warp/tests/test_spatial.py +105 -87
  245. warp/tests/test_special_values.py +6 -6
  246. warp/tests/test_static.py +7 -7
  247. warp/tests/test_struct.py +13 -2
  248. warp/tests/test_triangle_closest_point.py +48 -1
  249. warp/tests/test_tuple.py +96 -0
  250. warp/tests/test_types.py +82 -9
  251. warp/tests/test_utils.py +52 -52
  252. warp/tests/test_vec.py +29 -29
  253. warp/tests/test_vec_constructors.py +5 -5
  254. warp/tests/test_vec_scalar_ops.py +97 -97
  255. warp/tests/test_version.py +75 -0
  256. warp/tests/tile/test_tile.py +239 -0
  257. warp/tests/tile/test_tile_atomic_bitwise.py +403 -0
  258. warp/tests/tile/test_tile_cholesky.py +7 -4
  259. warp/tests/tile/test_tile_load.py +26 -2
  260. warp/tests/tile/test_tile_mathdx.py +3 -3
  261. warp/tests/tile/test_tile_matmul.py +1 -1
  262. warp/tests/tile/test_tile_mlp.py +2 -4
  263. warp/tests/tile/test_tile_reduce.py +214 -13
  264. warp/tests/unittest_suites.py +6 -14
  265. warp/tests/unittest_utils.py +10 -9
  266. warp/tests/walkthrough_debug.py +3 -1
  267. warp/torch.py +6 -373
  268. warp/types.py +29 -5750
  269. warp/utils.py +10 -1659
  270. {warp_lang-1.9.0.dist-info → warp_lang-1.10.0rc2.dist-info}/METADATA +47 -103
  271. warp_lang-1.10.0rc2.dist-info/RECORD +468 -0
  272. warp_lang-1.10.0rc2.dist-info/licenses/licenses/Gaia-LICENSE.txt +6 -0
  273. warp_lang-1.10.0rc2.dist-info/licenses/licenses/appdirs-LICENSE.txt +22 -0
  274. warp_lang-1.10.0rc2.dist-info/licenses/licenses/asset_pixel_jpg-LICENSE.txt +3 -0
  275. warp_lang-1.10.0rc2.dist-info/licenses/licenses/cuda-LICENSE.txt +1582 -0
  276. warp_lang-1.10.0rc2.dist-info/licenses/licenses/dlpack-LICENSE.txt +201 -0
  277. warp_lang-1.10.0rc2.dist-info/licenses/licenses/fp16-LICENSE.txt +28 -0
  278. warp_lang-1.10.0rc2.dist-info/licenses/licenses/libmathdx-LICENSE.txt +220 -0
  279. warp_lang-1.10.0rc2.dist-info/licenses/licenses/llvm-LICENSE.txt +279 -0
  280. warp_lang-1.10.0rc2.dist-info/licenses/licenses/moller-LICENSE.txt +16 -0
  281. warp_lang-1.10.0rc2.dist-info/licenses/licenses/nanovdb-LICENSE.txt +2 -0
  282. warp_lang-1.10.0rc2.dist-info/licenses/licenses/nvrtc-LICENSE.txt +1592 -0
  283. warp_lang-1.10.0rc2.dist-info/licenses/licenses/svd-LICENSE.txt +23 -0
  284. warp_lang-1.10.0rc2.dist-info/licenses/licenses/unittest_parallel-LICENSE.txt +21 -0
  285. warp_lang-1.10.0rc2.dist-info/licenses/licenses/usd-LICENSE.txt +213 -0
  286. warp_lang-1.10.0rc2.dist-info/licenses/licenses/windingnumber-LICENSE.txt +21 -0
  287. warp/examples/assets/cartpole.urdf +0 -110
  288. warp/examples/assets/crazyflie.usd +0 -0
  289. warp/examples/assets/nv_ant.xml +0 -92
  290. warp/examples/assets/nv_humanoid.xml +0 -183
  291. warp/examples/assets/quadruped.urdf +0 -268
  292. warp/examples/optim/example_bounce.py +0 -266
  293. warp/examples/optim/example_cloth_throw.py +0 -228
  294. warp/examples/optim/example_drone.py +0 -870
  295. warp/examples/optim/example_inverse_kinematics.py +0 -182
  296. warp/examples/optim/example_inverse_kinematics_torch.py +0 -191
  297. warp/examples/optim/example_softbody_properties.py +0 -400
  298. warp/examples/optim/example_spring_cage.py +0 -245
  299. warp/examples/optim/example_trajectory.py +0 -227
  300. warp/examples/sim/example_cartpole.py +0 -143
  301. warp/examples/sim/example_cloth.py +0 -225
  302. warp/examples/sim/example_cloth_self_contact.py +0 -316
  303. warp/examples/sim/example_granular.py +0 -130
  304. warp/examples/sim/example_granular_collision_sdf.py +0 -202
  305. warp/examples/sim/example_jacobian_ik.py +0 -244
  306. warp/examples/sim/example_particle_chain.py +0 -124
  307. warp/examples/sim/example_quadruped.py +0 -203
  308. warp/examples/sim/example_rigid_chain.py +0 -203
  309. warp/examples/sim/example_rigid_contact.py +0 -195
  310. warp/examples/sim/example_rigid_force.py +0 -133
  311. warp/examples/sim/example_rigid_gyroscopic.py +0 -115
  312. warp/examples/sim/example_rigid_soft_contact.py +0 -140
  313. warp/examples/sim/example_soft_body.py +0 -196
  314. warp/examples/tile/example_tile_walker.py +0 -327
  315. warp/sim/__init__.py +0 -74
  316. warp/sim/articulation.py +0 -793
  317. warp/sim/collide.py +0 -2570
  318. warp/sim/graph_coloring.py +0 -307
  319. warp/sim/import_mjcf.py +0 -791
  320. warp/sim/import_snu.py +0 -227
  321. warp/sim/import_urdf.py +0 -579
  322. warp/sim/import_usd.py +0 -898
  323. warp/sim/inertia.py +0 -357
  324. warp/sim/integrator.py +0 -245
  325. warp/sim/integrator_euler.py +0 -2000
  326. warp/sim/integrator_featherstone.py +0 -2101
  327. warp/sim/integrator_vbd.py +0 -2487
  328. warp/sim/integrator_xpbd.py +0 -3295
  329. warp/sim/model.py +0 -4821
  330. warp/sim/particles.py +0 -121
  331. warp/sim/render.py +0 -431
  332. warp/sim/utils.py +0 -431
  333. warp/tests/sim/disabled_kinematics.py +0 -244
  334. warp/tests/sim/test_cloth.py +0 -863
  335. warp/tests/sim/test_collision.py +0 -743
  336. warp/tests/sim/test_coloring.py +0 -347
  337. warp/tests/sim/test_inertia.py +0 -161
  338. warp/tests/sim/test_model.py +0 -226
  339. warp/tests/sim/test_sim_grad.py +0 -287
  340. warp/tests/sim/test_sim_grad_bounce_linear.py +0 -212
  341. warp/tests/sim/test_sim_kinematics.py +0 -98
  342. warp/thirdparty/__init__.py +0 -0
  343. warp_lang-1.9.0.dist-info/RECORD +0 -456
  344. /warp/{fem → _src/fem}/quadrature/__init__.py +0 -0
  345. /warp/{tests/sim → _src/thirdparty}/__init__.py +0 -0
  346. /warp/{thirdparty → _src/thirdparty}/appdirs.py +0 -0
  347. /warp/{thirdparty → _src/thirdparty}/dlpack.py +0 -0
  348. {warp_lang-1.9.0.dist-info → warp_lang-1.10.0rc2.dist-info}/WHEEL +0 -0
  349. {warp_lang-1.9.0.dist-info → warp_lang-1.10.0rc2.dist-info}/licenses/LICENSE.md +0 -0
  350. {warp_lang-1.9.0.dist-info → warp_lang-1.10.0rc2.dist-info}/top_level.txt +0 -0
@@ -44,7 +44,7 @@ def test_devices_map_cuda_device(test, device):
44
44
  # Map alias twice to check code path
45
45
  wp.map_cuda_device("new_alias")
46
46
  wp.map_cuda_device("new_alias")
47
- wp.context.runtime.rename_device(device, saved_alias)
47
+ wp._src.context.runtime.rename_device(device, saved_alias)
48
48
 
49
49
 
50
50
  def test_devices_verify_cuda_device(test, device):
@@ -52,7 +52,7 @@ def test_devices_verify_cuda_device(test, device):
52
52
 
53
53
  wp.config.verify_cuda = True
54
54
 
55
- wp.context.runtime.verify_cuda_device(device)
55
+ wp._src.context.runtime.verify_cuda_device(device)
56
56
 
57
57
  wp.config.verify_cuda = verify_cuda_saved
58
58
 
@@ -85,6 +85,28 @@ class TestDevices(unittest.TestCase):
85
85
  with self.assertRaises(RuntimeError):
86
86
  wp.unmap_cuda_device("imaginary_device:0")
87
87
 
88
+ def test_devices_get_cuda_supported_archs(self):
89
+ if not wp.is_cuda_available():
90
+ self.assertEqual(wp.get_cuda_supported_archs(), [], "Should return empty list when CUDA is not available")
91
+ else:
92
+ archs = wp.get_cuda_supported_archs()
93
+ self.assertTrue(len(archs) > 0, "No CUDA supported architectures found")
94
+
95
+ # Check all elements are integers
96
+ for arch in archs:
97
+ self.assertIsInstance(arch, int, f"Architecture value {arch} should be an integer")
98
+
99
+ # Check the list is sorted
100
+ self.assertEqual(archs, sorted(archs), "Architecture list should be sorted")
101
+
102
+ # Check for no duplicates
103
+ self.assertEqual(len(archs), len(set(archs)), "Architecture list should not contain duplicates")
104
+
105
+ # Check values are reasonable (modern CUDA architectures are >= 50)
106
+ for arch in archs:
107
+ self.assertGreaterEqual(arch, 50, f"Architecture {arch} should be >= 50 (e.g., sm_50)")
108
+ self.assertLessEqual(arch, 150, f"Architecture {arch} seems unreasonably high")
109
+
88
110
 
89
111
  add_function_test(
90
112
  TestDevices,
@@ -44,15 +44,13 @@ from typing import Any, Dict, Optional, Type
44
44
 
45
45
  import warp as wp
46
46
  import warp.tests.unittest_utils
47
+ from warp._src.utils import check_p2p
47
48
  from warp.tests.unittest_utils import (
48
49
  USD_AVAILABLE,
49
50
  get_selected_cuda_test_devices,
50
51
  get_test_devices,
51
52
  sanitize_identifier,
52
53
  )
53
- from warp.utils import check_p2p
54
-
55
- wp.init() # For wp.context.runtime.core.wp_is_debug_enabled()
56
54
 
57
55
 
58
56
  def _build_command_line_options(test_options: Dict[str, Any]) -> list:
@@ -280,25 +278,6 @@ class TestOptimExamples(unittest.TestCase):
280
278
  pass
281
279
 
282
280
 
283
- add_example_test(
284
- TestOptimExamples,
285
- name="optim.example_bounce",
286
- devices=test_devices,
287
- test_options_cpu={"train_iters": 3},
288
- )
289
- add_example_test(
290
- TestOptimExamples,
291
- name="optim.example_drone",
292
- devices=test_devices,
293
- test_options={"headless": True},
294
- test_options_cpu={"num_frames": 10},
295
- )
296
- add_example_test(
297
- TestOptimExamples,
298
- name="optim.example_cloth_throw",
299
- devices=test_devices,
300
- test_options_cpu={"train_iters": 3},
301
- )
302
281
  add_example_test(
303
282
  TestOptimExamples,
304
283
  name="optim.example_diffray",
@@ -312,68 +291,6 @@ add_example_test(
312
291
  devices=cuda_test_devices,
313
292
  test_options={"headless": True, "train_iters": 5, "num_frames": 300, "pillow_required": True},
314
293
  )
315
- add_example_test(TestOptimExamples, name="optim.example_inverse_kinematics", devices=test_devices)
316
- add_example_test(
317
- TestOptimExamples,
318
- name="optim.example_inverse_kinematics_torch",
319
- devices=test_devices,
320
- test_options={"torch_required": True},
321
- )
322
- add_example_test(TestOptimExamples, name="optim.example_spring_cage", devices=test_devices)
323
- add_example_test(
324
- TestOptimExamples,
325
- name="optim.example_trajectory",
326
- devices=test_devices,
327
- test_options={"headless": True, "train_iters": 50},
328
- )
329
- add_example_test(
330
- TestOptimExamples,
331
- name="optim.example_softbody_properties",
332
- devices=test_devices,
333
- test_options_cuda={
334
- "train_iters": 1 if warp.context.runtime.core.wp_is_debug_enabled() else 3,
335
- },
336
- test_options_cpu={"train_iters": 1},
337
- )
338
-
339
-
340
- class TestSimExamples(unittest.TestCase):
341
- pass
342
-
343
-
344
- add_example_test(TestSimExamples, name="sim.example_cartpole", devices=test_devices)
345
- add_example_test(
346
- TestSimExamples,
347
- name="sim.example_cloth",
348
- devices=test_devices,
349
- test_options={"usd_required": True},
350
- test_options_cpu={"num_frames": 10},
351
- )
352
- add_example_test(
353
- TestSimExamples, name="sim.example_granular", devices=test_devices, test_options_cpu={"num_frames": 10}
354
- )
355
- add_example_test(TestSimExamples, name="sim.example_granular_collision_sdf", devices=cuda_test_devices)
356
- add_example_test(TestSimExamples, name="sim.example_jacobian_ik", devices=test_devices)
357
- add_example_test(TestSimExamples, name="sim.example_particle_chain", devices=test_devices)
358
- add_example_test(
359
- TestSimExamples, name="sim.example_quadruped", devices=test_devices, test_options_cpu={"num_frames": 100}
360
- )
361
- add_example_test(TestSimExamples, name="sim.example_rigid_chain", devices=test_devices)
362
- add_example_test(
363
- TestSimExamples,
364
- name="sim.example_rigid_contact",
365
- devices=test_devices,
366
- test_options={"usd_required": True},
367
- test_options_cpu={"num_frames": 3},
368
- )
369
- add_example_test(
370
- TestSimExamples, name="sim.example_rigid_soft_contact", devices=test_devices, test_options_cpu={"num_frames": 10}
371
- )
372
- add_example_test(TestSimExamples, name="sim.example_rigid_force", devices=test_devices)
373
- add_example_test(TestSimExamples, name="sim.example_rigid_gyroscopic", devices=test_devices)
374
- add_example_test(
375
- TestSimExamples, name="sim.example_soft_body", devices=test_devices, test_options_cpu={"num_frames": 10}
376
- )
377
294
 
378
295
 
379
296
  class TestFemExamples(unittest.TestCase):
@@ -486,6 +403,21 @@ add_example_test(
486
403
  test_options={"headless": True, "resolution": 16, "num_steps": 2},
487
404
  )
488
405
 
406
+
407
+ class TestTileExamples(unittest.TestCase):
408
+ pass
409
+
410
+
411
+ add_example_test(
412
+ TestTileExamples,
413
+ name="tile.example_tile_mcgp",
414
+ devices=test_devices,
415
+ test_options={"height": 128, "headless": True, "usd_required": True},
416
+ test_options_cpu={"slices": 2},
417
+ test_options_cuda={"slices": 5},
418
+ )
419
+
420
+
489
421
  if __name__ == "__main__":
490
422
  # force rebuild of all kernels
491
423
  wp.clear_kernel_cache()
@@ -26,14 +26,14 @@ from warp.tests.unittest_utils import *
26
26
 
27
27
  # types to test fabric arrays
28
28
  _fabric_types = [
29
- *wp.types.scalar_types,
30
- *[wp.types.vector(2, T) for T in wp.types.scalar_types],
31
- *[wp.types.vector(3, T) for T in wp.types.scalar_types],
32
- *[wp.types.vector(4, T) for T in wp.types.scalar_types],
33
- *[wp.types.matrix((2, 2), T) for T in wp.types.scalar_types],
34
- *[wp.types.matrix((3, 3), T) for T in wp.types.scalar_types],
35
- *[wp.types.matrix((4, 4), T) for T in wp.types.scalar_types],
36
- *[wp.types.quaternion(T) for T in wp.types.float_types],
29
+ *wp._src.types.scalar_types,
30
+ *[wp._src.types.vector(2, T) for T in wp._src.types.scalar_types],
31
+ *[wp._src.types.vector(3, T) for T in wp._src.types.scalar_types],
32
+ *[wp._src.types.vector(4, T) for T in wp._src.types.scalar_types],
33
+ *[wp._src.types.matrix((2, 2), T) for T in wp._src.types.scalar_types],
34
+ *[wp._src.types.matrix((3, 3), T) for T in wp._src.types.scalar_types],
35
+ *[wp._src.types.matrix((4, 4), T) for T in wp._src.types.scalar_types],
36
+ *[wp._src.types.quaternion(T) for T in wp._src.types.float_types],
37
37
  ]
38
38
 
39
39
 
@@ -114,7 +114,7 @@ def _create_fabric_array_interface(data: wp.array, attrib: str, bucket_sizes: li
114
114
  # empty data array
115
115
  bucket_sizes = []
116
116
 
117
- dtype_size = wp.types.type_size_in_bytes(data.dtype)
117
+ dtype_size = wp._src.types.type_size_in_bytes(data.dtype)
118
118
  p = int(data.ptr) if data.ptr else 0
119
119
  pointers = []
120
120
  counts = []
@@ -189,10 +189,10 @@ def _create_fabric_array_array_interface(data: list, attrib: str, bucket_sizes:
189
189
  _array_lengths.append(data[i].size)
190
190
 
191
191
  array_pointers = wp.array(_array_pointers, dtype=wp.uint64, device=device)
192
- pointer_size = wp.types.type_size_in_bytes(array_pointers.dtype)
192
+ pointer_size = wp._src.types.type_size_in_bytes(array_pointers.dtype)
193
193
 
194
194
  lengths = wp.array(_array_lengths, dtype=wp.uint64, device=device)
195
- length_size = wp.types.type_size_in_bytes(lengths.dtype)
195
+ length_size = wp._src.types.type_size_in_bytes(lengths.dtype)
196
196
 
197
197
  p_pointers = int(array_pointers.ptr)
198
198
  p_lengths = int(lengths.ptr)
@@ -296,9 +296,9 @@ def fa_generic_dtype_kernel_indexed(a: wp.indexedfabricarray(dtype=Any), b: wp.i
296
296
  def test_fabricarray_generic_dtype(test, device):
297
297
  for T in _fabric_types:
298
298
  if hasattr(T, "_wp_scalar_type_"):
299
- nptype = wp.types.warp_type_to_np_dtype[T._wp_scalar_type_]
299
+ nptype = wp._src.types.warp_type_to_np_dtype[T._wp_scalar_type_]
300
300
  else:
301
- nptype = wp.types.warp_type_to_np_dtype[T]
301
+ nptype = wp._src.types.warp_type_to_np_dtype[T]
302
302
 
303
303
  data = wp.array(data=np.arange(10, dtype=nptype), device=device)
304
304
  data_iface = _create_fabric_array_interface(data, "foo", copy=True)
@@ -345,9 +345,9 @@ def fa_generic_array_kernel(a: Any, b: Any):
345
345
  def test_fabricarray_generic_array(test, device):
346
346
  for T in _fabric_types:
347
347
  if hasattr(T, "_wp_scalar_type_"):
348
- nptype = wp.types.warp_type_to_np_dtype[T._wp_scalar_type_]
348
+ nptype = wp._src.types.warp_type_to_np_dtype[T._wp_scalar_type_]
349
349
  else:
350
- nptype = wp.types.warp_type_to_np_dtype[T]
350
+ nptype = wp._src.types.warp_type_to_np_dtype[T]
351
351
 
352
352
  data = wp.array(data=np.arange(100, dtype=nptype), device=device)
353
353
  data_iface = _create_fabric_array_interface(data, "foo", copy=True)
@@ -393,9 +393,9 @@ def test_fabricarray_empty(test, device):
393
393
  # scalar, vector, or matrix
394
394
  if ncols > 0:
395
395
  if nrows > 0:
396
- wptype = wp.types.matrix((nrows, ncols), wptype)
396
+ wptype = wp._src.types.matrix((nrows, ncols), wptype)
397
397
  else:
398
- wptype = wp.types.vector(ncols, wptype)
398
+ wptype = wp._src.types.vector(ncols, wptype)
399
399
  dtype_shape = wptype._shape_
400
400
  else:
401
401
  dtype_shape = ()
@@ -461,7 +461,7 @@ def test_fabricarray_empty(test, device):
461
461
  test.assertEqual(ifa.list(), [])
462
462
 
463
463
  # test with scalars, vectors, and matrices
464
- for nptype, wptype in wp.types.np_dtype_to_warp_type.items():
464
+ for nptype, wptype in wp._src.types.np_dtype_to_warp_type.items():
465
465
  # scalars
466
466
  test_empty_ops(0, 0, wptype, nptype)
467
467
 
@@ -473,7 +473,7 @@ def test_fabricarray_empty(test, device):
473
473
 
474
474
 
475
475
  def test_fabricarray_fill_scalar(test, device):
476
- for nptype, wptype in wp.types.np_dtype_to_warp_type.items():
476
+ for nptype, wptype in wp._src.types.np_dtype_to_warp_type.items():
477
477
  # create a data array
478
478
  data = wp.zeros(100, dtype=wptype, device=device)
479
479
  iface = _create_fabric_array_interface(data, "foo", copy=True)
@@ -489,7 +489,7 @@ def test_fabricarray_fill_scalar(test, device):
489
489
  fa.zero_()
490
490
  assert_np_equal(fa.numpy(), np.zeros(fa.shape, dtype=nptype))
491
491
 
492
- if wptype in wp.types.float_types:
492
+ if wptype in wp._src.types.float_types:
493
493
  # fill with float value
494
494
  fill_value = 13.37
495
495
  fa.fill_(fill_value)
@@ -524,7 +524,7 @@ def test_fabricarray_fill_scalar(test, device):
524
524
  assert_np_equal(ifa.numpy(), np.zeros(ifa.shape, dtype=nptype))
525
525
  assert_np_equal(ifb.numpy(), np.zeros(ifb.shape, dtype=nptype))
526
526
 
527
- if wptype in wp.types.float_types:
527
+ if wptype in wp._src.types.float_types:
528
528
  # fill with float value
529
529
  fill_value = 13.37
530
530
  ifa.fill_(fill_value)
@@ -541,13 +541,13 @@ def test_fabricarray_fill_scalar(test, device):
541
541
  def test_fabricarray_fill_vector(test, device):
542
542
  # test filling a vector array with scalar or vector values (vec_type, list, or numpy array)
543
543
 
544
- for nptype, wptype in wp.types.np_dtype_to_warp_type.items():
544
+ for nptype, wptype in wp._src.types.np_dtype_to_warp_type.items():
545
545
  # vector types
546
546
  vector_types = [
547
- wp.types.vector(2, wptype),
548
- wp.types.vector(3, wptype),
549
- wp.types.vector(4, wptype),
550
- wp.types.vector(5, wptype),
547
+ wp._src.types.vector(2, wptype),
548
+ wp._src.types.vector(3, wptype),
549
+ wp._src.types.vector(4, wptype),
550
+ wp._src.types.vector(5, wptype),
551
551
  ]
552
552
 
553
553
  for vec_type in vector_types:
@@ -593,7 +593,7 @@ def test_fabricarray_fill_vector(test, device):
593
593
  fa.fill_(fill_vec)
594
594
  assert_np_equal(fa.numpy(), expected)
595
595
 
596
- if wptype in wp.types.float_types:
596
+ if wptype in wp._src.types.float_types:
597
597
  # fill with float scalar
598
598
  fill_value = 13.37
599
599
  fa.fill_(fill_value)
@@ -661,7 +661,7 @@ def test_fabricarray_fill_vector(test, device):
661
661
  assert_np_equal(ifa.numpy(), expected)
662
662
  assert_np_equal(ifb.numpy(), np.zeros((*ifb.shape, vec_len), dtype=nptype))
663
663
 
664
- if wptype in wp.types.float_types:
664
+ if wptype in wp._src.types.float_types:
665
665
  # fill with float scalar
666
666
  fill_value = 13.37
667
667
  ifa.fill_(fill_value)
@@ -682,14 +682,14 @@ def test_fabricarray_fill_vector(test, device):
682
682
  def test_fabricarray_fill_matrix(test, device):
683
683
  # test filling a matrix array with scalar or matrix values (mat_type, nested list, or 2d numpy array)
684
684
 
685
- for nptype, wptype in wp.types.np_dtype_to_warp_type.items():
685
+ for nptype, wptype in wp._src.types.np_dtype_to_warp_type.items():
686
686
  # matrix types
687
687
  matrix_types = [
688
688
  # square matrices only
689
- wp.types.matrix((2, 2), wptype),
690
- wp.types.matrix((3, 3), wptype),
691
- wp.types.matrix((4, 4), wptype),
692
- wp.types.matrix((5, 5), wptype),
689
+ wp._src.types.matrix((2, 2), wptype),
690
+ wp._src.types.matrix((3, 3), wptype),
691
+ wp._src.types.matrix((4, 4), wptype),
692
+ wp._src.types.matrix((5, 5), wptype),
693
693
  ]
694
694
 
695
695
  for mat_type in matrix_types:
@@ -896,9 +896,9 @@ def fa_generic_sums_kernel_indexed(a: wp.indexedfabricarrayarray(dtype=Any), sum
896
896
  def test_fabricarrayarray(test, device):
897
897
  for T in _fabric_types:
898
898
  if hasattr(T, "_wp_scalar_type_"):
899
- nptype = wp.types.warp_type_to_np_dtype[T._wp_scalar_type_]
899
+ nptype = wp._src.types.warp_type_to_np_dtype[T._wp_scalar_type_]
900
900
  else:
901
- nptype = wp.types.warp_type_to_np_dtype[T]
901
+ nptype = wp._src.types.warp_type_to_np_dtype[T]
902
902
 
903
903
  n = 100
904
904
 
@@ -21,8 +21,6 @@ from warp.tests.unittest_utils import *
21
21
 
22
22
  @wp.kernel
23
23
  def test_pow(e: float, expected: float):
24
- tid = wp.tid()
25
-
26
24
  y = wp.pow(-2.0, e)
27
25
 
28
26
  # Since equality comparisons with NaN's are false, we have to do something manually
warp/tests/test_fem.py CHANGED
@@ -22,19 +22,18 @@ import numpy as np
22
22
 
23
23
  import warp as wp
24
24
  import warp.fem as fem
25
- from warp.fem import Coords, D, Domain, Field, Sample, curl, div, grad, integrand, normal
25
+ from warp._src.fem.geometry.closest_point import project_on_tet_at_origin, project_on_tri_at_origin
26
+ from warp._src.fem.space import shape
27
+ from warp.fem import Coords, D, Domain, Field, Sample, curl, div, grad, integrand, make_free_sample, normal
26
28
  from warp.fem.cache import dynamic_kernel
27
- from warp.fem.geometry.closest_point import project_on_tet_at_origin, project_on_tri_at_origin
28
29
  from warp.fem.linalg import inverse_qr, spherical_part, symmetric_eigenvalues_qr, symmetric_part
29
- from warp.fem.space import shape
30
- from warp.fem.types import make_free_sample
31
30
  from warp.fem.utils import (
32
31
  grid_to_hexes,
33
32
  grid_to_quads,
34
33
  grid_to_tets,
35
34
  grid_to_tris,
36
35
  )
37
- from warp.sparse import bsr_zeros
36
+ from warp.sparse import bsr_set_zero, bsr_zeros
38
37
  from warp.tests.unittest_utils import *
39
38
 
40
39
  vec6f = wp.vec(length=6, dtype=float)
@@ -586,7 +585,7 @@ def _launch_test_geometry_kernel(geo: fem.Geometry, device):
586
585
  fem.interpolate(
587
586
  _test_geo_sides,
588
587
  quadrature=side_quadrature,
589
- values={"side_measures": side_measures, "ref_measure": geo.reference_side().measure()},
588
+ values={"side_measures": side_measures, "ref_measure": geo.reference_side().prototype.measure()},
590
589
  )
591
590
 
592
591
  if geo.side_normal is not None:
@@ -775,7 +774,7 @@ def _refinement_field(x: wp.vec3):
775
774
  def test_adaptive_nanogrid(test, device):
776
775
  # 3 res-1 voxels, 8 res-0 voxels
777
776
 
778
- if platform.system() == "Windows" or (device.is_cuda and wp.context.runtime.toolkit_version[0] == 11):
777
+ if platform.system() == "Windows" or (device.is_cuda and wp._src.context.runtime.toolkit_version[0] == 11):
779
778
  test.skipTest("Skipping test due to NVRTC bug on CUDA 11 and Windows")
780
779
 
781
780
  res0 = wp.array(
@@ -874,7 +873,7 @@ def test_deformed_geometry(test, device):
874
873
  np.sum(side_measures.numpy()), scale**2 * (0.5 * 6 * (N + 1) + N * 2 * math.sqrt(3.0)), places=4
875
874
  )
876
875
 
877
- @wp.kernel
876
+ @fem.cache.dynamic_kernel(suffix=deformed_geo.name, kernel_options={"enable_backward": False})
878
877
  def _test_deformed_geometry_normal(
879
878
  geo_index_arg: geo.SideIndexArg, geo_arg: geo.SideArg, def_arg: deformed_geo.SideArg, rotation: wp.vec3
880
879
  ):
@@ -926,7 +925,7 @@ def test_deformed_geometry_codimensional(test, device):
926
925
 
927
926
  deformed_geo = pos_field.make_deformed_geometry()
928
927
 
929
- @wp.kernel
928
+ @fem.cache.dynamic_kernel(suffix=deformed_geo.name, kernel_options={"enable_backward": False})
930
929
  def _test_deformed_geometry_normal_codimensional(
931
930
  geo_arg: geo.CellArg, def_arg: deformed_geo.CellArg, rotation: wp.vec3
932
931
  ):
@@ -1045,7 +1044,7 @@ def test_closest_point_queries(test, device):
1045
1044
 
1046
1045
 
1047
1046
  def test_regular_quadrature(test, device):
1048
- from warp.fem.geometry.element import LinearEdge, Polynomial, Triangle
1047
+ from warp._src.fem.geometry.element import LinearEdge, Polynomial, Triangle
1049
1048
 
1050
1049
  for family in Polynomial:
1051
1050
  # test integrating monomials
@@ -1573,7 +1572,9 @@ def test_particle_quadratures(test, device):
1573
1572
  domain = fem.Cells(geo)
1574
1573
 
1575
1574
  # Explicit quadrature
1576
- points, weights = domain.reference_element().instantiate_quadrature(order=4, family=fem.Polynomial.GAUSS_LEGENDRE)
1575
+ points, weights = domain.reference_element().prototype.instantiate_quadrature(
1576
+ order=4, family=fem.Polynomial.GAUSS_LEGENDRE
1577
+ )
1577
1578
  points_per_cell = len(points)
1578
1579
 
1579
1580
  points = points * domain.element_count()
@@ -1956,7 +1957,7 @@ def test_vector_spaces(test, device):
1956
1957
  )
1957
1958
 
1958
1959
 
1959
- @wp.kernel
1960
+ @wp.kernel(enable_backward=False)
1960
1961
  def test_qr_eigenvalues():
1961
1962
  tol = 5.0e-7
1962
1963
 
@@ -2011,7 +2012,7 @@ def test_qr_eigenvalues():
2011
2012
  wp.expect_near(wp.ddot(Err6, Err6), 0.0, 1.0e-13)
2012
2013
 
2013
2014
 
2014
- @wp.kernel
2015
+ @wp.kernel(enable_backward=False)
2015
2016
  def test_qr_inverse():
2016
2017
  rng = wp.rand_init(4356, wp.tid())
2017
2018
  M = wp.mat33(
@@ -2046,7 +2047,7 @@ def test_array_axpy(test, device):
2046
2047
 
2047
2048
  tape = wp.Tape()
2048
2049
  with tape:
2049
- fem.utils.array_axpy(x=x, y=y, alpha=alpha, beta=beta)
2050
+ fem.linalg.array_axpy(x=x, y=y, alpha=alpha, beta=beta)
2050
2051
 
2051
2052
  assert_np_equal(x.numpy(), np.full(N, 2.0))
2052
2053
  assert_np_equal(y.numpy(), alpha * x.numpy() + beta * np.arange(N))
@@ -2097,6 +2098,50 @@ def test_integrate_high_order(test_field, device):
2097
2098
  assert_np_equal(h0.values[:h0_nnz].numpy(), h1.values[:h1_nnz].numpy(), tol=1.0e-6)
2098
2099
 
2099
2100
 
2101
+ def test_capturability(test, device):
2102
+ A = bsr_zeros(0, 0, block_type=wp.float32, device=device)
2103
+
2104
+ def test_body():
2105
+ geo = fem.Grid3D(res=(4, 4, 4))
2106
+ space = fem.make_polynomial_space(geo, degree=1)
2107
+
2108
+ cell_mask = wp.zeros(geo.cell_count(), dtype=int, device=device)
2109
+ cell_mask[16:32].fill_(1)
2110
+
2111
+ geo_partition = fem.ExplicitGeometryPartition(geo, cell_mask, max_cell_count=32, max_side_count=0)
2112
+ space_partition = fem.make_space_partition(space, geo_partition, with_halo=False, max_node_count=64)
2113
+
2114
+ test_field = fem.make_test(space, space_partition=space_partition)
2115
+ trial_field = fem.make_trial(space, space_partition=space_partition)
2116
+ bsr_set_zero(
2117
+ A,
2118
+ rows_of_blocks=test_field.space_partition.node_count(),
2119
+ cols_of_blocks=trial_field.space_partition.node_count(),
2120
+ )
2121
+ fem.integrate(
2122
+ bilinear_form,
2123
+ fields={"v": test_field, "u": trial_field},
2124
+ kernel_options={"enable_backward": False},
2125
+ output=A,
2126
+ )
2127
+
2128
+ with wp.ScopedDevice(device):
2129
+ test_body()
2130
+ assert A.shape == (64, 64)
2131
+ nnz_ref = A.nnz_sync()
2132
+ values_ref = A.values.numpy()[:nnz_ref]
2133
+ columns_ref = A.columns.numpy()[:nnz_ref]
2134
+ bsr_set_zero(A)
2135
+ assert A.nnz_sync() == 0
2136
+
2137
+ with wp.ScopedCapture() as capture:
2138
+ test_body()
2139
+ wp.capture_launch(capture.graph)
2140
+ assert A.nnz_sync() == nnz_ref
2141
+ assert_np_equal(A.values.numpy()[:nnz_ref], values_ref)
2142
+ assert_np_equal(A.columns.numpy()[:nnz_ref], columns_ref)
2143
+
2144
+
2100
2145
  devices = get_test_devices()
2101
2146
  cuda_devices = get_selected_cuda_test_devices()
2102
2147
 
@@ -2152,6 +2197,7 @@ add_function_test(TestFemShapeFunctions, "test_cube_shape_functions", test_cube_
2152
2197
  add_function_test(TestFemShapeFunctions, "test_tri_shape_functions", test_tri_shape_functions)
2153
2198
  add_function_test(TestFemShapeFunctions, "test_tet_shape_functions", test_tet_shape_functions)
2154
2199
 
2200
+ add_function_test(TestFemShapeFunctions, "test_capturability", test_capturability, devices=cuda_devices)
2155
2201
 
2156
2202
  if __name__ == "__main__":
2157
2203
  wp.clear_kernel_cache()
@@ -115,7 +115,7 @@ def test_error_invalid_func_return_annotation(test, device):
115
115
  arr = func()
116
116
 
117
117
  with test.assertRaisesRegex(
118
- wp.codegen.WarpCodegenError,
118
+ wp._src.codegen.WarpCodegenError,
119
119
  r"The function `func` returns a fixed-size array whereas it has its return type annotated as `Array\[int32\]`.$",
120
120
  ):
121
121
  wp.launch(kernel, 1, device=device)
@@ -152,8 +152,8 @@ def test_capture_if_kernel():
152
152
  def test_capture_if(test, device):
153
153
  if (
154
154
  not wp.get_device(device).is_cuda
155
- or wp.context.runtime.toolkit_version < (12, 4)
156
- or wp.context.runtime.driver_version < (12, 4)
155
+ or wp._src.context.runtime.toolkit_version < (12, 4)
156
+ or wp._src.context.runtime.driver_version < (12, 4)
157
157
  ):
158
158
  return
159
159
 
warp/tests/test_func.py CHANGED
@@ -396,7 +396,7 @@ class TestFunc(unittest.TestCase):
396
396
  t = wp.transform(*wp.transform(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0))
397
397
  self.assertSequenceEqual(t, (1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0))
398
398
 
399
- transformf = wp.types.transformation(dtype=float)
399
+ transformf = wp._src.types.transformation(dtype=float)
400
400
 
401
401
  t = wp.transformf((1.0, 2.0, 3.0), (4.0, 5.0, 6.0, 7.0))
402
402
  self.assertSequenceEqual(
@@ -408,6 +408,12 @@ class TestFunc(unittest.TestCase):
408
408
  (-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0),
409
409
  )
410
410
 
411
+ with self.assertRaisesRegex(
412
+ TypeError,
413
+ r"^got an unexpected keyword argument 'pos'$",
414
+ ):
415
+ wp.transform(pos=wp.vec3(), rot=wp.quat())
416
+
411
417
  f = wp.sin(math.pi * 0.5)
412
418
  self.assertAlmostEqual(f, 1.0, places=3)
413
419
 
@@ -443,10 +449,7 @@ class TestFunc(unittest.TestCase):
443
449
  a * b
444
450
 
445
451
  def test_cpython_call_user_function_with_error(self):
446
- with self.assertRaisesRegex(
447
- ZeroDivisionError,
448
- "float division by zero",
449
- ):
452
+ with self.assertRaises(ZeroDivisionError):
450
453
  divide_by_zero(1.0)
451
454
 
452
455
  def test_cpython_call_user_function_with_wrong_argument_types(self):
@@ -521,7 +521,7 @@ def test_type_attribute_error(test, device):
521
521
  a = wp.vec3(0.0)
522
522
  _ = a.dtype.shape
523
523
 
524
- with test.assertRaisesRegex(AttributeError, r"`shape` is not an attribute of '<class 'warp.types.float32'>'"):
524
+ with test.assertRaisesRegex(AttributeError, r"`shape` is not an attribute of '<class 'warp._src.types.float32'>'"):
525
525
  wp.launch(
526
526
  kernel,
527
527
  dim=1,