warp-lang 1.3.0__py3-none-macosx_10_13_universal2.whl → 1.3.2__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/autograd.py +6 -6
- warp/bin/libwarp-clang.dylib +0 -0
- warp/bin/libwarp.dylib +0 -0
- warp/builtins.py +46 -43
- warp/codegen.py +27 -38
- warp/config.py +1 -1
- warp/context.py +160 -111
- warp/examples/fem/example_mixed_elasticity.py +33 -23
- warp/fem/field/nodal_field.py +1 -1
- warp/fem/quadrature/quadrature.py +1 -0
- warp/native/builtin.h +3 -3
- warp/native/bvh.h +1 -1
- warp/native/svd.h +22 -7
- warp/native/warp.cpp +1 -0
- warp/native/warp.cu +5 -0
- warp/native/warp.h +1 -0
- warp/sim/collide.py +1 -1
- warp/sim/model.py +16 -3
- warp/sim/utils.py +1 -1
- warp/stubs.py +112 -112
- warp/tape.py +3 -3
- warp/tests/test_array.py +11 -0
- warp/tests/test_async.py +3 -1
- warp/tests/test_bvh.py +33 -8
- warp/tests/test_codegen.py +25 -0
- warp/tests/test_compile_consts.py +15 -0
- warp/tests/test_examples.py +6 -1
- warp/tests/test_fem.py +51 -0
- warp/tests/test_grad_debug.py +2 -1
- warp/tests/test_model.py +55 -0
- warp/tests/test_point_triangle_closest_point.py +143 -0
- warp/tests/test_reload.py +28 -0
- warp/tests/test_struct.py +48 -30
- warp/types.py +4 -2
- {warp_lang-1.3.0.dist-info → warp_lang-1.3.2.dist-info}/METADATA +14 -14
- {warp_lang-1.3.0.dist-info → warp_lang-1.3.2.dist-info}/RECORD +39 -38
- {warp_lang-1.3.0.dist-info → warp_lang-1.3.2.dist-info}/WHEEL +1 -1
- {warp_lang-1.3.0.dist-info → warp_lang-1.3.2.dist-info}/LICENSE.md +0 -0
- {warp_lang-1.3.0.dist-info → warp_lang-1.3.2.dist-info}/top_level.txt +0 -0
warp/stubs.py
CHANGED
|
@@ -477,7 +477,7 @@ def cross(a: Vector[3, Scalar], b: Vector[3, Scalar]) -> Vector[3, Scalar]:
|
|
|
477
477
|
|
|
478
478
|
|
|
479
479
|
@over
|
|
480
|
-
def skew(vec: Vector[3, Scalar]):
|
|
480
|
+
def skew(vec: Vector[3, Scalar]) -> Matrix[3, 3, Scalar]:
|
|
481
481
|
"""Compute the skew-symmetric 3x3 matrix for a 3D vector ``vec``."""
|
|
482
482
|
...
|
|
483
483
|
|
|
@@ -519,7 +519,7 @@ def normalize(a: Quaternion[Float]) -> Quaternion[Float]:
|
|
|
519
519
|
|
|
520
520
|
|
|
521
521
|
@over
|
|
522
|
-
def transpose(a: Matrix[Any, Any, Scalar]):
|
|
522
|
+
def transpose(a: Matrix[Any, Any, Scalar]) -> Matrix[Any, Any, Scalar]:
|
|
523
523
|
"""Return the transpose of the matrix ``a``."""
|
|
524
524
|
...
|
|
525
525
|
|
|
@@ -747,13 +747,13 @@ def spatial_cross_dual(a: Vector[6, Float], b: Vector[6, Float]) -> Vector[6, Fl
|
|
|
747
747
|
|
|
748
748
|
|
|
749
749
|
@over
|
|
750
|
-
def spatial_top(svec: Vector[6, Float]):
|
|
750
|
+
def spatial_top(svec: Vector[6, Float]) -> Vector[3, Float]:
|
|
751
751
|
"""Return the top (first) part of a 6D screw vector."""
|
|
752
752
|
...
|
|
753
753
|
|
|
754
754
|
|
|
755
755
|
@over
|
|
756
|
-
def spatial_bottom(svec: Vector[6, Float]):
|
|
756
|
+
def spatial_bottom(svec: Vector[6, Float]) -> Vector[3, Float]:
|
|
757
757
|
"""Return the bottom (second) part of a 6D screw vector."""
|
|
758
758
|
...
|
|
759
759
|
|
|
@@ -1140,212 +1140,212 @@ def tid() -> Tuple[int, int, int, int]:
|
|
|
1140
1140
|
|
|
1141
1141
|
|
|
1142
1142
|
@over
|
|
1143
|
-
def select(cond: bool, value_if_false: Any, value_if_true: Any):
|
|
1143
|
+
def select(cond: bool, value_if_false: Any, value_if_true: Any) -> Any:
|
|
1144
1144
|
"""Select between two arguments, if ``cond`` is ``False`` then return ``value_if_false``, otherwise return ``value_if_true``"""
|
|
1145
1145
|
...
|
|
1146
1146
|
|
|
1147
1147
|
|
|
1148
1148
|
@over
|
|
1149
|
-
def select(cond: int8, value_if_false: Any, value_if_true: Any):
|
|
1149
|
+
def select(cond: int8, value_if_false: Any, value_if_true: Any) -> Any:
|
|
1150
1150
|
"""Select between two arguments, if ``cond`` is ``False`` then return ``value_if_false``, otherwise return ``value_if_true``"""
|
|
1151
1151
|
...
|
|
1152
1152
|
|
|
1153
1153
|
|
|
1154
1154
|
@over
|
|
1155
|
-
def select(cond: uint8, value_if_false: Any, value_if_true: Any):
|
|
1155
|
+
def select(cond: uint8, value_if_false: Any, value_if_true: Any) -> Any:
|
|
1156
1156
|
"""Select between two arguments, if ``cond`` is ``False`` then return ``value_if_false``, otherwise return ``value_if_true``"""
|
|
1157
1157
|
...
|
|
1158
1158
|
|
|
1159
1159
|
|
|
1160
1160
|
@over
|
|
1161
|
-
def select(cond: int16, value_if_false: Any, value_if_true: Any):
|
|
1161
|
+
def select(cond: int16, value_if_false: Any, value_if_true: Any) -> Any:
|
|
1162
1162
|
"""Select between two arguments, if ``cond`` is ``False`` then return ``value_if_false``, otherwise return ``value_if_true``"""
|
|
1163
1163
|
...
|
|
1164
1164
|
|
|
1165
1165
|
|
|
1166
1166
|
@over
|
|
1167
|
-
def select(cond: uint16, value_if_false: Any, value_if_true: Any):
|
|
1167
|
+
def select(cond: uint16, value_if_false: Any, value_if_true: Any) -> Any:
|
|
1168
1168
|
"""Select between two arguments, if ``cond`` is ``False`` then return ``value_if_false``, otherwise return ``value_if_true``"""
|
|
1169
1169
|
...
|
|
1170
1170
|
|
|
1171
1171
|
|
|
1172
1172
|
@over
|
|
1173
|
-
def select(cond: int32, value_if_false: Any, value_if_true: Any):
|
|
1173
|
+
def select(cond: int32, value_if_false: Any, value_if_true: Any) -> Any:
|
|
1174
1174
|
"""Select between two arguments, if ``cond`` is ``False`` then return ``value_if_false``, otherwise return ``value_if_true``"""
|
|
1175
1175
|
...
|
|
1176
1176
|
|
|
1177
1177
|
|
|
1178
1178
|
@over
|
|
1179
|
-
def select(cond: uint32, value_if_false: Any, value_if_true: Any):
|
|
1179
|
+
def select(cond: uint32, value_if_false: Any, value_if_true: Any) -> Any:
|
|
1180
1180
|
"""Select between two arguments, if ``cond`` is ``False`` then return ``value_if_false``, otherwise return ``value_if_true``"""
|
|
1181
1181
|
...
|
|
1182
1182
|
|
|
1183
1183
|
|
|
1184
1184
|
@over
|
|
1185
|
-
def select(cond: int64, value_if_false: Any, value_if_true: Any):
|
|
1185
|
+
def select(cond: int64, value_if_false: Any, value_if_true: Any) -> Any:
|
|
1186
1186
|
"""Select between two arguments, if ``cond`` is ``False`` then return ``value_if_false``, otherwise return ``value_if_true``"""
|
|
1187
1187
|
...
|
|
1188
1188
|
|
|
1189
1189
|
|
|
1190
1190
|
@over
|
|
1191
|
-
def select(cond: uint64, value_if_false: Any, value_if_true: Any):
|
|
1191
|
+
def select(cond: uint64, value_if_false: Any, value_if_true: Any) -> Any:
|
|
1192
1192
|
"""Select between two arguments, if ``cond`` is ``False`` then return ``value_if_false``, otherwise return ``value_if_true``"""
|
|
1193
1193
|
...
|
|
1194
1194
|
|
|
1195
1195
|
|
|
1196
1196
|
@over
|
|
1197
|
-
def select(arr: Array[Any], value_if_false: Any, value_if_true: Any):
|
|
1197
|
+
def select(arr: Array[Any], value_if_false: Any, value_if_true: Any) -> Any:
|
|
1198
1198
|
"""Select between two arguments, if ``arr`` is null then return ``value_if_false``, otherwise return ``value_if_true``"""
|
|
1199
1199
|
...
|
|
1200
1200
|
|
|
1201
1201
|
|
|
1202
1202
|
@over
|
|
1203
|
-
def atomic_add(arr: Array[Any], i: int32, value: Any):
|
|
1204
|
-
"""Atomically add ``value`` onto ``arr[i]
|
|
1203
|
+
def atomic_add(arr: Array[Any], i: int32, value: Any) -> Any:
|
|
1204
|
+
"""Atomically add ``value`` onto ``arr[i]`` and return the old value."""
|
|
1205
1205
|
...
|
|
1206
1206
|
|
|
1207
1207
|
|
|
1208
1208
|
@over
|
|
1209
|
-
def atomic_add(arr: Array[Any], i: int32, j: int32, value: Any):
|
|
1210
|
-
"""Atomically add ``value`` onto ``arr[i,j]
|
|
1209
|
+
def atomic_add(arr: Array[Any], i: int32, j: int32, value: Any) -> Any:
|
|
1210
|
+
"""Atomically add ``value`` onto ``arr[i,j]`` and return the old value."""
|
|
1211
1211
|
...
|
|
1212
1212
|
|
|
1213
1213
|
|
|
1214
1214
|
@over
|
|
1215
|
-
def atomic_add(arr: Array[Any], i: int32, j: int32, k: int32, value: Any):
|
|
1216
|
-
"""Atomically add ``value`` onto ``arr[i,j,k]
|
|
1215
|
+
def atomic_add(arr: Array[Any], i: int32, j: int32, k: int32, value: Any) -> Any:
|
|
1216
|
+
"""Atomically add ``value`` onto ``arr[i,j,k]`` and return the old value."""
|
|
1217
1217
|
...
|
|
1218
1218
|
|
|
1219
1219
|
|
|
1220
1220
|
@over
|
|
1221
|
-
def atomic_add(arr: Array[Any], i: int32, j: int32, k: int32, l: int32, value: Any):
|
|
1222
|
-
"""Atomically add ``value`` onto ``arr[i,j,k,l]
|
|
1221
|
+
def atomic_add(arr: Array[Any], i: int32, j: int32, k: int32, l: int32, value: Any) -> Any:
|
|
1222
|
+
"""Atomically add ``value`` onto ``arr[i,j,k,l]`` and return the old value."""
|
|
1223
1223
|
...
|
|
1224
1224
|
|
|
1225
1225
|
|
|
1226
1226
|
@over
|
|
1227
|
-
def atomic_add(arr: FabricArray[Any], i: int32, value: Any):
|
|
1228
|
-
"""Atomically add ``value`` onto ``arr[i]
|
|
1227
|
+
def atomic_add(arr: FabricArray[Any], i: int32, value: Any) -> Any:
|
|
1228
|
+
"""Atomically add ``value`` onto ``arr[i]`` and return the old value."""
|
|
1229
1229
|
...
|
|
1230
1230
|
|
|
1231
1231
|
|
|
1232
1232
|
@over
|
|
1233
|
-
def atomic_add(arr: FabricArray[Any], i: int32, j: int32, value: Any):
|
|
1234
|
-
"""Atomically add ``value`` onto ``arr[i,j]
|
|
1233
|
+
def atomic_add(arr: FabricArray[Any], i: int32, j: int32, value: Any) -> Any:
|
|
1234
|
+
"""Atomically add ``value`` onto ``arr[i,j]`` and return the old value."""
|
|
1235
1235
|
...
|
|
1236
1236
|
|
|
1237
1237
|
|
|
1238
1238
|
@over
|
|
1239
|
-
def atomic_add(arr: FabricArray[Any], i: int32, j: int32, k: int32, value: Any):
|
|
1240
|
-
"""Atomically add ``value`` onto ``arr[i,j,k]
|
|
1239
|
+
def atomic_add(arr: FabricArray[Any], i: int32, j: int32, k: int32, value: Any) -> Any:
|
|
1240
|
+
"""Atomically add ``value`` onto ``arr[i,j,k]`` and return the old value."""
|
|
1241
1241
|
...
|
|
1242
1242
|
|
|
1243
1243
|
|
|
1244
1244
|
@over
|
|
1245
|
-
def atomic_add(arr: FabricArray[Any], i: int32, j: int32, k: int32, l: int32, value: Any):
|
|
1246
|
-
"""Atomically add ``value`` onto ``arr[i,j,k,l]
|
|
1245
|
+
def atomic_add(arr: FabricArray[Any], i: int32, j: int32, k: int32, l: int32, value: Any) -> Any:
|
|
1246
|
+
"""Atomically add ``value`` onto ``arr[i,j,k,l]`` and return the old value."""
|
|
1247
1247
|
...
|
|
1248
1248
|
|
|
1249
1249
|
|
|
1250
1250
|
@over
|
|
1251
|
-
def atomic_add(arr: IndexedFabricArray[Any], i: int32, value: Any):
|
|
1252
|
-
"""Atomically add ``value`` onto ``arr[i]
|
|
1251
|
+
def atomic_add(arr: IndexedFabricArray[Any], i: int32, value: Any) -> Any:
|
|
1252
|
+
"""Atomically add ``value`` onto ``arr[i]`` and return the old value."""
|
|
1253
1253
|
...
|
|
1254
1254
|
|
|
1255
1255
|
|
|
1256
1256
|
@over
|
|
1257
|
-
def atomic_add(arr: IndexedFabricArray[Any], i: int32, j: int32, value: Any):
|
|
1258
|
-
"""Atomically add ``value`` onto ``arr[i,j]
|
|
1257
|
+
def atomic_add(arr: IndexedFabricArray[Any], i: int32, j: int32, value: Any) -> Any:
|
|
1258
|
+
"""Atomically add ``value`` onto ``arr[i,j]`` and return the old value."""
|
|
1259
1259
|
...
|
|
1260
1260
|
|
|
1261
1261
|
|
|
1262
1262
|
@over
|
|
1263
|
-
def atomic_add(arr: IndexedFabricArray[Any], i: int32, j: int32, k: int32, value: Any):
|
|
1264
|
-
"""Atomically add ``value`` onto ``arr[i,j,k]
|
|
1263
|
+
def atomic_add(arr: IndexedFabricArray[Any], i: int32, j: int32, k: int32, value: Any) -> Any:
|
|
1264
|
+
"""Atomically add ``value`` onto ``arr[i,j,k]`` and return the old value."""
|
|
1265
1265
|
...
|
|
1266
1266
|
|
|
1267
1267
|
|
|
1268
1268
|
@over
|
|
1269
|
-
def atomic_add(arr: IndexedFabricArray[Any], i: int32, j: int32, k: int32, l: int32, value: Any):
|
|
1270
|
-
"""Atomically add ``value`` onto ``arr[i,j,k,l]
|
|
1269
|
+
def atomic_add(arr: IndexedFabricArray[Any], i: int32, j: int32, k: int32, l: int32, value: Any) -> Any:
|
|
1270
|
+
"""Atomically add ``value`` onto ``arr[i,j,k,l]`` and return the old value."""
|
|
1271
1271
|
...
|
|
1272
1272
|
|
|
1273
1273
|
|
|
1274
1274
|
@over
|
|
1275
|
-
def atomic_sub(arr: Array[Any], i: int32, value: Any):
|
|
1276
|
-
"""Atomically subtract ``value`` onto ``arr[i]
|
|
1275
|
+
def atomic_sub(arr: Array[Any], i: int32, value: Any) -> Any:
|
|
1276
|
+
"""Atomically subtract ``value`` onto ``arr[i]`` and return the old value."""
|
|
1277
1277
|
...
|
|
1278
1278
|
|
|
1279
1279
|
|
|
1280
1280
|
@over
|
|
1281
|
-
def atomic_sub(arr: Array[Any], i: int32, j: int32, value: Any):
|
|
1282
|
-
"""Atomically subtract ``value`` onto ``arr[i,j]
|
|
1281
|
+
def atomic_sub(arr: Array[Any], i: int32, j: int32, value: Any) -> Any:
|
|
1282
|
+
"""Atomically subtract ``value`` onto ``arr[i,j]`` and return the old value."""
|
|
1283
1283
|
...
|
|
1284
1284
|
|
|
1285
1285
|
|
|
1286
1286
|
@over
|
|
1287
|
-
def atomic_sub(arr: Array[Any], i: int32, j: int32, k: int32, value: Any):
|
|
1288
|
-
"""Atomically subtract ``value`` onto ``arr[i,j,k]
|
|
1287
|
+
def atomic_sub(arr: Array[Any], i: int32, j: int32, k: int32, value: Any) -> Any:
|
|
1288
|
+
"""Atomically subtract ``value`` onto ``arr[i,j,k]`` and return the old value."""
|
|
1289
1289
|
...
|
|
1290
1290
|
|
|
1291
1291
|
|
|
1292
1292
|
@over
|
|
1293
|
-
def atomic_sub(arr: Array[Any], i: int32, j: int32, k: int32, l: int32, value: Any):
|
|
1294
|
-
"""Atomically subtract ``value`` onto ``arr[i,j,k,l]
|
|
1293
|
+
def atomic_sub(arr: Array[Any], i: int32, j: int32, k: int32, l: int32, value: Any) -> Any:
|
|
1294
|
+
"""Atomically subtract ``value`` onto ``arr[i,j,k,l]`` and return the old value."""
|
|
1295
1295
|
...
|
|
1296
1296
|
|
|
1297
1297
|
|
|
1298
1298
|
@over
|
|
1299
|
-
def atomic_sub(arr: FabricArray[Any], i: int32, value: Any):
|
|
1300
|
-
"""Atomically subtract ``value`` onto ``arr[i]
|
|
1299
|
+
def atomic_sub(arr: FabricArray[Any], i: int32, value: Any) -> Any:
|
|
1300
|
+
"""Atomically subtract ``value`` onto ``arr[i]`` and return the old value."""
|
|
1301
1301
|
...
|
|
1302
1302
|
|
|
1303
1303
|
|
|
1304
1304
|
@over
|
|
1305
|
-
def atomic_sub(arr: FabricArray[Any], i: int32, j: int32, value: Any):
|
|
1306
|
-
"""Atomically subtract ``value`` onto ``arr[i,j]
|
|
1305
|
+
def atomic_sub(arr: FabricArray[Any], i: int32, j: int32, value: Any) -> Any:
|
|
1306
|
+
"""Atomically subtract ``value`` onto ``arr[i,j]`` and return the old value."""
|
|
1307
1307
|
...
|
|
1308
1308
|
|
|
1309
1309
|
|
|
1310
1310
|
@over
|
|
1311
|
-
def atomic_sub(arr: FabricArray[Any], i: int32, j: int32, k: int32, value: Any):
|
|
1312
|
-
"""Atomically subtract ``value`` onto ``arr[i,j,k]
|
|
1311
|
+
def atomic_sub(arr: FabricArray[Any], i: int32, j: int32, k: int32, value: Any) -> Any:
|
|
1312
|
+
"""Atomically subtract ``value`` onto ``arr[i,j,k]`` and return the old value."""
|
|
1313
1313
|
...
|
|
1314
1314
|
|
|
1315
1315
|
|
|
1316
1316
|
@over
|
|
1317
|
-
def atomic_sub(arr: FabricArray[Any], i: int32, j: int32, k: int32, l: int32, value: Any):
|
|
1318
|
-
"""Atomically subtract ``value`` onto ``arr[i,j,k,l]
|
|
1317
|
+
def atomic_sub(arr: FabricArray[Any], i: int32, j: int32, k: int32, l: int32, value: Any) -> Any:
|
|
1318
|
+
"""Atomically subtract ``value`` onto ``arr[i,j,k,l]`` and return the old value."""
|
|
1319
1319
|
...
|
|
1320
1320
|
|
|
1321
1321
|
|
|
1322
1322
|
@over
|
|
1323
|
-
def atomic_sub(arr: IndexedFabricArray[Any], i: int32, value: Any):
|
|
1324
|
-
"""Atomically subtract ``value`` onto ``arr[i]
|
|
1323
|
+
def atomic_sub(arr: IndexedFabricArray[Any], i: int32, value: Any) -> Any:
|
|
1324
|
+
"""Atomically subtract ``value`` onto ``arr[i]`` and return the old value."""
|
|
1325
1325
|
...
|
|
1326
1326
|
|
|
1327
1327
|
|
|
1328
1328
|
@over
|
|
1329
|
-
def atomic_sub(arr: IndexedFabricArray[Any], i: int32, j: int32, value: Any):
|
|
1330
|
-
"""Atomically subtract ``value`` onto ``arr[i,j]
|
|
1329
|
+
def atomic_sub(arr: IndexedFabricArray[Any], i: int32, j: int32, value: Any) -> Any:
|
|
1330
|
+
"""Atomically subtract ``value`` onto ``arr[i,j]`` and return the old value."""
|
|
1331
1331
|
...
|
|
1332
1332
|
|
|
1333
1333
|
|
|
1334
1334
|
@over
|
|
1335
|
-
def atomic_sub(arr: IndexedFabricArray[Any], i: int32, j: int32, k: int32, value: Any):
|
|
1336
|
-
"""Atomically subtract ``value`` onto ``arr[i,j,k]
|
|
1335
|
+
def atomic_sub(arr: IndexedFabricArray[Any], i: int32, j: int32, k: int32, value: Any) -> Any:
|
|
1336
|
+
"""Atomically subtract ``value`` onto ``arr[i,j,k]`` and return the old value."""
|
|
1337
1337
|
...
|
|
1338
1338
|
|
|
1339
1339
|
|
|
1340
1340
|
@over
|
|
1341
|
-
def atomic_sub(arr: IndexedFabricArray[Any], i: int32, j: int32, k: int32, l: int32, value: Any):
|
|
1342
|
-
"""Atomically subtract ``value`` onto ``arr[i,j,k,l]
|
|
1341
|
+
def atomic_sub(arr: IndexedFabricArray[Any], i: int32, j: int32, k: int32, l: int32, value: Any) -> Any:
|
|
1342
|
+
"""Atomically subtract ``value`` onto ``arr[i,j,k,l]`` and return the old value."""
|
|
1343
1343
|
...
|
|
1344
1344
|
|
|
1345
1345
|
|
|
1346
1346
|
@over
|
|
1347
|
-
def atomic_min(arr: Array[Any], i: int32, value: Any):
|
|
1348
|
-
"""Compute the minimum of ``value`` and ``arr[i]
|
|
1347
|
+
def atomic_min(arr: Array[Any], i: int32, value: Any) -> Any:
|
|
1348
|
+
"""Compute the minimum of ``value`` and ``arr[i]``, atomically update the array, and return the old value.
|
|
1349
1349
|
|
|
1350
1350
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1351
1351
|
"""
|
|
@@ -1353,8 +1353,8 @@ def atomic_min(arr: Array[Any], i: int32, value: Any):
|
|
|
1353
1353
|
|
|
1354
1354
|
|
|
1355
1355
|
@over
|
|
1356
|
-
def atomic_min(arr: Array[Any], i: int32, j: int32, value: Any):
|
|
1357
|
-
"""Compute the minimum of ``value`` and ``arr[i,j]
|
|
1356
|
+
def atomic_min(arr: Array[Any], i: int32, j: int32, value: Any) -> Any:
|
|
1357
|
+
"""Compute the minimum of ``value`` and ``arr[i,j]``, atomically update the array, and return the old value.
|
|
1358
1358
|
|
|
1359
1359
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1360
1360
|
"""
|
|
@@ -1362,8 +1362,8 @@ def atomic_min(arr: Array[Any], i: int32, j: int32, value: Any):
|
|
|
1362
1362
|
|
|
1363
1363
|
|
|
1364
1364
|
@over
|
|
1365
|
-
def atomic_min(arr: Array[Any], i: int32, j: int32, k: int32, value: Any):
|
|
1366
|
-
"""Compute the minimum of ``value`` and ``arr[i,j,k]
|
|
1365
|
+
def atomic_min(arr: Array[Any], i: int32, j: int32, k: int32, value: Any) -> Any:
|
|
1366
|
+
"""Compute the minimum of ``value`` and ``arr[i,j,k]``, atomically update the array, and return the old value.
|
|
1367
1367
|
|
|
1368
1368
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1369
1369
|
"""
|
|
@@ -1371,8 +1371,8 @@ def atomic_min(arr: Array[Any], i: int32, j: int32, k: int32, value: Any):
|
|
|
1371
1371
|
|
|
1372
1372
|
|
|
1373
1373
|
@over
|
|
1374
|
-
def atomic_min(arr: Array[Any], i: int32, j: int32, k: int32, l: int32, value: Any):
|
|
1375
|
-
"""Compute the minimum of ``value`` and ``arr[i,j,k,l]
|
|
1374
|
+
def atomic_min(arr: Array[Any], i: int32, j: int32, k: int32, l: int32, value: Any) -> Any:
|
|
1375
|
+
"""Compute the minimum of ``value`` and ``arr[i,j,k,l]``, atomically update the array, and return the old value.
|
|
1376
1376
|
|
|
1377
1377
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1378
1378
|
"""
|
|
@@ -1380,8 +1380,8 @@ def atomic_min(arr: Array[Any], i: int32, j: int32, k: int32, l: int32, value: A
|
|
|
1380
1380
|
|
|
1381
1381
|
|
|
1382
1382
|
@over
|
|
1383
|
-
def atomic_min(arr: FabricArray[Any], i: int32, value: Any):
|
|
1384
|
-
"""Compute the minimum of ``value`` and ``arr[i]
|
|
1383
|
+
def atomic_min(arr: FabricArray[Any], i: int32, value: Any) -> Any:
|
|
1384
|
+
"""Compute the minimum of ``value`` and ``arr[i]``, atomically update the array, and return the old value.
|
|
1385
1385
|
|
|
1386
1386
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1387
1387
|
"""
|
|
@@ -1389,8 +1389,8 @@ def atomic_min(arr: FabricArray[Any], i: int32, value: Any):
|
|
|
1389
1389
|
|
|
1390
1390
|
|
|
1391
1391
|
@over
|
|
1392
|
-
def atomic_min(arr: FabricArray[Any], i: int32, j: int32, value: Any):
|
|
1393
|
-
"""Compute the minimum of ``value`` and ``arr[i,j]
|
|
1392
|
+
def atomic_min(arr: FabricArray[Any], i: int32, j: int32, value: Any) -> Any:
|
|
1393
|
+
"""Compute the minimum of ``value`` and ``arr[i,j]``, atomically update the array, and return the old value.
|
|
1394
1394
|
|
|
1395
1395
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1396
1396
|
"""
|
|
@@ -1398,8 +1398,8 @@ def atomic_min(arr: FabricArray[Any], i: int32, j: int32, value: Any):
|
|
|
1398
1398
|
|
|
1399
1399
|
|
|
1400
1400
|
@over
|
|
1401
|
-
def atomic_min(arr: FabricArray[Any], i: int32, j: int32, k: int32, value: Any):
|
|
1402
|
-
"""Compute the minimum of ``value`` and ``arr[i,j,k]
|
|
1401
|
+
def atomic_min(arr: FabricArray[Any], i: int32, j: int32, k: int32, value: Any) -> Any:
|
|
1402
|
+
"""Compute the minimum of ``value`` and ``arr[i,j,k]``, atomically update the array, and return the old value.
|
|
1403
1403
|
|
|
1404
1404
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1405
1405
|
"""
|
|
@@ -1407,8 +1407,8 @@ def atomic_min(arr: FabricArray[Any], i: int32, j: int32, k: int32, value: Any):
|
|
|
1407
1407
|
|
|
1408
1408
|
|
|
1409
1409
|
@over
|
|
1410
|
-
def atomic_min(arr: FabricArray[Any], i: int32, j: int32, k: int32, l: int32, value: Any):
|
|
1411
|
-
"""Compute the minimum of ``value`` and ``arr[i,j,k,l]
|
|
1410
|
+
def atomic_min(arr: FabricArray[Any], i: int32, j: int32, k: int32, l: int32, value: Any) -> Any:
|
|
1411
|
+
"""Compute the minimum of ``value`` and ``arr[i,j,k,l]``, atomically update the array, and return the old value.
|
|
1412
1412
|
|
|
1413
1413
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1414
1414
|
"""
|
|
@@ -1416,8 +1416,8 @@ def atomic_min(arr: FabricArray[Any], i: int32, j: int32, k: int32, l: int32, va
|
|
|
1416
1416
|
|
|
1417
1417
|
|
|
1418
1418
|
@over
|
|
1419
|
-
def atomic_min(arr: IndexedFabricArray[Any], i: int32, value: Any):
|
|
1420
|
-
"""Compute the minimum of ``value`` and ``arr[i]
|
|
1419
|
+
def atomic_min(arr: IndexedFabricArray[Any], i: int32, value: Any) -> Any:
|
|
1420
|
+
"""Compute the minimum of ``value`` and ``arr[i]``, atomically update the array, and return the old value.
|
|
1421
1421
|
|
|
1422
1422
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1423
1423
|
"""
|
|
@@ -1425,8 +1425,8 @@ def atomic_min(arr: IndexedFabricArray[Any], i: int32, value: Any):
|
|
|
1425
1425
|
|
|
1426
1426
|
|
|
1427
1427
|
@over
|
|
1428
|
-
def atomic_min(arr: IndexedFabricArray[Any], i: int32, j: int32, value: Any):
|
|
1429
|
-
"""Compute the minimum of ``value`` and ``arr[i,j]
|
|
1428
|
+
def atomic_min(arr: IndexedFabricArray[Any], i: int32, j: int32, value: Any) -> Any:
|
|
1429
|
+
"""Compute the minimum of ``value`` and ``arr[i,j]``, atomically update the array, and return the old value.
|
|
1430
1430
|
|
|
1431
1431
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1432
1432
|
"""
|
|
@@ -1434,8 +1434,8 @@ def atomic_min(arr: IndexedFabricArray[Any], i: int32, j: int32, value: Any):
|
|
|
1434
1434
|
|
|
1435
1435
|
|
|
1436
1436
|
@over
|
|
1437
|
-
def atomic_min(arr: IndexedFabricArray[Any], i: int32, j: int32, k: int32, value: Any):
|
|
1438
|
-
"""Compute the minimum of ``value`` and ``arr[i,j,k]
|
|
1437
|
+
def atomic_min(arr: IndexedFabricArray[Any], i: int32, j: int32, k: int32, value: Any) -> Any:
|
|
1438
|
+
"""Compute the minimum of ``value`` and ``arr[i,j,k]``, atomically update the array, and return the old value.
|
|
1439
1439
|
|
|
1440
1440
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1441
1441
|
"""
|
|
@@ -1443,8 +1443,8 @@ def atomic_min(arr: IndexedFabricArray[Any], i: int32, j: int32, k: int32, value
|
|
|
1443
1443
|
|
|
1444
1444
|
|
|
1445
1445
|
@over
|
|
1446
|
-
def atomic_min(arr: IndexedFabricArray[Any], i: int32, j: int32, k: int32, l: int32, value: Any):
|
|
1447
|
-
"""Compute the minimum of ``value`` and ``arr[i,j,k,l]
|
|
1446
|
+
def atomic_min(arr: IndexedFabricArray[Any], i: int32, j: int32, k: int32, l: int32, value: Any) -> Any:
|
|
1447
|
+
"""Compute the minimum of ``value`` and ``arr[i,j,k,l]``, atomically update the array, and return the old value.
|
|
1448
1448
|
|
|
1449
1449
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1450
1450
|
"""
|
|
@@ -1452,8 +1452,8 @@ def atomic_min(arr: IndexedFabricArray[Any], i: int32, j: int32, k: int32, l: in
|
|
|
1452
1452
|
|
|
1453
1453
|
|
|
1454
1454
|
@over
|
|
1455
|
-
def atomic_max(arr: Array[Any], i: int32, value: Any):
|
|
1456
|
-
"""Compute the maximum of ``value`` and ``arr[i]
|
|
1455
|
+
def atomic_max(arr: Array[Any], i: int32, value: Any) -> Any:
|
|
1456
|
+
"""Compute the maximum of ``value`` and ``arr[i]``, atomically update the array, and return the old value.
|
|
1457
1457
|
|
|
1458
1458
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1459
1459
|
"""
|
|
@@ -1461,8 +1461,8 @@ def atomic_max(arr: Array[Any], i: int32, value: Any):
|
|
|
1461
1461
|
|
|
1462
1462
|
|
|
1463
1463
|
@over
|
|
1464
|
-
def atomic_max(arr: Array[Any], i: int32, j: int32, value: Any):
|
|
1465
|
-
"""Compute the maximum of ``value`` and ``arr[i,j]
|
|
1464
|
+
def atomic_max(arr: Array[Any], i: int32, j: int32, value: Any) -> Any:
|
|
1465
|
+
"""Compute the maximum of ``value`` and ``arr[i,j]``, atomically update the array, and return the old value.
|
|
1466
1466
|
|
|
1467
1467
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1468
1468
|
"""
|
|
@@ -1470,8 +1470,8 @@ def atomic_max(arr: Array[Any], i: int32, j: int32, value: Any):
|
|
|
1470
1470
|
|
|
1471
1471
|
|
|
1472
1472
|
@over
|
|
1473
|
-
def atomic_max(arr: Array[Any], i: int32, j: int32, k: int32, value: Any):
|
|
1474
|
-
"""Compute the maximum of ``value`` and ``arr[i,j,k]
|
|
1473
|
+
def atomic_max(arr: Array[Any], i: int32, j: int32, k: int32, value: Any) -> Any:
|
|
1474
|
+
"""Compute the maximum of ``value`` and ``arr[i,j,k]``, atomically update the array, and return the old value.
|
|
1475
1475
|
|
|
1476
1476
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1477
1477
|
"""
|
|
@@ -1479,8 +1479,8 @@ def atomic_max(arr: Array[Any], i: int32, j: int32, k: int32, value: Any):
|
|
|
1479
1479
|
|
|
1480
1480
|
|
|
1481
1481
|
@over
|
|
1482
|
-
def atomic_max(arr: Array[Any], i: int32, j: int32, k: int32, l: int32, value: Any):
|
|
1483
|
-
"""Compute the maximum of ``value`` and ``arr[i,j,k,l]
|
|
1482
|
+
def atomic_max(arr: Array[Any], i: int32, j: int32, k: int32, l: int32, value: Any) -> Any:
|
|
1483
|
+
"""Compute the maximum of ``value`` and ``arr[i,j,k,l]``, atomically update the array, and return the old value.
|
|
1484
1484
|
|
|
1485
1485
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1486
1486
|
"""
|
|
@@ -1488,8 +1488,8 @@ def atomic_max(arr: Array[Any], i: int32, j: int32, k: int32, l: int32, value: A
|
|
|
1488
1488
|
|
|
1489
1489
|
|
|
1490
1490
|
@over
|
|
1491
|
-
def atomic_max(arr: FabricArray[Any], i: int32, value: Any):
|
|
1492
|
-
"""Compute the maximum of ``value`` and ``arr[i]
|
|
1491
|
+
def atomic_max(arr: FabricArray[Any], i: int32, value: Any) -> Any:
|
|
1492
|
+
"""Compute the maximum of ``value`` and ``arr[i]``, atomically update the array, and return the old value.
|
|
1493
1493
|
|
|
1494
1494
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1495
1495
|
"""
|
|
@@ -1497,8 +1497,8 @@ def atomic_max(arr: FabricArray[Any], i: int32, value: Any):
|
|
|
1497
1497
|
|
|
1498
1498
|
|
|
1499
1499
|
@over
|
|
1500
|
-
def atomic_max(arr: FabricArray[Any], i: int32, j: int32, value: Any):
|
|
1501
|
-
"""Compute the maximum of ``value`` and ``arr[i,j]
|
|
1500
|
+
def atomic_max(arr: FabricArray[Any], i: int32, j: int32, value: Any) -> Any:
|
|
1501
|
+
"""Compute the maximum of ``value`` and ``arr[i,j]``, atomically update the array, and return the old value.
|
|
1502
1502
|
|
|
1503
1503
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1504
1504
|
"""
|
|
@@ -1506,8 +1506,8 @@ def atomic_max(arr: FabricArray[Any], i: int32, j: int32, value: Any):
|
|
|
1506
1506
|
|
|
1507
1507
|
|
|
1508
1508
|
@over
|
|
1509
|
-
def atomic_max(arr: FabricArray[Any], i: int32, j: int32, k: int32, value: Any):
|
|
1510
|
-
"""Compute the maximum of ``value`` and ``arr[i,j,k]
|
|
1509
|
+
def atomic_max(arr: FabricArray[Any], i: int32, j: int32, k: int32, value: Any) -> Any:
|
|
1510
|
+
"""Compute the maximum of ``value`` and ``arr[i,j,k]``, atomically update the array, and return the old value.
|
|
1511
1511
|
|
|
1512
1512
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1513
1513
|
"""
|
|
@@ -1515,8 +1515,8 @@ def atomic_max(arr: FabricArray[Any], i: int32, j: int32, k: int32, value: Any):
|
|
|
1515
1515
|
|
|
1516
1516
|
|
|
1517
1517
|
@over
|
|
1518
|
-
def atomic_max(arr: FabricArray[Any], i: int32, j: int32, k: int32, l: int32, value: Any):
|
|
1519
|
-
"""Compute the maximum of ``value`` and ``arr[i,j,k,l]
|
|
1518
|
+
def atomic_max(arr: FabricArray[Any], i: int32, j: int32, k: int32, l: int32, value: Any) -> Any:
|
|
1519
|
+
"""Compute the maximum of ``value`` and ``arr[i,j,k,l]``, atomically update the array, and return the old value.
|
|
1520
1520
|
|
|
1521
1521
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1522
1522
|
"""
|
|
@@ -1524,8 +1524,8 @@ def atomic_max(arr: FabricArray[Any], i: int32, j: int32, k: int32, l: int32, va
|
|
|
1524
1524
|
|
|
1525
1525
|
|
|
1526
1526
|
@over
|
|
1527
|
-
def atomic_max(arr: IndexedFabricArray[Any], i: int32, value: Any):
|
|
1528
|
-
"""Compute the maximum of ``value`` and ``arr[i]
|
|
1527
|
+
def atomic_max(arr: IndexedFabricArray[Any], i: int32, value: Any) -> Any:
|
|
1528
|
+
"""Compute the maximum of ``value`` and ``arr[i]``, atomically update the array, and return the old value.
|
|
1529
1529
|
|
|
1530
1530
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1531
1531
|
"""
|
|
@@ -1533,8 +1533,8 @@ def atomic_max(arr: IndexedFabricArray[Any], i: int32, value: Any):
|
|
|
1533
1533
|
|
|
1534
1534
|
|
|
1535
1535
|
@over
|
|
1536
|
-
def atomic_max(arr: IndexedFabricArray[Any], i: int32, j: int32, value: Any):
|
|
1537
|
-
"""Compute the maximum of ``value`` and ``arr[i,j]
|
|
1536
|
+
def atomic_max(arr: IndexedFabricArray[Any], i: int32, j: int32, value: Any) -> Any:
|
|
1537
|
+
"""Compute the maximum of ``value`` and ``arr[i,j]``, atomically update the array, and return the old value.
|
|
1538
1538
|
|
|
1539
1539
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1540
1540
|
"""
|
|
@@ -1542,8 +1542,8 @@ def atomic_max(arr: IndexedFabricArray[Any], i: int32, j: int32, value: Any):
|
|
|
1542
1542
|
|
|
1543
1543
|
|
|
1544
1544
|
@over
|
|
1545
|
-
def atomic_max(arr: IndexedFabricArray[Any], i: int32, j: int32, k: int32, value: Any):
|
|
1546
|
-
"""Compute the maximum of ``value`` and ``arr[i,j,k]
|
|
1545
|
+
def atomic_max(arr: IndexedFabricArray[Any], i: int32, j: int32, k: int32, value: Any) -> Any:
|
|
1546
|
+
"""Compute the maximum of ``value`` and ``arr[i,j,k]``, atomically update the array, and return the old value.
|
|
1547
1547
|
|
|
1548
1548
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1549
1549
|
"""
|
|
@@ -1551,8 +1551,8 @@ def atomic_max(arr: IndexedFabricArray[Any], i: int32, j: int32, k: int32, value
|
|
|
1551
1551
|
|
|
1552
1552
|
|
|
1553
1553
|
@over
|
|
1554
|
-
def atomic_max(arr: IndexedFabricArray[Any], i: int32, j: int32, k: int32, l: int32, value: Any):
|
|
1555
|
-
"""Compute the maximum of ``value`` and ``arr[i,j,k,l]
|
|
1554
|
+
def atomic_max(arr: IndexedFabricArray[Any], i: int32, j: int32, k: int32, l: int32, value: Any) -> Any:
|
|
1555
|
+
"""Compute the maximum of ``value`` and ``arr[i,j,k,l]``, atomically update the array, and return the old value.
|
|
1556
1556
|
|
|
1557
1557
|
.. note:: The operation is only atomic on a per-component basis for vectors and matrices.
|
|
1558
1558
|
"""
|
|
@@ -1778,7 +1778,7 @@ def mul(a: Vector[Any, Scalar], b: Matrix[Any, Any, Scalar]) -> Vector[Any, Scal
|
|
|
1778
1778
|
|
|
1779
1779
|
|
|
1780
1780
|
@over
|
|
1781
|
-
def mul(a: Matrix[Any, Any, Scalar], b: Matrix[Any, Any, Scalar]):
|
|
1781
|
+
def mul(a: Matrix[Any, Any, Scalar], b: Matrix[Any, Any, Scalar]) -> Matrix[Any, Any, Scalar]:
|
|
1782
1782
|
""" """
|
|
1783
1783
|
...
|
|
1784
1784
|
|
|
@@ -1803,7 +1803,7 @@ def mul(a: Transformation[Scalar], b: Scalar) -> Transformation[Scalar]:
|
|
|
1803
1803
|
|
|
1804
1804
|
@over
|
|
1805
1805
|
def mod(a: Scalar, b: Scalar) -> Scalar:
|
|
1806
|
-
""" """
|
|
1806
|
+
"""Modulo operation using truncated division."""
|
|
1807
1807
|
...
|
|
1808
1808
|
|
|
1809
1809
|
|
warp/tape.py
CHANGED
|
@@ -197,7 +197,7 @@ class Tape:
|
|
|
197
197
|
else:
|
|
198
198
|
self.scopes.append((len(self.launches), None, None))
|
|
199
199
|
|
|
200
|
-
def
|
|
200
|
+
def _check_kernel_array_access(self, kernel, args):
|
|
201
201
|
"""Detect illegal inter-kernel write after read access patterns during launch capture"""
|
|
202
202
|
adj = kernel.adj
|
|
203
203
|
kernel_name = adj.fun_name
|
|
@@ -256,7 +256,7 @@ class Tape:
|
|
|
256
256
|
self.scopes = []
|
|
257
257
|
self.zero()
|
|
258
258
|
if wp.config.verify_autograd_array_access:
|
|
259
|
-
self.
|
|
259
|
+
self._reset_array_read_flags()
|
|
260
260
|
|
|
261
261
|
def zero(self):
|
|
262
262
|
"""
|
|
@@ -271,7 +271,7 @@ class Tape:
|
|
|
271
271
|
else:
|
|
272
272
|
g.zero_()
|
|
273
273
|
|
|
274
|
-
def
|
|
274
|
+
def _reset_array_read_flags(self):
|
|
275
275
|
"""
|
|
276
276
|
Reset all recorded array read flags to False
|
|
277
277
|
"""
|
warp/tests/test_array.py
CHANGED
|
@@ -2382,6 +2382,14 @@ def test_kernel_array_from_ptr(test, device):
|
|
|
2382
2382
|
assert_np_equal(arr.numpy(), np.array(((1.0, 2.0, 3.0), (0.0, 0.0, 0.0))))
|
|
2383
2383
|
|
|
2384
2384
|
|
|
2385
|
+
def test_array_from_int32_domain(test, device):
|
|
2386
|
+
wp.zeros(np.array([1504, 1080, 520], dtype=np.int32), dtype=wp.float32, device=device)
|
|
2387
|
+
|
|
2388
|
+
|
|
2389
|
+
def test_array_from_int64_domain(test, device):
|
|
2390
|
+
wp.zeros(np.array([1504, 1080, 520], dtype=np.int64), dtype=wp.float32, device=device)
|
|
2391
|
+
|
|
2392
|
+
|
|
2385
2393
|
devices = get_test_devices()
|
|
2386
2394
|
|
|
2387
2395
|
|
|
@@ -2443,6 +2451,9 @@ add_function_test(TestArray, "test_array_from_numpy", test_array_from_numpy, dev
|
|
|
2443
2451
|
add_function_test(TestArray, "test_direct_from_numpy", test_direct_from_numpy, devices=["cpu"])
|
|
2444
2452
|
add_function_test(TestArray, "test_kernel_array_from_ptr", test_kernel_array_from_ptr, devices=devices)
|
|
2445
2453
|
|
|
2454
|
+
add_function_test(TestArray, "test_array_from_int32_domain", test_array_from_int32_domain, devices=devices)
|
|
2455
|
+
add_function_test(TestArray, "test_array_from_int64_domain", test_array_from_int64_domain, devices=devices)
|
|
2456
|
+
|
|
2446
2457
|
try:
|
|
2447
2458
|
import torch
|
|
2448
2459
|
|
warp/tests/test_async.py
CHANGED
|
@@ -21,7 +21,9 @@ class Capturable:
|
|
|
21
21
|
|
|
22
22
|
def __enter__(self):
|
|
23
23
|
if self.use_graph:
|
|
24
|
-
|
|
24
|
+
# preload module before graph capture
|
|
25
|
+
wp.load_module(device=wp.get_device())
|
|
26
|
+
wp.capture_begin(stream=self.stream, force_module_load=False)
|
|
25
27
|
|
|
26
28
|
def __exit__(self, exc_type, exc_value, traceback):
|
|
27
29
|
if self.use_graph:
|