NVIDIA / NVIDIA/warp

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

Open
#692 0 comments 0 reactions 1 assignee View on GitHub

@daedalus5 is already working on this.

Since Apr 30, 2025.

bug language
Dominant language
Python
Stars
7.1k
Forks
624
Avg merge
3d 17h
Merged PRs (30d)
5

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.