warp-lang 1.8.1__py3-none-manylinux_2_34_aarch64.whl → 1.9.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 (141) hide show
  1. warp/__init__.py +282 -103
  2. warp/__init__.pyi +1904 -114
  3. warp/bin/warp-clang.so +0 -0
  4. warp/bin/warp.so +0 -0
  5. warp/build.py +93 -30
  6. warp/build_dll.py +331 -101
  7. warp/builtins.py +1244 -160
  8. warp/codegen.py +317 -206
  9. warp/config.py +1 -1
  10. warp/context.py +1465 -789
  11. warp/examples/core/example_marching_cubes.py +1 -0
  12. warp/examples/core/example_render_opengl.py +100 -3
  13. warp/examples/fem/example_apic_fluid.py +98 -52
  14. warp/examples/fem/example_convection_diffusion_dg.py +25 -4
  15. warp/examples/fem/example_diffusion_mgpu.py +8 -3
  16. warp/examples/fem/utils.py +68 -22
  17. warp/examples/interop/example_jax_kernel.py +2 -1
  18. warp/fabric.py +1 -1
  19. warp/fem/cache.py +27 -19
  20. warp/fem/domain.py +2 -2
  21. warp/fem/field/nodal_field.py +2 -2
  22. warp/fem/field/virtual.py +264 -166
  23. warp/fem/geometry/geometry.py +5 -5
  24. warp/fem/integrate.py +129 -51
  25. warp/fem/space/restriction.py +4 -0
  26. warp/fem/space/shape/tet_shape_function.py +3 -10
  27. warp/jax_experimental/custom_call.py +25 -2
  28. warp/jax_experimental/ffi.py +22 -1
  29. warp/jax_experimental/xla_ffi.py +16 -7
  30. warp/marching_cubes.py +708 -0
  31. warp/native/array.h +99 -4
  32. warp/native/builtin.h +86 -9
  33. warp/native/bvh.cpp +64 -28
  34. warp/native/bvh.cu +58 -58
  35. warp/native/bvh.h +2 -2
  36. warp/native/clang/clang.cpp +7 -7
  37. warp/native/coloring.cpp +8 -2
  38. warp/native/crt.cpp +2 -2
  39. warp/native/crt.h +3 -5
  40. warp/native/cuda_util.cpp +41 -10
  41. warp/native/cuda_util.h +10 -4
  42. warp/native/exports.h +1842 -1908
  43. warp/native/fabric.h +2 -1
  44. warp/native/hashgrid.cpp +37 -37
  45. warp/native/hashgrid.cu +2 -2
  46. warp/native/initializer_array.h +1 -1
  47. warp/native/intersect.h +2 -2
  48. warp/native/mat.h +1910 -116
  49. warp/native/mathdx.cpp +43 -43
  50. warp/native/mesh.cpp +24 -24
  51. warp/native/mesh.cu +26 -26
  52. warp/native/mesh.h +4 -2
  53. warp/native/nanovdb/GridHandle.h +179 -12
  54. warp/native/nanovdb/HostBuffer.h +8 -7
  55. warp/native/nanovdb/NanoVDB.h +517 -895
  56. warp/native/nanovdb/NodeManager.h +323 -0
  57. warp/native/nanovdb/PNanoVDB.h +2 -2
  58. warp/native/quat.h +331 -14
  59. warp/native/range.h +7 -1
  60. warp/native/reduce.cpp +10 -10
  61. warp/native/reduce.cu +13 -14
  62. warp/native/runlength_encode.cpp +2 -2
  63. warp/native/runlength_encode.cu +5 -5
  64. warp/native/scan.cpp +3 -3
  65. warp/native/scan.cu +4 -4
  66. warp/native/sort.cpp +10 -10
  67. warp/native/sort.cu +40 -31
  68. warp/native/sort.h +2 -0
  69. warp/native/sparse.cpp +8 -8
  70. warp/native/sparse.cu +13 -13
  71. warp/native/spatial.h +366 -17
  72. warp/native/temp_buffer.h +2 -2
  73. warp/native/tile.h +471 -82
  74. warp/native/vec.h +328 -14
  75. warp/native/volume.cpp +54 -54
  76. warp/native/volume.cu +1 -1
  77. warp/native/volume.h +2 -1
  78. warp/native/volume_builder.cu +30 -37
  79. warp/native/warp.cpp +150 -149
  80. warp/native/warp.cu +377 -216
  81. warp/native/warp.h +227 -226
  82. warp/optim/linear.py +736 -271
  83. warp/render/imgui_manager.py +289 -0
  84. warp/render/render_opengl.py +99 -18
  85. warp/render/render_usd.py +1 -0
  86. warp/sim/graph_coloring.py +2 -2
  87. warp/sparse.py +558 -175
  88. warp/tests/aux_test_module_aot.py +7 -0
  89. warp/tests/cuda/test_async.py +3 -3
  90. warp/tests/cuda/test_conditional_captures.py +101 -0
  91. warp/tests/geometry/test_hash_grid.py +38 -0
  92. warp/tests/geometry/test_marching_cubes.py +233 -12
  93. warp/tests/interop/test_jax.py +608 -28
  94. warp/tests/sim/test_coloring.py +6 -6
  95. warp/tests/test_array.py +58 -5
  96. warp/tests/test_codegen.py +4 -3
  97. warp/tests/test_context.py +8 -15
  98. warp/tests/test_enum.py +136 -0
  99. warp/tests/test_examples.py +2 -2
  100. warp/tests/test_fem.py +49 -6
  101. warp/tests/test_fixedarray.py +229 -0
  102. warp/tests/test_func.py +18 -15
  103. warp/tests/test_future_annotations.py +7 -5
  104. warp/tests/test_linear_solvers.py +30 -0
  105. warp/tests/test_map.py +15 -1
  106. warp/tests/test_mat.py +1518 -378
  107. warp/tests/test_mat_assign_copy.py +178 -0
  108. warp/tests/test_mat_constructors.py +574 -0
  109. warp/tests/test_module_aot.py +287 -0
  110. warp/tests/test_print.py +69 -0
  111. warp/tests/test_quat.py +140 -34
  112. warp/tests/test_quat_assign_copy.py +145 -0
  113. warp/tests/test_reload.py +2 -1
  114. warp/tests/test_sparse.py +71 -0
  115. warp/tests/test_spatial.py +140 -34
  116. warp/tests/test_spatial_assign_copy.py +160 -0
  117. warp/tests/test_struct.py +43 -3
  118. warp/tests/test_tuple.py +96 -0
  119. warp/tests/test_types.py +61 -20
  120. warp/tests/test_vec.py +179 -34
  121. warp/tests/test_vec_assign_copy.py +143 -0
  122. warp/tests/tile/test_tile.py +245 -18
  123. warp/tests/tile/test_tile_cholesky.py +605 -0
  124. warp/tests/tile/test_tile_load.py +169 -0
  125. warp/tests/tile/test_tile_mathdx.py +2 -558
  126. warp/tests/tile/test_tile_matmul.py +1 -1
  127. warp/tests/tile/test_tile_mlp.py +1 -1
  128. warp/tests/tile/test_tile_shared_memory.py +5 -5
  129. warp/tests/unittest_suites.py +6 -0
  130. warp/tests/walkthrough_debug.py +1 -1
  131. warp/thirdparty/unittest_parallel.py +108 -9
  132. warp/types.py +571 -267
  133. warp/utils.py +68 -86
  134. {warp_lang-1.8.1.dist-info → warp_lang-1.9.1.dist-info}/METADATA +29 -69
  135. {warp_lang-1.8.1.dist-info → warp_lang-1.9.1.dist-info}/RECORD +138 -128
  136. warp/native/marching.cpp +0 -19
  137. warp/native/marching.cu +0 -514
  138. warp/native/marching.h +0 -19
  139. {warp_lang-1.8.1.dist-info → warp_lang-1.9.1.dist-info}/WHEEL +0 -0
  140. {warp_lang-1.8.1.dist-info → warp_lang-1.9.1.dist-info}/licenses/LICENSE.md +0 -0
  141. {warp_lang-1.8.1.dist-info → warp_lang-1.9.1.dist-info}/top_level.txt +0 -0
