warp-lang 1.8.1__py3-none-win_amd64.whl → 1.9.1__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.
- warp/__init__.py +282 -103
- warp/__init__.pyi +1904 -114
- warp/bin/warp-clang.dll +0 -0
- warp/bin/warp.dll +0 -0
- warp/build.py +93 -30
- warp/build_dll.py +331 -101
- warp/builtins.py +1244 -160
- warp/codegen.py +317 -206
- warp/config.py +1 -1
- warp/context.py +1465 -789
- warp/examples/core/example_marching_cubes.py +1 -0
- warp/examples/core/example_render_opengl.py +100 -3
- warp/examples/fem/example_apic_fluid.py +98 -52
- warp/examples/fem/example_convection_diffusion_dg.py +25 -4
- warp/examples/fem/example_diffusion_mgpu.py +8 -3
- warp/examples/fem/utils.py +68 -22
- warp/examples/interop/example_jax_kernel.py +2 -1
- warp/fabric.py +1 -1
- warp/fem/cache.py +27 -19
- warp/fem/domain.py +2 -2
- warp/fem/field/nodal_field.py +2 -2
- warp/fem/field/virtual.py +264 -166
- warp/fem/geometry/geometry.py +5 -5
- warp/fem/integrate.py +129 -51
- warp/fem/space/restriction.py +4 -0
- warp/fem/space/shape/tet_shape_function.py +3 -10
- warp/jax_experimental/custom_call.py +25 -2
- warp/jax_experimental/ffi.py +22 -1
- warp/jax_experimental/xla_ffi.py +16 -7
- warp/marching_cubes.py +708 -0
- warp/native/array.h +99 -4
- warp/native/builtin.h +86 -9
- warp/native/bvh.cpp +64 -28
- warp/native/bvh.cu +58 -58
- warp/native/bvh.h +2 -2
- warp/native/clang/clang.cpp +7 -7
- warp/native/coloring.cpp +8 -2
- warp/native/crt.cpp +2 -2
- warp/native/crt.h +3 -5
- warp/native/cuda_util.cpp +41 -10
- warp/native/cuda_util.h +10 -4
- warp/native/exports.h +1842 -1908
- warp/native/fabric.h +2 -1
- warp/native/hashgrid.cpp +37 -37
- warp/native/hashgrid.cu +2 -2
- warp/native/initializer_array.h +1 -1
- warp/native/intersect.h +2 -2
- warp/native/mat.h +1910 -116
- warp/native/mathdx.cpp +43 -43
- warp/native/mesh.cpp +24 -24
- warp/native/mesh.cu +26 -26
- warp/native/mesh.h +4 -2
- warp/native/nanovdb/GridHandle.h +179 -12
- warp/native/nanovdb/HostBuffer.h +8 -7
- warp/native/nanovdb/NanoVDB.h +517 -895
- warp/native/nanovdb/NodeManager.h +323 -0
- warp/native/nanovdb/PNanoVDB.h +2 -2
- warp/native/quat.h +331 -14
- warp/native/range.h +7 -1
- warp/native/reduce.cpp +10 -10
- warp/native/reduce.cu +13 -14
- warp/native/runlength_encode.cpp +2 -2
- warp/native/runlength_encode.cu +5 -5
- warp/native/scan.cpp +3 -3
- warp/native/scan.cu +4 -4
- warp/native/sort.cpp +10 -10
- warp/native/sort.cu +40 -31
- warp/native/sort.h +2 -0
- warp/native/sparse.cpp +8 -8
- warp/native/sparse.cu +13 -13
- warp/native/spatial.h +366 -17
- warp/native/temp_buffer.h +2 -2
- warp/native/tile.h +471 -82
- warp/native/vec.h +328 -14
- warp/native/volume.cpp +54 -54
- warp/native/volume.cu +1 -1
- warp/native/volume.h +2 -1
- warp/native/volume_builder.cu +30 -37
- warp/native/warp.cpp +150 -149
- warp/native/warp.cu +377 -216
- warp/native/warp.h +227 -226
- warp/optim/linear.py +736 -271
- warp/render/imgui_manager.py +289 -0
- warp/render/render_opengl.py +99 -18
- warp/render/render_usd.py +1 -0
- warp/sim/graph_coloring.py +2 -2
- warp/sparse.py +558 -175
- warp/tests/aux_test_module_aot.py +7 -0
- warp/tests/cuda/test_async.py +3 -3
- warp/tests/cuda/test_conditional_captures.py +101 -0
- warp/tests/geometry/test_hash_grid.py +38 -0
- warp/tests/geometry/test_marching_cubes.py +233 -12
- warp/tests/interop/test_jax.py +608 -28
- warp/tests/sim/test_coloring.py +6 -6
- warp/tests/test_array.py +58 -5
- warp/tests/test_codegen.py +4 -3
- warp/tests/test_context.py +8 -15
- warp/tests/test_enum.py +136 -0
- warp/tests/test_examples.py +2 -2
- warp/tests/test_fem.py +49 -6
- warp/tests/test_fixedarray.py +229 -0
- warp/tests/test_func.py +18 -15
- warp/tests/test_future_annotations.py +7 -5
- warp/tests/test_linear_solvers.py +30 -0
- warp/tests/test_map.py +15 -1
- warp/tests/test_mat.py +1518 -378
- warp/tests/test_mat_assign_copy.py +178 -0
- warp/tests/test_mat_constructors.py +574 -0
- warp/tests/test_module_aot.py +287 -0
- warp/tests/test_print.py +69 -0
- warp/tests/test_quat.py +140 -34
- warp/tests/test_quat_assign_copy.py +145 -0
- warp/tests/test_reload.py +2 -1
- warp/tests/test_sparse.py +71 -0
- warp/tests/test_spatial.py +140 -34
- warp/tests/test_spatial_assign_copy.py +160 -0
- warp/tests/test_struct.py +43 -3
- warp/tests/test_tuple.py +96 -0
- warp/tests/test_types.py +61 -20
- warp/tests/test_vec.py +179 -34
- warp/tests/test_vec_assign_copy.py +143 -0
- warp/tests/tile/test_tile.py +245 -18
- warp/tests/tile/test_tile_cholesky.py +605 -0
- warp/tests/tile/test_tile_load.py +169 -0
- warp/tests/tile/test_tile_mathdx.py +2 -558
- warp/tests/tile/test_tile_matmul.py +1 -1
- warp/tests/tile/test_tile_mlp.py +1 -1
- warp/tests/tile/test_tile_shared_memory.py +5 -5
- warp/tests/unittest_suites.py +6 -0
- warp/tests/walkthrough_debug.py +1 -1
- warp/thirdparty/unittest_parallel.py +108 -9
- warp/types.py +571 -267
- warp/utils.py +68 -86
- {warp_lang-1.8.1.dist-info → warp_lang-1.9.1.dist-info}/METADATA +29 -69
- {warp_lang-1.8.1.dist-info → warp_lang-1.9.1.dist-info}/RECORD +138 -128
- warp/native/marching.cpp +0 -19
- warp/native/marching.cu +0 -514
- warp/native/marching.h +0 -19
- {warp_lang-1.8.1.dist-info → warp_lang-1.9.1.dist-info}/WHEEL +0 -0
- {warp_lang-1.8.1.dist-info → warp_lang-1.9.1.dist-info}/licenses/LICENSE.md +0 -0
- {warp_lang-1.8.1.dist-info → warp_lang-1.9.1.dist-info}/top_level.txt +0 -0
warp/native/fabric.h
CHANGED
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
|
|
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*)
|
|
78
|
-
grid->cell_ends = (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
|
|
83
|
+
void wp_hash_grid_destroy_host(uint64_t id)
|
|
84
84
|
{
|
|
85
85
|
HashGrid* grid = (HashGrid*)(id);
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
|
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
|
-
|
|
102
|
-
|
|
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*)
|
|
106
|
-
grid->point_ids = (int*)
|
|
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
|
|
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
|
-
|
|
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
|
|
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 :
|
|
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*)
|
|
194
|
-
grid.cell_ends = (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*)(
|
|
198
|
-
|
|
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
|
|
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
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
236
|
-
|
|
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*)
|
|
240
|
-
grid.point_ids = (int*)
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
81
|
-
|
|
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
|
}
|
warp/native/initializer_array.h
CHANGED
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
|
-
|
|
267
|
+
return *reinterpret_cast<float*>(&i);
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
inline int __float_as_int(float f)
|
|
271
271
|
{
|
|
272
|
-
|
|
272
|
+
return *reinterpret_cast<int*>(&f);
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
#endif
|