warp-lang 1.5.0__py3-none-macosx_10_13_universal2.whl → 1.6.0__py3-none-macosx_10_13_universal2.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 +5 -0
- warp/autograd.py +414 -191
- warp/bin/libwarp-clang.dylib +0 -0
- warp/bin/libwarp.dylib +0 -0
- warp/build.py +40 -12
- warp/build_dll.py +13 -6
- warp/builtins.py +1124 -497
- warp/codegen.py +261 -136
- warp/config.py +1 -1
- warp/context.py +357 -119
- warp/examples/assets/square_cloth.usd +0 -0
- warp/examples/benchmarks/benchmark_gemm.py +27 -18
- warp/examples/benchmarks/benchmark_interop_paddle.py +3 -3
- warp/examples/benchmarks/benchmark_interop_torch.py +3 -3
- warp/examples/core/example_torch.py +18 -34
- warp/examples/fem/example_apic_fluid.py +1 -0
- warp/examples/fem/example_mixed_elasticity.py +1 -1
- warp/examples/optim/example_bounce.py +1 -1
- warp/examples/optim/example_cloth_throw.py +1 -1
- warp/examples/optim/example_diffray.py +4 -15
- warp/examples/optim/example_drone.py +1 -1
- warp/examples/optim/example_softbody_properties.py +392 -0
- warp/examples/optim/example_trajectory.py +1 -3
- warp/examples/optim/example_walker.py +5 -0
- warp/examples/sim/example_cartpole.py +0 -2
- warp/examples/sim/example_cloth.py +3 -1
- warp/examples/sim/example_cloth_self_contact.py +260 -0
- warp/examples/sim/example_granular_collision_sdf.py +4 -5
- warp/examples/sim/example_jacobian_ik.py +0 -2
- warp/examples/sim/example_quadruped.py +5 -2
- warp/examples/tile/example_tile_cholesky.py +79 -0
- warp/examples/tile/example_tile_convolution.py +2 -2
- warp/examples/tile/example_tile_fft.py +2 -2
- warp/examples/tile/example_tile_filtering.py +3 -3
- warp/examples/tile/example_tile_matmul.py +4 -4
- warp/examples/tile/example_tile_mlp.py +12 -12
- warp/examples/tile/example_tile_nbody.py +180 -0
- warp/examples/tile/example_tile_walker.py +319 -0
- warp/fem/geometry/geometry.py +0 -2
- warp/math.py +147 -0
- warp/native/array.h +12 -0
- warp/native/builtin.h +0 -1
- warp/native/bvh.cpp +149 -70
- warp/native/bvh.cu +287 -68
- warp/native/bvh.h +195 -85
- warp/native/clang/clang.cpp +5 -1
- warp/native/coloring.cpp +5 -1
- warp/native/cuda_util.cpp +91 -53
- warp/native/cuda_util.h +5 -0
- warp/native/exports.h +40 -40
- warp/native/intersect.h +17 -0
- warp/native/mat.h +41 -0
- warp/native/mathdx.cpp +19 -0
- warp/native/mesh.cpp +25 -8
- warp/native/mesh.cu +153 -101
- warp/native/mesh.h +482 -403
- warp/native/quat.h +40 -0
- warp/native/solid_angle.h +7 -0
- warp/native/sort.cpp +85 -0
- warp/native/sort.cu +34 -0
- warp/native/sort.h +3 -1
- warp/native/spatial.h +11 -0
- warp/native/tile.h +1187 -669
- warp/native/tile_reduce.h +8 -6
- warp/native/vec.h +41 -0
- warp/native/warp.cpp +8 -1
- warp/native/warp.cu +263 -40
- warp/native/warp.h +19 -5
- warp/optim/linear.py +22 -4
- warp/render/render_opengl.py +130 -64
- warp/sim/__init__.py +6 -1
- warp/sim/collide.py +270 -26
- warp/sim/import_urdf.py +8 -8
- warp/sim/integrator_euler.py +25 -7
- warp/sim/integrator_featherstone.py +154 -35
- warp/sim/integrator_vbd.py +842 -40
- warp/sim/model.py +134 -72
- warp/sparse.py +1 -1
- warp/stubs.py +265 -132
- warp/tape.py +28 -30
- warp/tests/aux_test_module_unload.py +15 -0
- warp/tests/{test_sim_grad.py → flaky_test_sim_grad.py} +104 -63
- warp/tests/test_array.py +74 -0
- warp/tests/test_assert.py +242 -0
- warp/tests/test_codegen.py +14 -61
- warp/tests/test_collision.py +2 -2
- warp/tests/test_coloring.py +12 -2
- warp/tests/test_examples.py +12 -1
- warp/tests/test_func.py +21 -4
- warp/tests/test_grad_debug.py +87 -2
- warp/tests/test_hash_grid.py +1 -1
- warp/tests/test_ipc.py +116 -0
- warp/tests/test_lerp.py +13 -87
- warp/tests/test_mat.py +138 -167
- warp/tests/test_math.py +47 -1
- warp/tests/test_matmul.py +17 -16
- warp/tests/test_matmul_lite.py +10 -15
- warp/tests/test_mesh.py +84 -60
- warp/tests/test_mesh_query_aabb.py +165 -0
- warp/tests/test_mesh_query_point.py +328 -286
- warp/tests/test_mesh_query_ray.py +134 -121
- warp/tests/test_mlp.py +2 -2
- warp/tests/test_operators.py +43 -0
- warp/tests/test_overwrite.py +47 -2
- warp/tests/test_quat.py +77 -0
- warp/tests/test_reload.py +29 -0
- warp/tests/test_sim_grad_bounce_linear.py +204 -0
- warp/tests/test_smoothstep.py +17 -83
- warp/tests/test_static.py +19 -3
- warp/tests/test_tape.py +25 -0
- warp/tests/test_tile.py +178 -191
- warp/tests/test_tile_load.py +356 -0
- warp/tests/test_tile_mathdx.py +61 -8
- warp/tests/test_tile_mlp.py +17 -17
- warp/tests/test_tile_reduce.py +24 -18
- warp/tests/test_tile_shared_memory.py +66 -17
- warp/tests/test_tile_view.py +165 -0
- warp/tests/test_torch.py +35 -0
- warp/tests/test_utils.py +36 -24
- warp/tests/test_vec.py +110 -0
- warp/tests/unittest_suites.py +29 -4
- warp/tests/unittest_utils.py +30 -13
- warp/thirdparty/unittest_parallel.py +2 -2
- warp/types.py +411 -101
- warp/utils.py +10 -7
- {warp_lang-1.5.0.dist-info → warp_lang-1.6.0.dist-info}/METADATA +92 -69
- {warp_lang-1.5.0.dist-info → warp_lang-1.6.0.dist-info}/RECORD +130 -119
- {warp_lang-1.5.0.dist-info → warp_lang-1.6.0.dist-info}/WHEEL +1 -1
- warp/examples/benchmarks/benchmark_tile.py +0 -179
- warp/native/tile_gemm.h +0 -341
- {warp_lang-1.5.0.dist-info → warp_lang-1.6.0.dist-info}/LICENSE.md +0 -0
- {warp_lang-1.5.0.dist-info → warp_lang-1.6.0.dist-info}/top_level.txt +0 -0
warp/tests/unittest_suites.py
CHANGED
|
@@ -167,7 +167,8 @@ def default_suite(test_loader: unittest.TestLoader = unittest.defaultTestLoader)
|
|
|
167
167
|
from warp.tests.test_rounding import TestRounding
|
|
168
168
|
from warp.tests.test_runlength_encode import TestRunlengthEncode
|
|
169
169
|
from warp.tests.test_scalar_ops import TestScalarOps
|
|
170
|
-
|
|
170
|
+
|
|
171
|
+
# from warp.tests.test_sim_grad import TestSimGradients Disabled, flaky
|
|
171
172
|
from warp.tests.test_sim_kinematics import TestSimKinematics
|
|
172
173
|
from warp.tests.test_smoothstep import TestSmoothstep
|
|
173
174
|
from warp.tests.test_snippet import TestSnippets
|
|
@@ -276,7 +277,7 @@ def default_suite(test_loader: unittest.TestLoader = unittest.defaultTestLoader)
|
|
|
276
277
|
TestRounding,
|
|
277
278
|
TestRunlengthEncode,
|
|
278
279
|
TestScalarOps,
|
|
279
|
-
TestSimGradients,
|
|
280
|
+
# TestSimGradients, Disabled, flaky
|
|
280
281
|
TestSimKinematics,
|
|
281
282
|
TestSmoothstep,
|
|
282
283
|
TestSnippets,
|
|
@@ -315,15 +316,18 @@ def kit_suite(test_loader: unittest.TestLoader = unittest.defaultTestLoader):
|
|
|
315
316
|
"""
|
|
316
317
|
from warp.tests.test_array import TestArray
|
|
317
318
|
from warp.tests.test_array_reduce import TestArrayReduce
|
|
319
|
+
from warp.tests.test_bool import TestBool
|
|
320
|
+
from warp.tests.test_builtins_resolution import TestBuiltinsResolution
|
|
318
321
|
from warp.tests.test_bvh import TestBvh
|
|
319
322
|
from warp.tests.test_codegen import TestCodeGen
|
|
320
|
-
from warp.tests.test_codegen_instancing import TestCodeGenInstancing
|
|
321
323
|
from warp.tests.test_compile_consts import TestConstants
|
|
322
324
|
from warp.tests.test_conditional import TestConditional
|
|
325
|
+
from warp.tests.test_copy import TestCopy
|
|
323
326
|
from warp.tests.test_ctypes import TestCTypes
|
|
324
327
|
from warp.tests.test_devices import TestDevices
|
|
325
328
|
from warp.tests.test_dlpack import TestDLPack
|
|
326
329
|
from warp.tests.test_fabricarray import TestFabricArray
|
|
330
|
+
from warp.tests.test_fp16 import TestFp16
|
|
327
331
|
from warp.tests.test_func import TestFunc
|
|
328
332
|
from warp.tests.test_generics import TestGenerics
|
|
329
333
|
from warp.tests.test_grad_customs import TestGradCustoms
|
|
@@ -331,26 +335,35 @@ def kit_suite(test_loader: unittest.TestLoader = unittest.defaultTestLoader):
|
|
|
331
335
|
from warp.tests.test_hash_grid import TestHashGrid
|
|
332
336
|
from warp.tests.test_indexedarray import TestIndexedArray
|
|
333
337
|
from warp.tests.test_launch import TestLaunch
|
|
338
|
+
from warp.tests.test_lvalue import TestLValue
|
|
334
339
|
from warp.tests.test_marching_cubes import TestMarchingCubes
|
|
335
340
|
from warp.tests.test_mat_lite import TestMatLite
|
|
336
341
|
from warp.tests.test_math import TestMath
|
|
337
342
|
from warp.tests.test_matmul_lite import TestMatmulLite
|
|
343
|
+
from warp.tests.test_mempool import TestMempool
|
|
338
344
|
from warp.tests.test_mesh import TestMesh
|
|
339
345
|
from warp.tests.test_mesh_query_aabb import TestMeshQueryAABBMethods
|
|
340
346
|
from warp.tests.test_mesh_query_point import TestMeshQueryPoint
|
|
341
347
|
from warp.tests.test_mesh_query_ray import TestMeshQueryRay
|
|
348
|
+
from warp.tests.test_mlp import TestMLP
|
|
342
349
|
from warp.tests.test_module_hashing import TestModuleHashing
|
|
343
350
|
from warp.tests.test_modules_lite import TestModuleLite
|
|
344
351
|
from warp.tests.test_noise import TestNoise
|
|
345
352
|
from warp.tests.test_operators import TestOperators
|
|
353
|
+
from warp.tests.test_peer import TestPeer
|
|
354
|
+
from warp.tests.test_pinned import TestPinned
|
|
346
355
|
from warp.tests.test_quat import TestQuat
|
|
347
356
|
from warp.tests.test_rand import TestRand
|
|
357
|
+
from warp.tests.test_reload import TestReload
|
|
348
358
|
from warp.tests.test_rounding import TestRounding
|
|
349
359
|
from warp.tests.test_runlength_encode import TestRunlengthEncode
|
|
360
|
+
from warp.tests.test_scalar_ops import TestScalarOps
|
|
361
|
+
from warp.tests.test_snippet import TestSnippets
|
|
350
362
|
from warp.tests.test_sparse import TestSparse
|
|
351
363
|
from warp.tests.test_static import TestStatic
|
|
352
364
|
from warp.tests.test_streams import TestStreams
|
|
353
365
|
from warp.tests.test_tape import TestTape
|
|
366
|
+
from warp.tests.test_tile_reduce import TestTileReduce
|
|
354
367
|
from warp.tests.test_transient_module import TestTransientModule
|
|
355
368
|
from warp.tests.test_types import TestTypes
|
|
356
369
|
from warp.tests.test_utils import TestUtils
|
|
@@ -361,15 +374,18 @@ def kit_suite(test_loader: unittest.TestLoader = unittest.defaultTestLoader):
|
|
|
361
374
|
test_classes = [
|
|
362
375
|
TestArray,
|
|
363
376
|
TestArrayReduce,
|
|
377
|
+
TestBool,
|
|
378
|
+
TestBuiltinsResolution,
|
|
364
379
|
TestBvh,
|
|
365
380
|
TestCodeGen,
|
|
366
|
-
TestCodeGenInstancing,
|
|
367
381
|
TestConstants,
|
|
368
382
|
TestConditional,
|
|
383
|
+
TestCopy,
|
|
369
384
|
TestCTypes,
|
|
370
385
|
TestDevices,
|
|
371
386
|
TestDLPack,
|
|
372
387
|
TestFabricArray,
|
|
388
|
+
TestFp16,
|
|
373
389
|
TestFunc,
|
|
374
390
|
TestGenerics,
|
|
375
391
|
TestGradCustoms,
|
|
@@ -377,26 +393,35 @@ def kit_suite(test_loader: unittest.TestLoader = unittest.defaultTestLoader):
|
|
|
377
393
|
TestHashGrid,
|
|
378
394
|
TestIndexedArray,
|
|
379
395
|
TestLaunch,
|
|
396
|
+
TestLValue,
|
|
380
397
|
TestMarchingCubes,
|
|
381
398
|
TestMatLite,
|
|
382
399
|
TestMath,
|
|
383
400
|
TestMatmulLite,
|
|
401
|
+
TestMempool,
|
|
384
402
|
TestMesh,
|
|
385
403
|
TestMeshQueryAABBMethods,
|
|
386
404
|
TestMeshQueryPoint,
|
|
387
405
|
TestMeshQueryRay,
|
|
406
|
+
TestMLP,
|
|
388
407
|
TestModuleHashing,
|
|
389
408
|
TestModuleLite,
|
|
390
409
|
TestNoise,
|
|
391
410
|
TestOperators,
|
|
411
|
+
TestPeer,
|
|
412
|
+
TestPinned,
|
|
392
413
|
TestQuat,
|
|
393
414
|
TestRand,
|
|
415
|
+
TestReload,
|
|
394
416
|
TestRounding,
|
|
395
417
|
TestRunlengthEncode,
|
|
418
|
+
TestScalarOps,
|
|
419
|
+
TestSnippets,
|
|
396
420
|
TestSparse,
|
|
397
421
|
TestStatic,
|
|
398
422
|
TestStreams,
|
|
399
423
|
TestTape,
|
|
424
|
+
TestTileReduce,
|
|
400
425
|
TestTransientModule,
|
|
401
426
|
TestTypes,
|
|
402
427
|
TestUtils,
|
warp/tests/unittest_utils.py
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import ctypes
|
|
9
9
|
import ctypes.util
|
|
10
|
-
import importlib
|
|
10
|
+
import importlib.util
|
|
11
11
|
import os
|
|
12
12
|
import sys
|
|
13
13
|
import time
|
|
@@ -58,7 +58,6 @@ def get_selected_cuda_test_devices(mode: Optional[str] = None):
|
|
|
58
58
|
"""
|
|
59
59
|
|
|
60
60
|
if mode is None:
|
|
61
|
-
global test_mode
|
|
62
61
|
mode = test_mode
|
|
63
62
|
|
|
64
63
|
if mode == "basic":
|
|
@@ -98,7 +97,6 @@ def get_test_devices(mode: Optional[str] = None):
|
|
|
98
97
|
"all": Returns all available devices.
|
|
99
98
|
"""
|
|
100
99
|
if mode is None:
|
|
101
|
-
global test_mode
|
|
102
100
|
mode = test_mode
|
|
103
101
|
|
|
104
102
|
devices = []
|
|
@@ -128,8 +126,13 @@ def get_cuda_test_devices(mode=None):
|
|
|
128
126
|
return [d for d in devices if d.is_cuda]
|
|
129
127
|
|
|
130
128
|
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
class StreamCapture:
|
|
130
|
+
def __init__(self, stream_name):
|
|
131
|
+
self.stream_name = stream_name # 'stdout' or 'stderr'
|
|
132
|
+
self.saved = None
|
|
133
|
+
self.target = None
|
|
134
|
+
self.tempfile = None
|
|
135
|
+
|
|
133
136
|
def begin(self):
|
|
134
137
|
# Flush the stream buffers managed by libc.
|
|
135
138
|
# This is needed at the moment due to Carbonite not flushing the logs
|
|
@@ -137,14 +140,15 @@ class StdOutCapture:
|
|
|
137
140
|
if LIBC is not None:
|
|
138
141
|
LIBC.fflush(None)
|
|
139
142
|
|
|
140
|
-
#
|
|
141
|
-
self.saved = sys.
|
|
143
|
+
# Get the stream object (sys.stdout or sys.stderr)
|
|
144
|
+
self.saved = getattr(sys, self.stream_name)
|
|
142
145
|
self.target = os.dup(self.saved.fileno())
|
|
143
146
|
|
|
144
147
|
# create temporary capture stream
|
|
145
148
|
import io
|
|
146
149
|
import tempfile
|
|
147
150
|
|
|
151
|
+
# Create temporary capture stream
|
|
148
152
|
self.tempfile = io.TextIOWrapper(
|
|
149
153
|
tempfile.TemporaryFile(buffering=0),
|
|
150
154
|
encoding="utf-8",
|
|
@@ -153,33 +157,46 @@ class StdOutCapture:
|
|
|
153
157
|
write_through=True,
|
|
154
158
|
)
|
|
155
159
|
|
|
160
|
+
# Redirect the stream
|
|
156
161
|
os.dup2(self.tempfile.fileno(), self.saved.fileno())
|
|
157
|
-
|
|
158
|
-
sys.stdout = self.tempfile
|
|
162
|
+
setattr(sys, self.stream_name, self.tempfile)
|
|
159
163
|
|
|
160
164
|
def end(self):
|
|
161
165
|
# The following sleep doesn't seem to fix the test_print failure on Windows
|
|
162
166
|
# if sys.platform == "win32":
|
|
163
167
|
# # Workaround for what seems to be a Windows-specific bug where
|
|
164
|
-
# # the output of CUDA's
|
|
165
|
-
# # despite the context
|
|
168
|
+
# # the output of CUDA's printf is not being immediately flushed
|
|
169
|
+
# # despite the context synchronization.
|
|
166
170
|
# time.sleep(0.01)
|
|
167
|
-
|
|
168
171
|
if LIBC is not None:
|
|
169
172
|
LIBC.fflush(None)
|
|
170
173
|
|
|
174
|
+
# Restore the original stream
|
|
171
175
|
os.dup2(self.target, self.saved.fileno())
|
|
172
176
|
os.close(self.target)
|
|
173
177
|
|
|
178
|
+
# Read the captured output
|
|
174
179
|
self.tempfile.seek(0)
|
|
175
180
|
res = self.tempfile.buffer.read()
|
|
176
181
|
self.tempfile.close()
|
|
177
182
|
|
|
178
|
-
|
|
183
|
+
# Restore the stream object
|
|
184
|
+
setattr(sys, self.stream_name, self.saved)
|
|
179
185
|
|
|
180
186
|
return str(res.decode("utf-8"))
|
|
181
187
|
|
|
182
188
|
|
|
189
|
+
# Subclasses for specific streams
|
|
190
|
+
class StdErrCapture(StreamCapture):
|
|
191
|
+
def __init__(self):
|
|
192
|
+
super().__init__("stderr")
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
class StdOutCapture(StreamCapture):
|
|
196
|
+
def __init__(self):
|
|
197
|
+
super().__init__("stdout")
|
|
198
|
+
|
|
199
|
+
|
|
183
200
|
class CheckOutput:
|
|
184
201
|
def __init__(self, test):
|
|
185
202
|
self.test = test
|
|
@@ -306,9 +306,9 @@ def main(argv=None):
|
|
|
306
306
|
|
|
307
307
|
# Test report
|
|
308
308
|
print(unittest.TextTestResult.separator2, file=sys.stderr)
|
|
309
|
-
print(f
|
|
309
|
+
print(f"Ran {tests_run} {'tests' if tests_run > 1 else 'test'} in {test_duration:.3f}s", file=sys.stderr)
|
|
310
310
|
print(file=sys.stderr)
|
|
311
|
-
print(f'
|
|
311
|
+
print(f"{'OK' if is_success else 'FAILED'}{' (' + ', '.join(infos) + ')' if infos else ''}", file=sys.stderr)
|
|
312
312
|
|
|
313
313
|
if test_records and args.junit_report_xml:
|
|
314
314
|
# NVIDIA modification to report results in Junit XML format
|