warp/native/fabric.h CHANGED
@@ -35,7 +35,8 @@ template <typename T>
35
35
  struct fabricarray_t
36
36
  {
37
37
  CUDA_CALLABLE inline fabricarray_t()
38
- : nbuckets(0),
38
+ : buckets(nullptr),
39
+ nbuckets(0),
39
40
  size(0)
40
41
  {}
41
42
 
warp/native/hashgrid.cpp CHANGED
@@ -64,7 +64,7 @@ void hash_grid_rebuild_device(const HashGrid& grid, const wp::array_t<wp::vec3>&
64
64
 
65
65
 
66
66
  // host methods
67
- uint64_t hash_grid_create_host(int dim_x, int dim_y, int dim_z)
67
+ uint64_t wp_hash_grid_create_host(int dim_x, int dim_y, int dim_z)
68
68
  {
69
69
  HashGrid* grid = new HashGrid();
70
70
  memset(grid, 0, sizeof(HashGrid));
@@ -74,36 +74,36 @@ uint64_t hash_grid_create_host(int dim_x, int dim_y, int dim_z)
74
74
  grid->dim_z = dim_z;
75
75
 
76
76
  const int num_cells = dim_x*dim_y*dim_z;
77
- grid->cell_starts = (int*)alloc_host(num_cells*sizeof(int));
78
- grid->cell_ends = (int*)alloc_host(num_cells*sizeof(int));
77
+ grid->cell_starts = (int*)wp_alloc_host(num_cells*sizeof(int));
78
+ grid->cell_ends = (int*)wp_alloc_host(num_cells*sizeof(int));
79
79
 
80
80
  return (uint64_t)(grid);
81
81
  }
82
82
 
83
- void hash_grid_destroy_host(uint64_t id)
83
+ void wp_hash_grid_destroy_host(uint64_t id)
84
84
  {
85
85
  HashGrid* grid = (HashGrid*)(id);
86
86
 
87
- free_host(grid->point_ids);
88
- free_host(grid->point_cells);
89
- free_host(grid->cell_starts);
90
- free_host(grid->cell_ends);
87
+ wp_free_host(grid->point_ids);
88
+ wp_free_host(grid->point_cells);
89
+ wp_free_host(grid->cell_starts);
90
+ wp_free_host(grid->cell_ends);
91
91
 
92
92
  delete grid;
93
93
  }
94
94
 
95
- void hash_grid_reserve_host(uint64_t id, int num_points)
95
+ void wp_hash_grid_reserve_host(uint64_t id, int num_points)
96
96
  {
97
97
  HashGrid* grid = (HashGrid*)(id);
98
98
 
99
99
  if (num_points > grid->max_points)
100
100
  {
101
- free_host(grid->point_cells);
102
- free_host(grid->point_ids);
101
+ wp_free_host(grid->point_cells);
102
+ wp_free_host(grid->point_ids);
103
103
 
104
104
  const int num_to_alloc = num_points*3/2;
105
- grid->point_cells = (int*)alloc_host(2*num_to_alloc*sizeof(int)); // *2 for auxiliary radix buffers
106
- grid->point_ids = (int*)alloc_host(2*num_to_alloc*sizeof(int)); // *2 for auxiliary radix buffers
105
+ grid->point_cells = (int*)wp_alloc_host(2*num_to_alloc*sizeof(int)); // *2 for auxiliary radix buffers
106
+ grid->point_ids = (int*)wp_alloc_host(2*num_to_alloc*sizeof(int)); // *2 for auxiliary radix buffers
107
107
 
108
108
  grid->max_points = num_to_alloc;
109
109
  }
@@ -111,7 +111,7 @@ void hash_grid_reserve_host(uint64_t id, int num_points)
111
111
  grid->num_points = num_points;
112
112
  }
113
113
 
114
- void hash_grid_update_host(uint64_t id, float cell_width, const wp::array_t<wp::vec3>* points)
114
+ void wp_hash_grid_update_host(uint64_t id, float cell_width, const wp::array_t<wp::vec3>* points)
115
115
  {
116
116
  // Python enforces this, but let's be defensive anyways
117
117
  if (!points || points->ndim != 1)
@@ -129,7 +129,7 @@ void hash_grid_update_host(uint64_t id, float cell_width, const wp::array_t<wp::
129
129
  HashGrid* grid = (HashGrid*)(id);
130
130
  int num_points = points->shape[0];
131
131
 
132
- hash_grid_reserve_host(id, num_points);
132
+ wp_hash_grid_reserve_host(id, num_points);
133
133
 
134
134
  grid->cell_width = cell_width;
135
135
  grid->cell_width_inv = 1.0f / cell_width;
@@ -176,26 +176,26 @@ void hash_grid_update_host(uint64_t id, float cell_width, const wp::array_t<wp::
176
176
  }
177
177
 
178
178
  // device methods
179
- uint64_t hash_grid_create_device(void* context, int dim_x, int dim_y, int dim_z)
179
+ uint64_t wp_hash_grid_create_device(void* context, int dim_x, int dim_y, int dim_z)
180
180
  {
181
181
  ContextGuard guard(context);
182
182
 
183
183
  HashGrid grid;
184
184
  memset(&grid, 0, sizeof(HashGrid));
185
185
 
186
- grid.context = context ? context : cuda_context_get_current();
186
+ grid.context = context ? context : wp_cuda_context_get_current();
187
187
 
188
188
  grid.dim_x = dim_x;
189
189
  grid.dim_y = dim_y;
190
190
  grid.dim_z = dim_z;
191
191
 
192
192
  const int num_cells = dim_x*dim_y*dim_z;
193
- grid.cell_starts = (int*)alloc_device(WP_CURRENT_CONTEXT, num_cells*sizeof(int));
194
- grid.cell_ends = (int*)alloc_device(WP_CURRENT_CONTEXT, num_cells*sizeof(int));
193
+ grid.cell_starts = (int*)wp_alloc_device(WP_CURRENT_CONTEXT, num_cells*sizeof(int));
194
+ grid.cell_ends = (int*)wp_alloc_device(WP_CURRENT_CONTEXT, num_cells*sizeof(int));
195
195
 
196
196
  // upload to device
197
- HashGrid* grid_device = (HashGrid*)(alloc_device(WP_CURRENT_CONTEXT, sizeof(HashGrid)));
198
- memcpy_h2d(WP_CURRENT_CONTEXT, grid_device, &grid, sizeof(HashGrid));
197
+ HashGrid* grid_device = (HashGrid*)(wp_alloc_device(WP_CURRENT_CONTEXT, sizeof(HashGrid)));
198
+ wp_memcpy_h2d(WP_CURRENT_CONTEXT, grid_device, &grid, sizeof(HashGrid));
199
199
 
200
200
  uint64_t grid_id = (uint64_t)(grid_device);
201
201
  hash_grid_add_descriptor(grid_id, grid);
@@ -203,26 +203,26 @@ uint64_t hash_grid_create_device(void* context, int dim_x, int dim_y, int dim_z)
203
203
  return grid_id;
204
204
  }
205
205
 
206
- void hash_grid_destroy_device(uint64_t id)
206
+ void wp_hash_grid_destroy_device(uint64_t id)
207
207
  {
208
208
  HashGrid grid;
209
209
  if (hash_grid_get_descriptor(id, grid))
210
210
  {
211
211
  ContextGuard guard(grid.context);
212
212
 
213
- free_device(WP_CURRENT_CONTEXT, grid.point_ids);
214
- free_device(WP_CURRENT_CONTEXT, grid.point_cells);
215
- free_device(WP_CURRENT_CONTEXT, grid.cell_starts);
216
- free_device(WP_CURRENT_CONTEXT, grid.cell_ends);
213
+ wp_free_device(WP_CURRENT_CONTEXT, grid.point_ids);
214
+ wp_free_device(WP_CURRENT_CONTEXT, grid.point_cells);
215
+ wp_free_device(WP_CURRENT_CONTEXT, grid.cell_starts);
216
+ wp_free_device(WP_CURRENT_CONTEXT, grid.cell_ends);
217
217
 
218
- free_device(WP_CURRENT_CONTEXT, (HashGrid*)id);
218
+ wp_free_device(WP_CURRENT_CONTEXT, (HashGrid*)id);
219
219
 
220
220
  hash_grid_rem_descriptor(id);
221
221
  }
222
222
  }
223
223
 
224
224
 
225
- void hash_grid_reserve_device(uint64_t id, int num_points)
225
+ void wp_hash_grid_reserve_device(uint64_t id, int num_points)
226
226
  {
227
227
  HashGrid grid;
228
228
 
@@ -232,12 +232,12 @@ void hash_grid_reserve_device(uint64_t id, int num_points)
232
232
  {
233
233
  ContextGuard guard(grid.context);
234
234
 
235
- free_device(WP_CURRENT_CONTEXT, grid.point_cells);
236
- free_device(WP_CURRENT_CONTEXT, grid.point_ids);
235
+ wp_free_device(WP_CURRENT_CONTEXT, grid.point_cells);
236
+ wp_free_device(WP_CURRENT_CONTEXT, grid.point_ids);
237
237
 
238
238
  const int num_to_alloc = num_points*3/2;
239
- grid.point_cells = (int*)alloc_device(WP_CURRENT_CONTEXT, 2*num_to_alloc*sizeof(int)); // *2 for auxiliary radix buffers
240
- grid.point_ids = (int*)alloc_device(WP_CURRENT_CONTEXT, 2*num_to_alloc*sizeof(int)); // *2 for auxiliary radix buffers
239
+ grid.point_cells = (int*)wp_alloc_device(WP_CURRENT_CONTEXT, 2*num_to_alloc*sizeof(int)); // *2 for auxiliary radix buffers
240
+ grid.point_ids = (int*)wp_alloc_device(WP_CURRENT_CONTEXT, 2*num_to_alloc*sizeof(int)); // *2 for auxiliary radix buffers
241
241
  grid.max_points = num_to_alloc;
242
242
 
243
243
  // ensure we pre-size our sort routine to avoid
@@ -246,10 +246,10 @@ void hash_grid_reserve_device(uint64_t id, int num_points)
246
246
 
247
247
  // update device side grid descriptor, todo: this is
248
248
  // slightly redundant since it is performed again
249
- // inside hash_grid_update_device(), but since
249
+ // inside wp_hash_grid_update_device(), but since
250
250
  // reserve can be called from Python we need to make
251
251
  // sure it is consistent
252
- memcpy_h2d(WP_CURRENT_CONTEXT, (HashGrid*)id, &grid, sizeof(HashGrid));
252
+ wp_memcpy_h2d(WP_CURRENT_CONTEXT, (HashGrid*)id, &grid, sizeof(HashGrid));
253
253
 
254
254
  // update host side grid descriptor
255
255
  hash_grid_add_descriptor(id, grid);
@@ -257,7 +257,7 @@ void hash_grid_reserve_device(uint64_t id, int num_points)
257
257
  }
258
258
  }
259
259
 
260
- void hash_grid_update_device(uint64_t id, float cell_width, const wp::array_t<wp::vec3>* points)
260
+ void wp_hash_grid_update_device(uint64_t id, float cell_width, const wp::array_t<wp::vec3>* points)
261
261
  {
262
262
  // Python enforces this, but let's be defensive anyways
263
263
  if (!points || points->ndim != 1)
@@ -271,7 +271,7 @@ void hash_grid_update_device(uint64_t id, float cell_width, const wp::array_t<wp
271
271
  // ensure we have enough memory reserved for update
272
272
  // this must be done before retrieving the descriptor
273
273
  // below since it may update it
274
- hash_grid_reserve_device(id, num_points);
274
+ wp_hash_grid_reserve_device(id, num_points);
275
275
 
276
276
  // host grid must be static so that we can
277
277
  // perform host->device memcpy from this variable
@@ -289,7 +289,7 @@ void hash_grid_update_device(uint64_t id, float cell_width, const wp::array_t<wp
289
289
  hash_grid_rebuild_device(grid, *points);
290
290
 
291
291
  // update device side grid descriptor
292
- memcpy_h2d(WP_CURRENT_CONTEXT, (HashGrid*)id, &grid, sizeof(HashGrid));
292
+ wp_memcpy_h2d(WP_CURRENT_CONTEXT, (HashGrid*)id, &grid, sizeof(HashGrid));
293
293
 
294
294
  // update host side grid descriptor
295
295
  hash_grid_add_descriptor(id, grid);
warp/native/hashgrid.cu CHANGED
@@ -77,8 +77,8 @@ void hash_grid_rebuild_device(const wp::HashGrid& grid, const wp::array_t<wp::ve
77
77
 
78
78
  const int num_cells = grid.dim_x * grid.dim_y * grid.dim_z;
79
79
 
80
- memset_device(WP_CURRENT_CONTEXT, grid.cell_starts, 0, sizeof(int) * num_cells);
81
- memset_device(WP_CURRENT_CONTEXT, grid.cell_ends, 0, sizeof(int) * num_cells);
80
+ wp_memset_device(WP_CURRENT_CONTEXT, grid.cell_starts, 0, sizeof(int) * num_cells);
81
+ wp_memset_device(WP_CURRENT_CONTEXT, grid.cell_ends, 0, sizeof(int) * num_cells);
82
82
 
83
83
  wp_launch_device(WP_CURRENT_CONTEXT, wp::compute_cell_offsets, num_points, (grid.cell_starts, grid.cell_ends, grid.point_cells, num_points));
84
84
  }
@@ -25,7 +25,7 @@ namespace wp {
25
25
  template<unsigned Length, typename Type>
26
26
  struct initializer_array
27
27
  {
28
- const Type storage[Length];
28
+ const Type storage[Length < 1 ? 1 : Length];
29
29
 
30
30
  CUDA_CALLABLE const Type operator[](unsigned i)
31
31
  {
warp/native/intersect.h CHANGED
@@ -264,12 +264,12 @@ CUDA_CALLABLE inline bool intersect_ray_tri_rtcd(const vec3& p, const vec3& dir,
264
264
  // these are provided as built-ins by CUDA
265
265
  inline float __int_as_float(int i)
266
266
  {
267
- return *(float*)(&i);
267
+ return *reinterpret_cast<float*>(&i);
268
268
  }
269
269
 
270
270
  inline int __float_as_int(float f)
271
271
  {
272
- return *(int*)(&f);
272
+ return *reinterpret_cast<int*>(&f);
273
273
  }
274
274
 
275
275
  #endif