warp-lang 1.9.0__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.
- warp/__init__.pyi +1420 -2
- warp/bin/warp-clang.so +0 -0
- warp/bin/warp.so +0 -0
- warp/build_dll.py +322 -72
- warp/builtins.py +289 -23
- warp/codegen.py +5 -0
- warp/config.py +1 -1
- warp/context.py +243 -32
- warp/examples/interop/example_jax_kernel.py +2 -1
- warp/jax_experimental/custom_call.py +24 -1
- warp/jax_experimental/ffi.py +20 -0
- warp/jax_experimental/xla_ffi.py +16 -7
- warp/native/builtin.h +4 -4
- warp/native/sort.cu +22 -13
- warp/native/sort.h +2 -0
- warp/native/tile.h +188 -13
- warp/native/vec.h +0 -53
- warp/native/warp.cpp +3 -3
- warp/native/warp.cu +60 -30
- warp/native/warp.h +3 -3
- warp/render/render_opengl.py +14 -12
- warp/render/render_usd.py +1 -0
- warp/tests/geometry/test_hash_grid.py +38 -0
- warp/tests/interop/test_jax.py +608 -28
- warp/tests/test_array.py +2 -0
- warp/tests/test_codegen.py +1 -1
- warp/tests/test_fem.py +4 -4
- warp/tests/test_map.py +14 -0
- warp/tests/test_tuple.py +96 -0
- warp/tests/test_types.py +61 -0
- warp/tests/tile/test_tile.py +61 -0
- warp/types.py +17 -3
- {warp_lang-1.9.0.dist-info → warp_lang-1.9.1.dist-info}/METADATA +5 -8
- {warp_lang-1.9.0.dist-info → warp_lang-1.9.1.dist-info}/RECORD +37 -37
- {warp_lang-1.9.0.dist-info → warp_lang-1.9.1.dist-info}/WHEEL +0 -0
- {warp_lang-1.9.0.dist-info → warp_lang-1.9.1.dist-info}/licenses/LICENSE.md +0 -0
- {warp_lang-1.9.0.dist-info → warp_lang-1.9.1.dist-info}/top_level.txt +0 -0
warp/builtins.py
CHANGED
|
@@ -126,6 +126,7 @@ add_builtin(
|
|
|
126
126
|
value_func=sametypes_create_value_func(Scalar),
|
|
127
127
|
doc="Return -1 if ``x`` < 0, return 1 otherwise.",
|
|
128
128
|
group="Scalar Math",
|
|
129
|
+
missing_grad=True,
|
|
129
130
|
)
|
|
130
131
|
|
|
131
132
|
add_builtin(
|
|
@@ -134,6 +135,7 @@ add_builtin(
|
|
|
134
135
|
value_func=sametypes_create_value_func(Scalar),
|
|
135
136
|
doc="Return 1.0 if ``x`` < 0.0, return 0.0 otherwise.",
|
|
136
137
|
group="Scalar Math",
|
|
138
|
+
missing_grad=True,
|
|
137
139
|
)
|
|
138
140
|
add_builtin(
|
|
139
141
|
"nonzero",
|
|
@@ -141,6 +143,7 @@ add_builtin(
|
|
|
141
143
|
value_func=sametypes_create_value_func(Scalar),
|
|
142
144
|
doc="Return 1.0 if ``x`` is not equal to zero, return 0.0 otherwise.",
|
|
143
145
|
group="Scalar Math",
|
|
146
|
+
missing_grad=True,
|
|
144
147
|
)
|
|
145
148
|
|
|
146
149
|
add_builtin(
|
|
@@ -292,6 +295,7 @@ add_builtin(
|
|
|
292
295
|
|
|
293
296
|
This is the most intuitive form of rounding in the colloquial sense, but can be slower than other options like :func:`warp.rint()`.
|
|
294
297
|
Differs from :func:`numpy.round()`, which behaves the same way as :func:`numpy.rint()`.""",
|
|
298
|
+
missing_grad=True,
|
|
295
299
|
)
|
|
296
300
|
|
|
297
301
|
add_builtin(
|
|
@@ -302,6 +306,7 @@ add_builtin(
|
|
|
302
306
|
doc="""Return the nearest integer value to ``x``, rounding halfway cases to nearest even integer.
|
|
303
307
|
|
|
304
308
|
It is generally faster than :func:`warp.round()`. Equivalent to :func:`numpy.rint()`.""",
|
|
309
|
+
missing_grad=True,
|
|
305
310
|
)
|
|
306
311
|
|
|
307
312
|
add_builtin(
|
|
@@ -314,6 +319,7 @@ add_builtin(
|
|
|
314
319
|
In other words, it discards the fractional part of ``x``.
|
|
315
320
|
It is similar to casting ``float(int(a))``, but preserves the negative sign when ``x`` is in the range [-0.0, -1.0).
|
|
316
321
|
Equivalent to :func:`numpy.trunc()` and :func:`numpy.fix()`.""",
|
|
322
|
+
missing_grad=True,
|
|
317
323
|
)
|
|
318
324
|
|
|
319
325
|
add_builtin(
|
|
@@ -322,6 +328,7 @@ add_builtin(
|
|
|
322
328
|
value_func=sametypes_create_value_func(Float),
|
|
323
329
|
group="Scalar Math",
|
|
324
330
|
doc="""Return the largest integer that is less than or equal to ``x``.""",
|
|
331
|
+
missing_grad=True,
|
|
325
332
|
)
|
|
326
333
|
|
|
327
334
|
add_builtin(
|
|
@@ -330,6 +337,7 @@ add_builtin(
|
|
|
330
337
|
value_func=sametypes_create_value_func(Float),
|
|
331
338
|
group="Scalar Math",
|
|
332
339
|
doc="""Return the smallest integer that is greater than or equal to ``x``.""",
|
|
340
|
+
missing_grad=True,
|
|
333
341
|
)
|
|
334
342
|
|
|
335
343
|
add_builtin(
|
|
@@ -340,6 +348,7 @@ add_builtin(
|
|
|
340
348
|
doc="""Retrieve the fractional part of ``x``.
|
|
341
349
|
|
|
342
350
|
In other words, it discards the integer part of ``x`` and is equivalent to ``x - trunc(x)``.""",
|
|
351
|
+
missing_grad=True,
|
|
343
352
|
)
|
|
344
353
|
|
|
345
354
|
add_builtin(
|
|
@@ -348,6 +357,7 @@ add_builtin(
|
|
|
348
357
|
value_type=builtins.bool,
|
|
349
358
|
group="Scalar Math",
|
|
350
359
|
doc="""Return ``True`` if ``a`` is a finite number, otherwise return ``False``.""",
|
|
360
|
+
missing_grad=True,
|
|
351
361
|
)
|
|
352
362
|
add_builtin(
|
|
353
363
|
"isfinite",
|
|
@@ -355,6 +365,7 @@ add_builtin(
|
|
|
355
365
|
value_type=builtins.bool,
|
|
356
366
|
group="Vector Math",
|
|
357
367
|
doc="Return ``True`` if all elements of the vector ``a`` are finite, otherwise return ``False``.",
|
|
368
|
+
missing_grad=True,
|
|
358
369
|
)
|
|
359
370
|
add_builtin(
|
|
360
371
|
"isfinite",
|
|
@@ -362,6 +373,7 @@ add_builtin(
|
|
|
362
373
|
value_type=builtins.bool,
|
|
363
374
|
group="Vector Math",
|
|
364
375
|
doc="Return ``True`` if all elements of the quaternion ``a`` are finite, otherwise return ``False``.",
|
|
376
|
+
missing_grad=True,
|
|
365
377
|
)
|
|
366
378
|
add_builtin(
|
|
367
379
|
"isfinite",
|
|
@@ -369,6 +381,7 @@ add_builtin(
|
|
|
369
381
|
value_type=builtins.bool,
|
|
370
382
|
group="Vector Math",
|
|
371
383
|
doc="Return ``True`` if all elements of the matrix ``a`` are finite, otherwise return ``False``.",
|
|
384
|
+
missing_grad=True,
|
|
372
385
|
)
|
|
373
386
|
|
|
374
387
|
add_builtin(
|
|
@@ -377,6 +390,7 @@ add_builtin(
|
|
|
377
390
|
value_type=builtins.bool,
|
|
378
391
|
doc="Return ``True`` if ``a`` is NaN, otherwise return ``False``.",
|
|
379
392
|
group="Scalar Math",
|
|
393
|
+
missing_grad=True,
|
|
380
394
|
)
|
|
381
395
|
add_builtin(
|
|
382
396
|
"isnan",
|
|
@@ -384,6 +398,7 @@ add_builtin(
|
|
|
384
398
|
value_type=builtins.bool,
|
|
385
399
|
group="Vector Math",
|
|
386
400
|
doc="Return ``True`` if any element of the vector ``a`` is NaN, otherwise return ``False``.",
|
|
401
|
+
missing_grad=True,
|
|
387
402
|
)
|
|
388
403
|
add_builtin(
|
|
389
404
|
"isnan",
|
|
@@ -391,6 +406,7 @@ add_builtin(
|
|
|
391
406
|
value_type=builtins.bool,
|
|
392
407
|
group="Vector Math",
|
|
393
408
|
doc="Return ``True`` if any element of the quaternion ``a`` is NaN, otherwise return ``False``.",
|
|
409
|
+
missing_grad=True,
|
|
394
410
|
)
|
|
395
411
|
add_builtin(
|
|
396
412
|
"isnan",
|
|
@@ -398,6 +414,7 @@ add_builtin(
|
|
|
398
414
|
value_type=builtins.bool,
|
|
399
415
|
group="Vector Math",
|
|
400
416
|
doc="Return ``True`` if any element of the matrix ``a`` is NaN, otherwise return ``False``.",
|
|
417
|
+
missing_grad=True,
|
|
401
418
|
)
|
|
402
419
|
|
|
403
420
|
add_builtin(
|
|
@@ -406,6 +423,7 @@ add_builtin(
|
|
|
406
423
|
value_type=builtins.bool,
|
|
407
424
|
group="Scalar Math",
|
|
408
425
|
doc="""Return ``True`` if ``a`` is positive or negative infinity, otherwise return ``False``.""",
|
|
426
|
+
missing_grad=True,
|
|
409
427
|
)
|
|
410
428
|
add_builtin(
|
|
411
429
|
"isinf",
|
|
@@ -413,6 +431,7 @@ add_builtin(
|
|
|
413
431
|
value_type=builtins.bool,
|
|
414
432
|
group="Vector Math",
|
|
415
433
|
doc="Return ``True`` if any element of the vector ``a`` is positive or negative infinity, otherwise return ``False``.",
|
|
434
|
+
missing_grad=True,
|
|
416
435
|
)
|
|
417
436
|
add_builtin(
|
|
418
437
|
"isinf",
|
|
@@ -420,6 +439,7 @@ add_builtin(
|
|
|
420
439
|
value_type=builtins.bool,
|
|
421
440
|
group="Vector Math",
|
|
422
441
|
doc="Return ``True`` if any element of the quaternion ``a`` is positive or negative infinity, otherwise return ``False``.",
|
|
442
|
+
missing_grad=True,
|
|
423
443
|
)
|
|
424
444
|
add_builtin(
|
|
425
445
|
"isinf",
|
|
@@ -427,6 +447,7 @@ add_builtin(
|
|
|
427
447
|
value_type=builtins.bool,
|
|
428
448
|
group="Vector Math",
|
|
429
449
|
doc="Return ``True`` if any element of the matrix ``a`` is positive or negative infinity, otherwise return ``False``.",
|
|
450
|
+
missing_grad=True,
|
|
430
451
|
)
|
|
431
452
|
|
|
432
453
|
|
|
@@ -1182,6 +1203,7 @@ add_builtin(
|
|
|
1182
1203
|
doc="Create an identity matrix with shape=(n,n) with the type given by ``dtype``.",
|
|
1183
1204
|
group="Vector Math",
|
|
1184
1205
|
export=False,
|
|
1206
|
+
missing_grad=True,
|
|
1185
1207
|
)
|
|
1186
1208
|
|
|
1187
1209
|
|
|
@@ -1546,6 +1568,7 @@ add_builtin(
|
|
|
1546
1568
|
group="Quaternion Math",
|
|
1547
1569
|
doc="Construct an identity quaternion with zero imaginary part and real part of 1.0",
|
|
1548
1570
|
export=True,
|
|
1571
|
+
missing_grad=True,
|
|
1549
1572
|
)
|
|
1550
1573
|
|
|
1551
1574
|
add_builtin(
|
|
@@ -1761,6 +1784,7 @@ add_builtin(
|
|
|
1761
1784
|
doc="Construct a spatial transform vector of given dtype.",
|
|
1762
1785
|
group="Spatial Math",
|
|
1763
1786
|
export=False,
|
|
1787
|
+
missing_grad=True,
|
|
1764
1788
|
)
|
|
1765
1789
|
|
|
1766
1790
|
|
|
@@ -1795,6 +1819,7 @@ add_builtin(
|
|
|
1795
1819
|
group="Transformations",
|
|
1796
1820
|
doc="Construct an identity transform with zero translation and identity rotation.",
|
|
1797
1821
|
export=True,
|
|
1822
|
+
missing_grad=True,
|
|
1798
1823
|
)
|
|
1799
1824
|
|
|
1800
1825
|
add_builtin(
|
|
@@ -3986,6 +4011,7 @@ add_builtin(
|
|
|
3986
4011
|
""",
|
|
3987
4012
|
group="Tile Primitives",
|
|
3988
4013
|
export=False,
|
|
4014
|
+
missing_grad=True,
|
|
3989
4015
|
)
|
|
3990
4016
|
|
|
3991
4017
|
|
|
@@ -4039,6 +4065,7 @@ add_builtin(
|
|
|
4039
4065
|
""",
|
|
4040
4066
|
group="Tile Primitives",
|
|
4041
4067
|
export=False,
|
|
4068
|
+
missing_grad=True,
|
|
4042
4069
|
)
|
|
4043
4070
|
|
|
4044
4071
|
|
|
@@ -4092,6 +4119,7 @@ add_builtin(
|
|
|
4092
4119
|
""",
|
|
4093
4120
|
group="Tile Primitives",
|
|
4094
4121
|
export=False,
|
|
4122
|
+
missing_grad=True,
|
|
4095
4123
|
)
|
|
4096
4124
|
|
|
4097
4125
|
|
|
@@ -4144,6 +4172,7 @@ add_builtin(
|
|
|
4144
4172
|
""",
|
|
4145
4173
|
group="Tile Primitives",
|
|
4146
4174
|
export=False,
|
|
4175
|
+
missing_grad=True,
|
|
4147
4176
|
)
|
|
4148
4177
|
|
|
4149
4178
|
|
|
@@ -4196,6 +4225,7 @@ add_builtin(
|
|
|
4196
4225
|
""",
|
|
4197
4226
|
group="Tile Primitives",
|
|
4198
4227
|
export=False,
|
|
4228
|
+
missing_grad=True,
|
|
4199
4229
|
)
|
|
4200
4230
|
|
|
4201
4231
|
|
|
@@ -4253,6 +4283,7 @@ add_builtin(
|
|
|
4253
4283
|
""",
|
|
4254
4284
|
group="Tile Primitives",
|
|
4255
4285
|
export=False,
|
|
4286
|
+
missing_grad=True,
|
|
4256
4287
|
)
|
|
4257
4288
|
|
|
4258
4289
|
|
|
@@ -4316,6 +4347,7 @@ add_builtin(
|
|
|
4316
4347
|
""",
|
|
4317
4348
|
group="Tile Primitives",
|
|
4318
4349
|
export=False,
|
|
4350
|
+
missing_grad=True,
|
|
4319
4351
|
)
|
|
4320
4352
|
|
|
4321
4353
|
|
|
@@ -4379,6 +4411,7 @@ add_builtin(
|
|
|
4379
4411
|
""",
|
|
4380
4412
|
group="Tile Primitives",
|
|
4381
4413
|
export=False,
|
|
4414
|
+
missing_grad=True,
|
|
4382
4415
|
)
|
|
4383
4416
|
|
|
4384
4417
|
|
|
@@ -4632,6 +4665,7 @@ add_builtin(
|
|
|
4632
4665
|
doc="WIP",
|
|
4633
4666
|
group="Utility",
|
|
4634
4667
|
hidden=True,
|
|
4668
|
+
missing_grad=True,
|
|
4635
4669
|
)
|
|
4636
4670
|
|
|
4637
4671
|
add_builtin(
|
|
@@ -4647,6 +4681,7 @@ add_builtin(
|
|
|
4647
4681
|
doc="WIP",
|
|
4648
4682
|
group="Utility",
|
|
4649
4683
|
hidden=True,
|
|
4684
|
+
missing_grad=True,
|
|
4650
4685
|
)
|
|
4651
4686
|
|
|
4652
4687
|
add_builtin(
|
|
@@ -4656,6 +4691,7 @@ add_builtin(
|
|
|
4656
4691
|
doc="WIP",
|
|
4657
4692
|
group="Utility",
|
|
4658
4693
|
hidden=True,
|
|
4694
|
+
missing_grad=True,
|
|
4659
4695
|
)
|
|
4660
4696
|
|
|
4661
4697
|
add_builtin(
|
|
@@ -4707,6 +4743,7 @@ add_builtin(
|
|
|
4707
4743
|
:param low: The lower bound of the bounding box in BVH space
|
|
4708
4744
|
:param high: The upper bound of the bounding box in BVH space""",
|
|
4709
4745
|
export=False,
|
|
4746
|
+
missing_grad=True,
|
|
4710
4747
|
)
|
|
4711
4748
|
|
|
4712
4749
|
add_builtin(
|
|
@@ -4722,6 +4759,7 @@ add_builtin(
|
|
|
4722
4759
|
:param start: The start of the ray in BVH space
|
|
4723
4760
|
:param dir: The direction of the ray in BVH space""",
|
|
4724
4761
|
export=False,
|
|
4762
|
+
missing_grad=True,
|
|
4725
4763
|
)
|
|
4726
4764
|
|
|
4727
4765
|
add_builtin(
|
|
@@ -4732,6 +4770,7 @@ add_builtin(
|
|
|
4732
4770
|
doc="""Move to the next bound returned by the query.
|
|
4733
4771
|
The index of the current bound is stored in ``index``, returns ``False`` if there are no more overlapping bound.""",
|
|
4734
4772
|
export=False,
|
|
4773
|
+
missing_grad=True,
|
|
4735
4774
|
)
|
|
4736
4775
|
|
|
4737
4776
|
add_builtin(
|
|
@@ -5066,12 +5105,13 @@ add_builtin(
|
|
|
5066
5105
|
group="Geometry",
|
|
5067
5106
|
doc="""Construct an axis-aligned bounding box query against a :class:`Mesh`.
|
|
5068
5107
|
|
|
5069
|
-
This query can be used to iterate over all triangles inside a volume.
|
|
5108
|
+
This query can be used to iterate over all bounding boxes of the triangles inside a volume.
|
|
5070
5109
|
|
|
5071
5110
|
:param id: The mesh identifier
|
|
5072
5111
|
:param low: The lower bound of the bounding box in mesh space
|
|
5073
5112
|
:param high: The upper bound of the bounding box in mesh space""",
|
|
5074
5113
|
export=False,
|
|
5114
|
+
missing_grad=True,
|
|
5075
5115
|
)
|
|
5076
5116
|
|
|
5077
5117
|
add_builtin(
|
|
@@ -5079,10 +5119,11 @@ add_builtin(
|
|
|
5079
5119
|
input_types={"query": MeshQueryAABB, "index": int},
|
|
5080
5120
|
value_type=builtins.bool,
|
|
5081
5121
|
group="Geometry",
|
|
5082
|
-
doc="""Move to the next triangle
|
|
5122
|
+
doc="""Move to the next triangle whose bounding box overlaps the query bounding box.
|
|
5083
5123
|
|
|
5084
5124
|
The index of the current face is stored in ``index``, returns ``False`` if there are no more overlapping triangles.""",
|
|
5085
5125
|
export=False,
|
|
5126
|
+
missing_grad=True,
|
|
5086
5127
|
)
|
|
5087
5128
|
|
|
5088
5129
|
add_builtin(
|
|
@@ -5112,6 +5153,7 @@ add_builtin(
|
|
|
5112
5153
|
|
|
5113
5154
|
This query can be used to iterate over all neighboring point within a fixed radius from the query point.""",
|
|
5114
5155
|
export=False,
|
|
5156
|
+
missing_grad=True,
|
|
5115
5157
|
)
|
|
5116
5158
|
|
|
5117
5159
|
add_builtin(
|
|
@@ -5123,6 +5165,7 @@ add_builtin(
|
|
|
5123
5165
|
|
|
5124
5166
|
The index of the current neighbor is stored in ``index``, returns ``False`` if there are no more neighbors.""",
|
|
5125
5167
|
export=False,
|
|
5168
|
+
missing_grad=True,
|
|
5126
5169
|
)
|
|
5127
5170
|
|
|
5128
5171
|
add_builtin(
|
|
@@ -5136,6 +5179,7 @@ add_builtin(
|
|
|
5136
5179
|
|
|
5137
5180
|
Returns -1 if the :class:`HashGrid` has not been reserved.""",
|
|
5138
5181
|
export=False,
|
|
5182
|
+
missing_grad=True,
|
|
5139
5183
|
)
|
|
5140
5184
|
|
|
5141
5185
|
add_builtin(
|
|
@@ -5147,6 +5191,7 @@ add_builtin(
|
|
|
5147
5191
|
|
|
5148
5192
|
Returns > 0 if triangles intersect.""",
|
|
5149
5193
|
export=False,
|
|
5194
|
+
missing_grad=True,
|
|
5150
5195
|
)
|
|
5151
5196
|
|
|
5152
5197
|
add_builtin(
|
|
@@ -5166,6 +5211,7 @@ add_builtin(
|
|
|
5166
5211
|
group="Geometry",
|
|
5167
5212
|
doc="""Evaluates the face normal the mesh given a face index.""",
|
|
5168
5213
|
export=False,
|
|
5214
|
+
missing_grad=True,
|
|
5169
5215
|
)
|
|
5170
5216
|
|
|
5171
5217
|
add_builtin(
|
|
@@ -5175,6 +5221,7 @@ add_builtin(
|
|
|
5175
5221
|
group="Geometry",
|
|
5176
5222
|
doc="""Returns the point of the mesh given a index.""",
|
|
5177
5223
|
export=False,
|
|
5224
|
+
missing_grad=True,
|
|
5178
5225
|
)
|
|
5179
5226
|
|
|
5180
5227
|
add_builtin(
|
|
@@ -5184,6 +5231,7 @@ add_builtin(
|
|
|
5184
5231
|
group="Geometry",
|
|
5185
5232
|
doc="""Returns the velocity of the mesh given a index.""",
|
|
5186
5233
|
export=False,
|
|
5234
|
+
missing_grad=True,
|
|
5187
5235
|
)
|
|
5188
5236
|
|
|
5189
5237
|
add_builtin(
|
|
@@ -5193,6 +5241,7 @@ add_builtin(
|
|
|
5193
5241
|
group="Geometry",
|
|
5194
5242
|
doc="""Returns the point-index of the mesh given a face-vertex index.""",
|
|
5195
5243
|
export=False,
|
|
5244
|
+
missing_grad=True,
|
|
5196
5245
|
)
|
|
5197
5246
|
|
|
5198
5247
|
|
|
@@ -5233,12 +5282,32 @@ add_builtin(
|
|
|
5233
5282
|
# ---------------------------------
|
|
5234
5283
|
# Iterators
|
|
5235
5284
|
|
|
5236
|
-
add_builtin("iter_next", input_types={"range": range_t}, value_type=int, group="Utility", export=False, hidden=True)
|
|
5237
5285
|
add_builtin(
|
|
5238
|
-
"iter_next",
|
|
5286
|
+
"iter_next",
|
|
5287
|
+
input_types={"range": range_t},
|
|
5288
|
+
value_type=int,
|
|
5289
|
+
group="Utility",
|
|
5290
|
+
export=False,
|
|
5291
|
+
hidden=True,
|
|
5292
|
+
missing_grad=True,
|
|
5293
|
+
)
|
|
5294
|
+
add_builtin(
|
|
5295
|
+
"iter_next",
|
|
5296
|
+
input_types={"query": HashGridQuery},
|
|
5297
|
+
value_type=int,
|
|
5298
|
+
group="Utility",
|
|
5299
|
+
export=False,
|
|
5300
|
+
hidden=True,
|
|
5301
|
+
missing_grad=True,
|
|
5239
5302
|
)
|
|
5240
5303
|
add_builtin(
|
|
5241
|
-
"iter_next",
|
|
5304
|
+
"iter_next",
|
|
5305
|
+
input_types={"query": MeshQueryAABB},
|
|
5306
|
+
value_type=int,
|
|
5307
|
+
group="Utility",
|
|
5308
|
+
export=False,
|
|
5309
|
+
hidden=True,
|
|
5310
|
+
missing_grad=True,
|
|
5242
5311
|
)
|
|
5243
5312
|
|
|
5244
5313
|
add_builtin(
|
|
@@ -5249,6 +5318,7 @@ add_builtin(
|
|
|
5249
5318
|
group="Utility",
|
|
5250
5319
|
doc="""Returns the range in reversed order.""",
|
|
5251
5320
|
export=False,
|
|
5321
|
+
missing_grad=True,
|
|
5252
5322
|
)
|
|
5253
5323
|
|
|
5254
5324
|
# ---------------------------------
|
|
@@ -5397,6 +5467,7 @@ add_builtin(
|
|
|
5397
5467
|
doc="""Returns the value of voxel with coordinates ``i``, ``j``, ``k`` for a volume of type type `dtype`.
|
|
5398
5468
|
|
|
5399
5469
|
If the voxel at this index does not exist, this function returns the background value.""",
|
|
5470
|
+
missing_grad=True,
|
|
5400
5471
|
)
|
|
5401
5472
|
|
|
5402
5473
|
|
|
@@ -5417,6 +5488,7 @@ add_builtin(
|
|
|
5417
5488
|
export=False,
|
|
5418
5489
|
group="Volumes",
|
|
5419
5490
|
doc="""Store ``value`` at the voxel with coordinates ``i``, ``j``, ``k``.""",
|
|
5491
|
+
missing_grad=True,
|
|
5420
5492
|
)
|
|
5421
5493
|
|
|
5422
5494
|
add_builtin(
|
|
@@ -5447,6 +5519,7 @@ add_builtin(
|
|
|
5447
5519
|
doc="""Returns the value of voxel with coordinates ``i``, ``j``, ``k``.
|
|
5448
5520
|
|
|
5449
5521
|
If the voxel at this index does not exist, this function returns the background value""",
|
|
5522
|
+
missing_grad=True,
|
|
5450
5523
|
)
|
|
5451
5524
|
|
|
5452
5525
|
add_builtin(
|
|
@@ -5455,6 +5528,7 @@ add_builtin(
|
|
|
5455
5528
|
group="Volumes",
|
|
5456
5529
|
doc="""Store ``value`` at the voxel with coordinates ``i``, ``j``, ``k``.""",
|
|
5457
5530
|
export=False,
|
|
5531
|
+
missing_grad=True,
|
|
5458
5532
|
)
|
|
5459
5533
|
|
|
5460
5534
|
add_builtin(
|
|
@@ -5475,6 +5549,7 @@ add_builtin(
|
|
|
5475
5549
|
doc="""Returns the vector value of voxel with coordinates ``i``, ``j``, ``k``.
|
|
5476
5550
|
|
|
5477
5551
|
If the voxel at this index does not exist, this function returns the background value.""",
|
|
5552
|
+
missing_grad=True,
|
|
5478
5553
|
)
|
|
5479
5554
|
|
|
5480
5555
|
add_builtin(
|
|
@@ -5483,6 +5558,7 @@ add_builtin(
|
|
|
5483
5558
|
group="Volumes",
|
|
5484
5559
|
doc="""Store ``value`` at the voxel with coordinates ``i``, ``j``, ``k``.""",
|
|
5485
5560
|
export=False,
|
|
5561
|
+
missing_grad=True,
|
|
5486
5562
|
)
|
|
5487
5563
|
|
|
5488
5564
|
add_builtin(
|
|
@@ -5501,6 +5577,7 @@ add_builtin(
|
|
|
5501
5577
|
doc="""Returns the :class:`int32` value of voxel with coordinates ``i``, ``j``, ``k``.
|
|
5502
5578
|
|
|
5503
5579
|
If the voxel at this index does not exist, this function returns the background value.""",
|
|
5580
|
+
missing_grad=True,
|
|
5504
5581
|
)
|
|
5505
5582
|
|
|
5506
5583
|
add_builtin(
|
|
@@ -5509,6 +5586,7 @@ add_builtin(
|
|
|
5509
5586
|
group="Volumes",
|
|
5510
5587
|
doc="""Store ``value`` at the voxel with coordinates ``i``, ``j``, ``k``.""",
|
|
5511
5588
|
export=False,
|
|
5589
|
+
missing_grad=True,
|
|
5512
5590
|
)
|
|
5513
5591
|
|
|
5514
5592
|
|
|
@@ -5590,6 +5668,7 @@ add_builtin(
|
|
|
5590
5668
|
If the voxel at this index does not exist, this function returns -1.
|
|
5591
5669
|
This function is available for both index grids and classical volumes.
|
|
5592
5670
|
""",
|
|
5671
|
+
missing_grad=True,
|
|
5593
5672
|
)
|
|
5594
5673
|
|
|
5595
5674
|
add_builtin(
|
|
@@ -5631,6 +5710,7 @@ add_builtin(
|
|
|
5631
5710
|
value_type=uint32,
|
|
5632
5711
|
group="Random",
|
|
5633
5712
|
doc="Initialize a new random number generator given a user-defined seed. Returns a 32-bit integer representing the RNG state.",
|
|
5713
|
+
missing_grad=True,
|
|
5634
5714
|
)
|
|
5635
5715
|
|
|
5636
5716
|
add_builtin(
|
|
@@ -5642,6 +5722,7 @@ add_builtin(
|
|
|
5642
5722
|
|
|
5643
5723
|
This alternative constructor can be useful in parallel programs, where a kernel as a whole should share a seed,
|
|
5644
5724
|
but each thread should generate uncorrelated values. In this case usage should be ``r = rand_init(seed, tid)``""",
|
|
5725
|
+
missing_grad=True,
|
|
5645
5726
|
)
|
|
5646
5727
|
|
|
5647
5728
|
add_builtin(
|
|
@@ -5650,6 +5731,7 @@ add_builtin(
|
|
|
5650
5731
|
value_type=int,
|
|
5651
5732
|
group="Random",
|
|
5652
5733
|
doc="Return a random integer in the range [-2^31, 2^31).",
|
|
5734
|
+
missing_grad=True,
|
|
5653
5735
|
)
|
|
5654
5736
|
add_builtin(
|
|
5655
5737
|
"randi",
|
|
@@ -5657,6 +5739,7 @@ add_builtin(
|
|
|
5657
5739
|
value_type=int,
|
|
5658
5740
|
group="Random",
|
|
5659
5741
|
doc="Return a random integer between [low, high).",
|
|
5742
|
+
missing_grad=True,
|
|
5660
5743
|
)
|
|
5661
5744
|
add_builtin(
|
|
5662
5745
|
"randu",
|
|
@@ -5664,6 +5747,7 @@ add_builtin(
|
|
|
5664
5747
|
value_type=uint32,
|
|
5665
5748
|
group="Random",
|
|
5666
5749
|
doc="Return a random unsigned integer in the range [0, 2^32).",
|
|
5750
|
+
missing_grad=True,
|
|
5667
5751
|
)
|
|
5668
5752
|
add_builtin(
|
|
5669
5753
|
"randu",
|
|
@@ -5671,6 +5755,7 @@ add_builtin(
|
|
|
5671
5755
|
value_type=uint32,
|
|
5672
5756
|
group="Random",
|
|
5673
5757
|
doc="Return a random unsigned integer between [low, high).",
|
|
5758
|
+
missing_grad=True,
|
|
5674
5759
|
)
|
|
5675
5760
|
add_builtin(
|
|
5676
5761
|
"randf",
|
|
@@ -5678,6 +5763,7 @@ add_builtin(
|
|
|
5678
5763
|
value_type=float,
|
|
5679
5764
|
group="Random",
|
|
5680
5765
|
doc="Return a random float between [0.0, 1.0).",
|
|
5766
|
+
missing_grad=True,
|
|
5681
5767
|
)
|
|
5682
5768
|
add_builtin(
|
|
5683
5769
|
"randf",
|
|
@@ -5685,6 +5771,7 @@ add_builtin(
|
|
|
5685
5771
|
value_type=float,
|
|
5686
5772
|
group="Random",
|
|
5687
5773
|
doc="Return a random float between [low, high).",
|
|
5774
|
+
missing_grad=True,
|
|
5688
5775
|
)
|
|
5689
5776
|
add_builtin(
|
|
5690
5777
|
"randn",
|
|
@@ -5692,6 +5779,7 @@ add_builtin(
|
|
|
5692
5779
|
value_type=float,
|
|
5693
5780
|
group="Random",
|
|
5694
5781
|
doc="Sample a normal (Gaussian) distribution of mean 0 and variance 1. ",
|
|
5782
|
+
missing_grad=True,
|
|
5695
5783
|
)
|
|
5696
5784
|
|
|
5697
5785
|
add_builtin(
|
|
@@ -5700,6 +5788,7 @@ add_builtin(
|
|
|
5700
5788
|
value_type=int,
|
|
5701
5789
|
group="Random",
|
|
5702
5790
|
doc="Inverse-transform sample a cumulative distribution function.",
|
|
5791
|
+
missing_grad=True,
|
|
5703
5792
|
)
|
|
5704
5793
|
add_builtin(
|
|
5705
5794
|
"sample_triangle",
|
|
@@ -5707,6 +5796,7 @@ add_builtin(
|
|
|
5707
5796
|
value_type=vec2,
|
|
5708
5797
|
group="Random",
|
|
5709
5798
|
doc="Uniformly sample a triangle. Returns sample barycentric coordinates.",
|
|
5799
|
+
missing_grad=True,
|
|
5710
5800
|
)
|
|
5711
5801
|
add_builtin(
|
|
5712
5802
|
"sample_unit_ring",
|
|
@@ -5714,6 +5804,7 @@ add_builtin(
|
|
|
5714
5804
|
value_type=vec2,
|
|
5715
5805
|
group="Random",
|
|
5716
5806
|
doc="Uniformly sample a ring in the xy plane.",
|
|
5807
|
+
missing_grad=True,
|
|
5717
5808
|
)
|
|
5718
5809
|
add_builtin(
|
|
5719
5810
|
"sample_unit_disk",
|
|
@@ -5721,6 +5812,7 @@ add_builtin(
|
|
|
5721
5812
|
value_type=vec2,
|
|
5722
5813
|
group="Random",
|
|
5723
5814
|
doc="Uniformly sample a disk in the xy plane.",
|
|
5815
|
+
missing_grad=True,
|
|
5724
5816
|
)
|
|
5725
5817
|
add_builtin(
|
|
5726
5818
|
"sample_unit_sphere_surface",
|
|
@@ -5728,6 +5820,7 @@ add_builtin(
|
|
|
5728
5820
|
value_type=vec3,
|
|
5729
5821
|
group="Random",
|
|
5730
5822
|
doc="Uniformly sample a unit sphere surface.",
|
|
5823
|
+
missing_grad=True,
|
|
5731
5824
|
)
|
|
5732
5825
|
add_builtin(
|
|
5733
5826
|
"sample_unit_sphere",
|
|
@@ -5735,6 +5828,7 @@ add_builtin(
|
|
|
5735
5828
|
value_type=vec3,
|
|
5736
5829
|
group="Random",
|
|
5737
5830
|
doc="Uniformly sample a unit sphere.",
|
|
5831
|
+
missing_grad=True,
|
|
5738
5832
|
)
|
|
5739
5833
|
add_builtin(
|
|
5740
5834
|
"sample_unit_hemisphere_surface",
|
|
@@ -5742,6 +5836,7 @@ add_builtin(
|
|
|
5742
5836
|
value_type=vec3,
|
|
5743
5837
|
group="Random",
|
|
5744
5838
|
doc="Uniformly sample a unit hemisphere surface.",
|
|
5839
|
+
missing_grad=True,
|
|
5745
5840
|
)
|
|
5746
5841
|
add_builtin(
|
|
5747
5842
|
"sample_unit_hemisphere",
|
|
@@ -5749,6 +5844,7 @@ add_builtin(
|
|
|
5749
5844
|
value_type=vec3,
|
|
5750
5845
|
group="Random",
|
|
5751
5846
|
doc="Uniformly sample a unit hemisphere.",
|
|
5847
|
+
missing_grad=True,
|
|
5752
5848
|
)
|
|
5753
5849
|
add_builtin(
|
|
5754
5850
|
"sample_unit_square",
|
|
@@ -5756,6 +5852,7 @@ add_builtin(
|
|
|
5756
5852
|
value_type=vec2,
|
|
5757
5853
|
group="Random",
|
|
5758
5854
|
doc="Uniformly sample a unit square.",
|
|
5855
|
+
missing_grad=True,
|
|
5759
5856
|
)
|
|
5760
5857
|
add_builtin(
|
|
5761
5858
|
"sample_unit_cube",
|
|
@@ -5763,6 +5860,7 @@ add_builtin(
|
|
|
5763
5860
|
value_type=vec3,
|
|
5764
5861
|
group="Random",
|
|
5765
5862
|
doc="Uniformly sample a unit cube.",
|
|
5863
|
+
missing_grad=True,
|
|
5766
5864
|
)
|
|
5767
5865
|
|
|
5768
5866
|
add_builtin(
|
|
@@ -5774,6 +5872,7 @@ add_builtin(
|
|
|
5774
5872
|
|
|
5775
5873
|
:param state: RNG state
|
|
5776
5874
|
:param lam: The expected value of the distribution""",
|
|
5875
|
+
missing_grad=True,
|
|
5777
5876
|
)
|
|
5778
5877
|
|
|
5779
5878
|
add_builtin(
|
|
@@ -5891,9 +5990,16 @@ add_builtin(
|
|
|
5891
5990
|
dispatch_func=printf_dispatch_func,
|
|
5892
5991
|
group="Utility",
|
|
5893
5992
|
doc="Allows printing formatted strings using C-style format specifiers.",
|
|
5993
|
+
missing_grad=True,
|
|
5894
5994
|
)
|
|
5895
5995
|
|
|
5896
|
-
add_builtin(
|
|
5996
|
+
add_builtin(
|
|
5997
|
+
"print",
|
|
5998
|
+
input_types={"value": Any},
|
|
5999
|
+
doc="Print variable to stdout",
|
|
6000
|
+
export=False,
|
|
6001
|
+
group="Utility",
|
|
6002
|
+
)
|
|
5897
6003
|
|
|
5898
6004
|
add_builtin(
|
|
5899
6005
|
"breakpoint",
|
|
@@ -5903,6 +6009,7 @@ add_builtin(
|
|
|
5903
6009
|
group="Utility",
|
|
5904
6010
|
namespace="",
|
|
5905
6011
|
native_func="__debugbreak",
|
|
6012
|
+
missing_grad=True,
|
|
5906
6013
|
)
|
|
5907
6014
|
|
|
5908
6015
|
# helpers
|
|
@@ -5920,6 +6027,7 @@ add_builtin(
|
|
|
5920
6027
|
This function may not be called from user-defined Warp functions.""",
|
|
5921
6028
|
namespace="",
|
|
5922
6029
|
native_func="builtin_tid1d",
|
|
6030
|
+
missing_grad=True,
|
|
5923
6031
|
)
|
|
5924
6032
|
|
|
5925
6033
|
add_builtin(
|
|
@@ -5930,6 +6038,7 @@ add_builtin(
|
|
|
5930
6038
|
doc="Returns the number of threads in the current block.",
|
|
5931
6039
|
namespace="",
|
|
5932
6040
|
native_func="builtin_block_dim",
|
|
6041
|
+
missing_grad=True,
|
|
5933
6042
|
)
|
|
5934
6043
|
|
|
5935
6044
|
add_builtin(
|
|
@@ -5944,6 +6053,7 @@ add_builtin(
|
|
|
5944
6053
|
This function may not be called from user-defined Warp functions.""",
|
|
5945
6054
|
namespace="",
|
|
5946
6055
|
native_func="builtin_tid2d",
|
|
6056
|
+
missing_grad=True,
|
|
5947
6057
|
)
|
|
5948
6058
|
|
|
5949
6059
|
add_builtin(
|
|
@@ -5958,6 +6068,7 @@ add_builtin(
|
|
|
5958
6068
|
This function may not be called from user-defined Warp functions.""",
|
|
5959
6069
|
namespace="",
|
|
5960
6070
|
native_func="builtin_tid3d",
|
|
6071
|
+
missing_grad=True,
|
|
5961
6072
|
)
|
|
5962
6073
|
|
|
5963
6074
|
add_builtin(
|
|
@@ -5972,17 +6083,37 @@ add_builtin(
|
|
|
5972
6083
|
This function may not be called from user-defined Warp functions.""",
|
|
5973
6084
|
namespace="",
|
|
5974
6085
|
native_func="builtin_tid4d",
|
|
6086
|
+
missing_grad=True,
|
|
5975
6087
|
)
|
|
5976
6088
|
|
|
5977
6089
|
|
|
6090
|
+
def copy_value_func(arg_types: Mapping[str, type], arg_values: Mapping[str, Any]):
|
|
6091
|
+
a = arg_types["a"]
|
|
6092
|
+
|
|
6093
|
+
# if the input is a shared tile, we force a copy
|
|
6094
|
+
if is_tile(a) and a.storage == "shared":
|
|
6095
|
+
return tile(
|
|
6096
|
+
dtype=a.dtype,
|
|
6097
|
+
shape=a.shape,
|
|
6098
|
+
storage=a.storage,
|
|
6099
|
+
strides=a.strides,
|
|
6100
|
+
layout=a.layout,
|
|
6101
|
+
owner=True,
|
|
6102
|
+
)
|
|
6103
|
+
|
|
6104
|
+
return a
|
|
6105
|
+
|
|
6106
|
+
|
|
5978
6107
|
add_builtin(
|
|
5979
6108
|
"copy",
|
|
5980
6109
|
input_types={"a": Any},
|
|
5981
|
-
value_func=
|
|
6110
|
+
value_func=copy_value_func,
|
|
5982
6111
|
hidden=True,
|
|
5983
6112
|
export=False,
|
|
5984
6113
|
group="Utility",
|
|
5985
6114
|
)
|
|
6115
|
+
|
|
6116
|
+
|
|
5986
6117
|
add_builtin(
|
|
5987
6118
|
"assign",
|
|
5988
6119
|
input_types={"dest": Any, "src": Any},
|
|
@@ -5992,6 +6123,37 @@ add_builtin(
|
|
|
5992
6123
|
)
|
|
5993
6124
|
|
|
5994
6125
|
|
|
6126
|
+
def select_value_func(arg_types: Mapping[str, type], arg_values: Mapping[str, Any]):
|
|
6127
|
+
if arg_types is None:
|
|
6128
|
+
return Any
|
|
6129
|
+
|
|
6130
|
+
v_true = arg_types["value_if_true"]
|
|
6131
|
+
v_false = arg_types["value_if_false"]
|
|
6132
|
+
|
|
6133
|
+
if not types_equal(v_true, v_false):
|
|
6134
|
+
raise RuntimeError(
|
|
6135
|
+
f"select() true value type ({v_true}) must be of the same type as the false type ({v_false})"
|
|
6136
|
+
)
|
|
6137
|
+
|
|
6138
|
+
if is_tile(v_false):
|
|
6139
|
+
if v_true.storage == "register":
|
|
6140
|
+
return v_true
|
|
6141
|
+
if v_false.storage == "register":
|
|
6142
|
+
return v_false
|
|
6143
|
+
|
|
6144
|
+
# both v_true and v_false are shared
|
|
6145
|
+
return tile(
|
|
6146
|
+
dtype=v_true.dtype,
|
|
6147
|
+
shape=v_true.shape,
|
|
6148
|
+
storage=v_true.storage,
|
|
6149
|
+
strides=v_true.strides,
|
|
6150
|
+
layout=v_true.layout,
|
|
6151
|
+
owner=True,
|
|
6152
|
+
)
|
|
6153
|
+
|
|
6154
|
+
return v_true
|
|
6155
|
+
|
|
6156
|
+
|
|
5995
6157
|
def select_dispatch_func(input_types: Mapping[str, type], return_type: Any, args: Mapping[str, Var]):
|
|
5996
6158
|
warp.utils.warn(
|
|
5997
6159
|
"wp.select() is deprecated and will be removed in a future\n"
|
|
@@ -6008,7 +6170,7 @@ def select_dispatch_func(input_types: Mapping[str, type], return_type: Any, args
|
|
|
6008
6170
|
add_builtin(
|
|
6009
6171
|
"select",
|
|
6010
6172
|
input_types={"cond": builtins.bool, "value_if_false": Any, "value_if_true": Any},
|
|
6011
|
-
value_func=
|
|
6173
|
+
value_func=select_value_func,
|
|
6012
6174
|
dispatch_func=select_dispatch_func,
|
|
6013
6175
|
doc="""Select between two arguments, if ``cond`` is ``False`` then return ``value_if_false``, otherwise return ``value_if_true``.
|
|
6014
6176
|
|
|
@@ -6021,7 +6183,7 @@ for t in int_types:
|
|
|
6021
6183
|
add_builtin(
|
|
6022
6184
|
"select",
|
|
6023
6185
|
input_types={"cond": t, "value_if_false": Any, "value_if_true": Any},
|
|
6024
|
-
value_func=
|
|
6186
|
+
value_func=select_value_func,
|
|
6025
6187
|
dispatch_func=select_dispatch_func,
|
|
6026
6188
|
doc="""Select between two arguments, if ``cond`` is ``False`` then return ``value_if_false``, otherwise return ``value_if_true``.
|
|
6027
6189
|
|
|
@@ -6033,7 +6195,7 @@ for t in int_types:
|
|
|
6033
6195
|
add_builtin(
|
|
6034
6196
|
"select",
|
|
6035
6197
|
input_types={"arr": array(dtype=Any), "value_if_false": Any, "value_if_true": Any},
|
|
6036
|
-
value_func=
|
|
6198
|
+
value_func=select_value_func,
|
|
6037
6199
|
dispatch_func=select_dispatch_func,
|
|
6038
6200
|
doc="""Select between two arguments, if ``arr`` is null then return ``value_if_false``, otherwise return ``value_if_true``.
|
|
6039
6201
|
|
|
@@ -6043,10 +6205,40 @@ add_builtin(
|
|
|
6043
6205
|
group="Utility",
|
|
6044
6206
|
)
|
|
6045
6207
|
|
|
6208
|
+
|
|
6209
|
+
def where_value_func(arg_types: Mapping[str, type], arg_values: Mapping[str, Any]):
|
|
6210
|
+
if arg_types is None:
|
|
6211
|
+
return Any
|
|
6212
|
+
|
|
6213
|
+
v_true = arg_types["value_if_true"]
|
|
6214
|
+
v_false = arg_types["value_if_false"]
|
|
6215
|
+
|
|
6216
|
+
if not types_equal(v_true, v_false):
|
|
6217
|
+
raise RuntimeError(f"where() true value type ({v_true}) must be of the same type as the false type ({v_false})")
|
|
6218
|
+
|
|
6219
|
+
if is_tile(v_false):
|
|
6220
|
+
if v_true.storage == "register":
|
|
6221
|
+
return v_true
|
|
6222
|
+
if v_false.storage == "register":
|
|
6223
|
+
return v_false
|
|
6224
|
+
|
|
6225
|
+
# both v_true and v_false are shared
|
|
6226
|
+
return tile(
|
|
6227
|
+
dtype=v_true.dtype,
|
|
6228
|
+
shape=v_true.shape,
|
|
6229
|
+
storage=v_true.storage,
|
|
6230
|
+
strides=v_true.strides,
|
|
6231
|
+
layout=v_true.layout,
|
|
6232
|
+
owner=True,
|
|
6233
|
+
)
|
|
6234
|
+
|
|
6235
|
+
return v_true
|
|
6236
|
+
|
|
6237
|
+
|
|
6046
6238
|
add_builtin(
|
|
6047
6239
|
"where",
|
|
6048
6240
|
input_types={"cond": builtins.bool, "value_if_true": Any, "value_if_false": Any},
|
|
6049
|
-
value_func=
|
|
6241
|
+
value_func=where_value_func,
|
|
6050
6242
|
doc="Select between two arguments, if ``cond`` is ``True`` then return ``value_if_true``, otherwise return ``value_if_false``.",
|
|
6051
6243
|
group="Utility",
|
|
6052
6244
|
)
|
|
@@ -6054,14 +6246,14 @@ for t in int_types:
|
|
|
6054
6246
|
add_builtin(
|
|
6055
6247
|
"where",
|
|
6056
6248
|
input_types={"cond": t, "value_if_true": Any, "value_if_false": Any},
|
|
6057
|
-
value_func=
|
|
6249
|
+
value_func=where_value_func,
|
|
6058
6250
|
doc="Select between two arguments, if ``cond`` is ``True`` then return ``value_if_true``, otherwise return ``value_if_false``.",
|
|
6059
6251
|
group="Utility",
|
|
6060
6252
|
)
|
|
6061
6253
|
add_builtin(
|
|
6062
6254
|
"where",
|
|
6063
6255
|
input_types={"arr": array(dtype=Any), "value_if_true": Any, "value_if_false": Any},
|
|
6064
|
-
value_func=
|
|
6256
|
+
value_func=where_value_func,
|
|
6065
6257
|
doc="Select between two arguments, if ``arr`` is not null then return ``value_if_true``, otherwise return ``value_if_false``.",
|
|
6066
6258
|
group="Utility",
|
|
6067
6259
|
)
|
|
@@ -6321,6 +6513,7 @@ add_builtin(
|
|
|
6321
6513
|
hidden=True,
|
|
6322
6514
|
skip_replay=True,
|
|
6323
6515
|
group="Utility",
|
|
6516
|
+
missing_grad=True,
|
|
6324
6517
|
)
|
|
6325
6518
|
|
|
6326
6519
|
|
|
@@ -6337,6 +6530,7 @@ add_builtin(
|
|
|
6337
6530
|
dispatch_func=load_dispatch_func,
|
|
6338
6531
|
hidden=True,
|
|
6339
6532
|
group="Utility",
|
|
6533
|
+
missing_grad=True,
|
|
6340
6534
|
)
|
|
6341
6535
|
|
|
6342
6536
|
|
|
@@ -6653,6 +6847,7 @@ for array_type in array_types:
|
|
|
6653
6847
|
The operation is only atomic on a per-component basis for vectors and matrices.""",
|
|
6654
6848
|
group="Utility",
|
|
6655
6849
|
skip_replay=True,
|
|
6850
|
+
missing_grad=True,
|
|
6656
6851
|
)
|
|
6657
6852
|
add_builtin(
|
|
6658
6853
|
"atomic_cas",
|
|
@@ -6666,6 +6861,7 @@ for array_type in array_types:
|
|
|
6666
6861
|
The operation is only atomic on a per-component basis for vectors and matrices.""",
|
|
6667
6862
|
group="Utility",
|
|
6668
6863
|
skip_replay=True,
|
|
6864
|
+
missing_grad=True,
|
|
6669
6865
|
)
|
|
6670
6866
|
add_builtin(
|
|
6671
6867
|
"atomic_cas",
|
|
@@ -6679,6 +6875,7 @@ for array_type in array_types:
|
|
|
6679
6875
|
The operation is only atomic on a per-component basis for vectors and matrices.""",
|
|
6680
6876
|
group="Utility",
|
|
6681
6877
|
skip_replay=True,
|
|
6878
|
+
missing_grad=True,
|
|
6682
6879
|
)
|
|
6683
6880
|
add_builtin(
|
|
6684
6881
|
"atomic_cas",
|
|
@@ -6700,6 +6897,7 @@ for array_type in array_types:
|
|
|
6700
6897
|
The operation is only atomic on a per-component basis for vectors and matrices.""",
|
|
6701
6898
|
group="Utility",
|
|
6702
6899
|
skip_replay=True,
|
|
6900
|
+
missing_grad=True,
|
|
6703
6901
|
)
|
|
6704
6902
|
|
|
6705
6903
|
add_builtin(
|
|
@@ -6714,6 +6912,7 @@ for array_type in array_types:
|
|
|
6714
6912
|
The operation is only atomic on a per-component basis for vectors and matrices.""",
|
|
6715
6913
|
group="Utility",
|
|
6716
6914
|
skip_replay=True,
|
|
6915
|
+
missing_grad=True,
|
|
6717
6916
|
)
|
|
6718
6917
|
add_builtin(
|
|
6719
6918
|
"atomic_exch",
|
|
@@ -6727,6 +6926,7 @@ for array_type in array_types:
|
|
|
6727
6926
|
The operation is only atomic on a per-component basis for vectors and matrices.""",
|
|
6728
6927
|
group="Utility",
|
|
6729
6928
|
skip_replay=True,
|
|
6929
|
+
missing_grad=True,
|
|
6730
6930
|
)
|
|
6731
6931
|
add_builtin(
|
|
6732
6932
|
"atomic_exch",
|
|
@@ -6740,6 +6940,7 @@ for array_type in array_types:
|
|
|
6740
6940
|
The operation is only atomic on a per-component basis for vectors and matrices.""",
|
|
6741
6941
|
group="Utility",
|
|
6742
6942
|
skip_replay=True,
|
|
6943
|
+
missing_grad=True,
|
|
6743
6944
|
)
|
|
6744
6945
|
add_builtin(
|
|
6745
6946
|
"atomic_exch",
|
|
@@ -6903,6 +7104,7 @@ add_builtin(
|
|
|
6903
7104
|
hidden=True,
|
|
6904
7105
|
group="Utility",
|
|
6905
7106
|
skip_replay=True,
|
|
7107
|
+
missing_grad=True,
|
|
6906
7108
|
)
|
|
6907
7109
|
# implements &quaternion[index]
|
|
6908
7110
|
add_builtin(
|
|
@@ -6913,6 +7115,7 @@ add_builtin(
|
|
|
6913
7115
|
hidden=True,
|
|
6914
7116
|
group="Utility",
|
|
6915
7117
|
skip_replay=True,
|
|
7118
|
+
missing_grad=True,
|
|
6916
7119
|
)
|
|
6917
7120
|
# implements &transformation[index]
|
|
6918
7121
|
add_builtin(
|
|
@@ -6923,6 +7126,7 @@ add_builtin(
|
|
|
6923
7126
|
hidden=True,
|
|
6924
7127
|
group="Utility",
|
|
6925
7128
|
skip_replay=True,
|
|
7129
|
+
missing_grad=True,
|
|
6926
7130
|
)
|
|
6927
7131
|
# implements &(*vector)[index]
|
|
6928
7132
|
add_builtin(
|
|
@@ -6933,6 +7137,7 @@ add_builtin(
|
|
|
6933
7137
|
hidden=True,
|
|
6934
7138
|
group="Utility",
|
|
6935
7139
|
skip_replay=True,
|
|
7140
|
+
missing_grad=True,
|
|
6936
7141
|
)
|
|
6937
7142
|
# implements &(*matrix)[i, j]
|
|
6938
7143
|
add_builtin(
|
|
@@ -6943,6 +7148,7 @@ add_builtin(
|
|
|
6943
7148
|
hidden=True,
|
|
6944
7149
|
group="Utility",
|
|
6945
7150
|
skip_replay=True,
|
|
7151
|
+
missing_grad=True,
|
|
6946
7152
|
)
|
|
6947
7153
|
# implements &(*quaternion)[index]
|
|
6948
7154
|
add_builtin(
|
|
@@ -6953,6 +7159,7 @@ add_builtin(
|
|
|
6953
7159
|
hidden=True,
|
|
6954
7160
|
group="Utility",
|
|
6955
7161
|
skip_replay=True,
|
|
7162
|
+
missing_grad=True,
|
|
6956
7163
|
)
|
|
6957
7164
|
# implements &(*transformation)[index]
|
|
6958
7165
|
add_builtin(
|
|
@@ -6963,6 +7170,7 @@ add_builtin(
|
|
|
6963
7170
|
hidden=True,
|
|
6964
7171
|
group="Utility",
|
|
6965
7172
|
skip_replay=True,
|
|
7173
|
+
missing_grad=True,
|
|
6966
7174
|
)
|
|
6967
7175
|
|
|
6968
7176
|
|
|
@@ -7173,6 +7381,7 @@ add_builtin(
|
|
|
7173
7381
|
hidden=True,
|
|
7174
7382
|
group="Utility",
|
|
7175
7383
|
skip_replay=True,
|
|
7384
|
+
missing_grad=True,
|
|
7176
7385
|
)
|
|
7177
7386
|
|
|
7178
7387
|
|
|
@@ -7191,6 +7400,7 @@ add_builtin(
|
|
|
7191
7400
|
hidden=True,
|
|
7192
7401
|
group="Utility",
|
|
7193
7402
|
skip_replay=True,
|
|
7403
|
+
missing_grad=True,
|
|
7194
7404
|
)
|
|
7195
7405
|
|
|
7196
7406
|
|
|
@@ -7401,6 +7611,7 @@ for t in scalar_types + vector_types + (bool,):
|
|
|
7401
7611
|
doc="Prints an error to stdout if ``a`` and ``b`` are not equal",
|
|
7402
7612
|
group="Utility",
|
|
7403
7613
|
hidden=True,
|
|
7614
|
+
missing_grad=True,
|
|
7404
7615
|
)
|
|
7405
7616
|
|
|
7406
7617
|
add_builtin(
|
|
@@ -7411,6 +7622,7 @@ for t in scalar_types + vector_types + (bool,):
|
|
|
7411
7622
|
group="Utility",
|
|
7412
7623
|
hidden=True,
|
|
7413
7624
|
export=False,
|
|
7625
|
+
missing_grad=True,
|
|
7414
7626
|
)
|
|
7415
7627
|
|
|
7416
7628
|
|
|
@@ -7429,6 +7641,7 @@ add_builtin(
|
|
|
7429
7641
|
doc="Prints an error to stdout if ``a`` and ``b`` are not equal",
|
|
7430
7642
|
group="Utility",
|
|
7431
7643
|
hidden=True,
|
|
7644
|
+
missing_grad=True,
|
|
7432
7645
|
)
|
|
7433
7646
|
add_builtin(
|
|
7434
7647
|
"expect_neq",
|
|
@@ -7439,6 +7652,7 @@ add_builtin(
|
|
|
7439
7652
|
group="Utility",
|
|
7440
7653
|
hidden=True,
|
|
7441
7654
|
export=False,
|
|
7655
|
+
missing_grad=True,
|
|
7442
7656
|
)
|
|
7443
7657
|
|
|
7444
7658
|
add_builtin(
|
|
@@ -7449,6 +7663,7 @@ add_builtin(
|
|
|
7449
7663
|
doc="Prints an error to stdout if ``a`` and ``b`` are not equal",
|
|
7450
7664
|
group="Utility",
|
|
7451
7665
|
hidden=True,
|
|
7666
|
+
missing_grad=True,
|
|
7452
7667
|
)
|
|
7453
7668
|
add_builtin(
|
|
7454
7669
|
"expect_neq",
|
|
@@ -7459,6 +7674,7 @@ add_builtin(
|
|
|
7459
7674
|
group="Utility",
|
|
7460
7675
|
hidden=True,
|
|
7461
7676
|
export=False,
|
|
7677
|
+
missing_grad=True,
|
|
7462
7678
|
)
|
|
7463
7679
|
|
|
7464
7680
|
add_builtin(
|
|
@@ -7549,6 +7765,7 @@ add_builtin(
|
|
|
7549
7765
|
value_type=None,
|
|
7550
7766
|
doc="Prints an error to stdout if ``a`` and ``b`` are not closer than tolerance in magnitude",
|
|
7551
7767
|
group="Utility",
|
|
7768
|
+
missing_grad=True,
|
|
7552
7769
|
)
|
|
7553
7770
|
add_builtin(
|
|
7554
7771
|
"expect_near",
|
|
@@ -7558,6 +7775,7 @@ add_builtin(
|
|
|
7558
7775
|
value_type=None,
|
|
7559
7776
|
doc="Prints an error to stdout if any element of ``a`` and ``b`` are not closer than tolerance in magnitude",
|
|
7560
7777
|
group="Utility",
|
|
7778
|
+
missing_grad=True,
|
|
7561
7779
|
)
|
|
7562
7780
|
add_builtin(
|
|
7563
7781
|
"expect_near",
|
|
@@ -7567,6 +7785,7 @@ add_builtin(
|
|
|
7567
7785
|
value_type=None,
|
|
7568
7786
|
doc="Prints an error to stdout if any element of ``a`` and ``b`` are not closer than tolerance in magnitude",
|
|
7569
7787
|
group="Utility",
|
|
7788
|
+
missing_grad=True,
|
|
7570
7789
|
)
|
|
7571
7790
|
add_builtin(
|
|
7572
7791
|
"expect_near",
|
|
@@ -7580,6 +7799,7 @@ add_builtin(
|
|
|
7580
7799
|
value_type=None,
|
|
7581
7800
|
doc="Prints an error to stdout if any element of ``a`` and ``b`` are not closer than tolerance in magnitude",
|
|
7582
7801
|
group="Utility",
|
|
7802
|
+
missing_grad=True,
|
|
7583
7803
|
)
|
|
7584
7804
|
|
|
7585
7805
|
# ---------------------------------
|
|
@@ -7590,6 +7810,7 @@ add_builtin(
|
|
|
7590
7810
|
input_types={"arr": array(dtype=Scalar), "value": Scalar},
|
|
7591
7811
|
value_type=int,
|
|
7592
7812
|
doc="Search a sorted array ``arr`` for the closest element greater than or equal to ``value``.",
|
|
7813
|
+
missing_grad=True,
|
|
7593
7814
|
)
|
|
7594
7815
|
|
|
7595
7816
|
add_builtin(
|
|
@@ -7597,6 +7818,7 @@ add_builtin(
|
|
|
7597
7818
|
input_types={"arr": array(dtype=Scalar), "arr_begin": int, "arr_end": int, "value": Scalar},
|
|
7598
7819
|
value_type=int,
|
|
7599
7820
|
doc="Search a sorted array ``arr`` in the range [arr_begin, arr_end) for the closest element greater than or equal to ``value``.",
|
|
7821
|
+
missing_grad=True,
|
|
7600
7822
|
)
|
|
7601
7823
|
|
|
7602
7824
|
# ---------------------------------
|
|
@@ -7672,13 +7894,36 @@ add_builtin(
|
|
|
7672
7894
|
)
|
|
7673
7895
|
|
|
7674
7896
|
# bitwise operators
|
|
7675
|
-
add_builtin(
|
|
7676
|
-
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
-
|
|
7681
|
-
|
|
7897
|
+
add_builtin(
|
|
7898
|
+
"bit_and",
|
|
7899
|
+
input_types={"a": Int, "b": Int},
|
|
7900
|
+
value_func=sametypes_create_value_func(Int),
|
|
7901
|
+
group="Operators",
|
|
7902
|
+
missing_grad=True,
|
|
7903
|
+
)
|
|
7904
|
+
add_builtin(
|
|
7905
|
+
"bit_or",
|
|
7906
|
+
input_types={"a": Int, "b": Int},
|
|
7907
|
+
value_func=sametypes_create_value_func(Int),
|
|
7908
|
+
group="Operators",
|
|
7909
|
+
missing_grad=True,
|
|
7910
|
+
)
|
|
7911
|
+
add_builtin(
|
|
7912
|
+
"bit_xor",
|
|
7913
|
+
input_types={"a": Int, "b": Int},
|
|
7914
|
+
value_func=sametypes_create_value_func(Int),
|
|
7915
|
+
group="Operators",
|
|
7916
|
+
missing_grad=True,
|
|
7917
|
+
)
|
|
7918
|
+
add_builtin("lshift", input_types={"a": Int, "b": Int}, value_func=sametypes_create_value_func(Int), group="Operators")
|
|
7919
|
+
add_builtin(
|
|
7920
|
+
"rshift",
|
|
7921
|
+
input_types={"a": Int, "b": Int},
|
|
7922
|
+
value_func=sametypes_create_value_func(Int),
|
|
7923
|
+
group="Operators",
|
|
7924
|
+
missing_grad=True,
|
|
7925
|
+
)
|
|
7926
|
+
add_builtin("invert", input_types={"a": Int}, value_func=sametypes_create_value_func(Int), group="Operators")
|
|
7682
7927
|
|
|
7683
7928
|
add_builtin(
|
|
7684
7929
|
"mul", input_types={"a": Scalar, "b": Scalar}, value_func=sametypes_create_value_func(Scalar), group="Operators"
|
|
@@ -7878,6 +8123,7 @@ add_builtin(
|
|
|
7878
8123
|
value_func=sametypes_create_value_func(vector(length=Any, dtype=Scalar)),
|
|
7879
8124
|
doc="Modulo operation using truncated division.",
|
|
7880
8125
|
group="Operators",
|
|
8126
|
+
missing_grad=True,
|
|
7881
8127
|
)
|
|
7882
8128
|
|
|
7883
8129
|
add_builtin(
|
|
@@ -7937,6 +8183,7 @@ add_builtin(
|
|
|
7937
8183
|
value_func=sametypes_create_value_func(Scalar),
|
|
7938
8184
|
doc="",
|
|
7939
8185
|
group="Operators",
|
|
8186
|
+
missing_grad=True,
|
|
7940
8187
|
)
|
|
7941
8188
|
|
|
7942
8189
|
add_builtin("pos", input_types={"x": Scalar}, value_func=sametypes_create_value_func(Scalar), group="Operators")
|
|
@@ -7984,12 +8231,16 @@ add_builtin(
|
|
|
7984
8231
|
group="Operators",
|
|
7985
8232
|
)
|
|
7986
8233
|
|
|
7987
|
-
add_builtin(
|
|
8234
|
+
add_builtin(
|
|
8235
|
+
"unot", input_types={"a": builtins.bool}, value_type=builtins.bool, doc="", group="Operators", missing_grad=True
|
|
8236
|
+
)
|
|
7988
8237
|
for t in int_types:
|
|
7989
|
-
add_builtin("unot", input_types={"a": t}, value_type=builtins.bool, doc="", group="Operators")
|
|
8238
|
+
add_builtin("unot", input_types={"a": t}, value_type=builtins.bool, doc="", group="Operators", missing_grad=True)
|
|
7990
8239
|
|
|
7991
8240
|
|
|
7992
|
-
add_builtin(
|
|
8241
|
+
add_builtin(
|
|
8242
|
+
"unot", input_types={"a": array(dtype=Any)}, value_type=builtins.bool, doc="", group="Operators", missing_grad=True
|
|
8243
|
+
)
|
|
7993
8244
|
|
|
7994
8245
|
|
|
7995
8246
|
# Tile operators
|
|
@@ -8183,6 +8434,7 @@ add_builtin(
|
|
|
8183
8434
|
doc="Add a square matrix and a diagonal matrix 'd' represented as a 1D tile",
|
|
8184
8435
|
group="Tile Primitives",
|
|
8185
8436
|
export=False,
|
|
8437
|
+
missing_grad=True,
|
|
8186
8438
|
)
|
|
8187
8439
|
|
|
8188
8440
|
|
|
@@ -8510,6 +8762,7 @@ add_builtin(
|
|
|
8510
8762
|
group="Tile Primitives",
|
|
8511
8763
|
export=False,
|
|
8512
8764
|
namespace="",
|
|
8765
|
+
missing_grad=True,
|
|
8513
8766
|
)
|
|
8514
8767
|
|
|
8515
8768
|
add_builtin(
|
|
@@ -8531,6 +8784,7 @@ add_builtin(
|
|
|
8531
8784
|
group="Tile Primitives",
|
|
8532
8785
|
export=False,
|
|
8533
8786
|
namespace="",
|
|
8787
|
+
missing_grad=True,
|
|
8534
8788
|
)
|
|
8535
8789
|
|
|
8536
8790
|
|
|
@@ -8655,6 +8909,7 @@ add_builtin(
|
|
|
8655
8909
|
group="Tile Primitives",
|
|
8656
8910
|
export=False,
|
|
8657
8911
|
namespace="",
|
|
8912
|
+
missing_grad=True,
|
|
8658
8913
|
)
|
|
8659
8914
|
|
|
8660
8915
|
|
|
@@ -8785,6 +9040,7 @@ add_builtin(
|
|
|
8785
9040
|
group="Tile Primitives",
|
|
8786
9041
|
export=False,
|
|
8787
9042
|
namespace="",
|
|
9043
|
+
missing_grad=True,
|
|
8788
9044
|
)
|
|
8789
9045
|
|
|
8790
9046
|
|
|
@@ -8917,6 +9173,7 @@ add_builtin(
|
|
|
8917
9173
|
group="Tile Primitives",
|
|
8918
9174
|
export=False,
|
|
8919
9175
|
namespace="",
|
|
9176
|
+
missing_grad=True,
|
|
8920
9177
|
)
|
|
8921
9178
|
|
|
8922
9179
|
|
|
@@ -9049,6 +9306,7 @@ add_builtin(
|
|
|
9049
9306
|
group="Tile Primitives",
|
|
9050
9307
|
export=False,
|
|
9051
9308
|
namespace="",
|
|
9309
|
+
missing_grad=True,
|
|
9052
9310
|
)
|
|
9053
9311
|
|
|
9054
9312
|
|
|
@@ -9068,6 +9326,7 @@ add_builtin(
|
|
|
9068
9326
|
The return type of the expression must be either a Warp function, a string, or a type that is supported inside Warp kernels and functions
|
|
9069
9327
|
(excluding Warp arrays since they cannot be created in a Warp kernel at the moment).""",
|
|
9070
9328
|
group="Code Generation",
|
|
9329
|
+
missing_grad=True,
|
|
9071
9330
|
)
|
|
9072
9331
|
|
|
9073
9332
|
|
|
@@ -9092,6 +9351,7 @@ add_builtin(
|
|
|
9092
9351
|
doc="Return the number of elements in a vector.",
|
|
9093
9352
|
group="Utility",
|
|
9094
9353
|
export=False,
|
|
9354
|
+
missing_grad=True,
|
|
9095
9355
|
)
|
|
9096
9356
|
|
|
9097
9357
|
add_builtin(
|
|
@@ -9101,6 +9361,7 @@ add_builtin(
|
|
|
9101
9361
|
doc="Return the number of elements in a quaternion.",
|
|
9102
9362
|
group="Utility",
|
|
9103
9363
|
export=False,
|
|
9364
|
+
missing_grad=True,
|
|
9104
9365
|
)
|
|
9105
9366
|
|
|
9106
9367
|
add_builtin(
|
|
@@ -9110,6 +9371,7 @@ add_builtin(
|
|
|
9110
9371
|
doc="Return the number of rows in a matrix.",
|
|
9111
9372
|
group="Utility",
|
|
9112
9373
|
export=False,
|
|
9374
|
+
missing_grad=True,
|
|
9113
9375
|
)
|
|
9114
9376
|
|
|
9115
9377
|
add_builtin(
|
|
@@ -9119,6 +9381,7 @@ add_builtin(
|
|
|
9119
9381
|
doc="Return the number of elements in a transformation.",
|
|
9120
9382
|
group="Utility",
|
|
9121
9383
|
export=False,
|
|
9384
|
+
missing_grad=True,
|
|
9122
9385
|
)
|
|
9123
9386
|
|
|
9124
9387
|
add_builtin(
|
|
@@ -9128,6 +9391,7 @@ add_builtin(
|
|
|
9128
9391
|
doc="Return the size of the first dimension in an array.",
|
|
9129
9392
|
group="Utility",
|
|
9130
9393
|
export=False,
|
|
9394
|
+
missing_grad=True,
|
|
9131
9395
|
)
|
|
9132
9396
|
|
|
9133
9397
|
add_builtin(
|
|
@@ -9137,6 +9401,7 @@ add_builtin(
|
|
|
9137
9401
|
doc="Return the number of rows in a tile.",
|
|
9138
9402
|
group="Utility",
|
|
9139
9403
|
export=False,
|
|
9404
|
+
missing_grad=True,
|
|
9140
9405
|
)
|
|
9141
9406
|
|
|
9142
9407
|
|
|
@@ -9211,6 +9476,7 @@ add_builtin(
|
|
|
9211
9476
|
doc="Return the number of elements in a tuple.",
|
|
9212
9477
|
group="Utility",
|
|
9213
9478
|
export=False,
|
|
9479
|
+
missing_grad=True,
|
|
9214
9480
|
)
|
|
9215
9481
|
|
|
9216
9482
|
# ---------------------------------
|