warp icon indicating copy to clipboard operation
warp copied to clipboard

[BUG] make static loop unrolling automatic, and warn if not possible

Open daedalus5 opened this issue 7 months ago • 0 comments

Bug Description

import warp as wp

RANGE = 5

@wp.kernel
def test_kernel:
    for i in range(wp.static(-RANGE), wp.static(RANGE)):
        ...

In the above example, -RANGE should be automatically statically evaluated. This will allow the loop to be unrolled, which makes kernels differentiable under certain conditions.

daedalus5 avatar Apr 30 '25 14:04 daedalus5