Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] tile_arange() has issues with negative numbers #403

Open
shi-eric opened this issue Dec 19, 2024 · 0 comments
Open

[BUG] tile_arange() has issues with negative numbers #403

shi-eric opened this issue Dec 19, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@shi-eric
Copy link
Contributor

shi-eric commented Dec 19, 2024

Bug Description

Example:

import warp as wp


@wp.kernel
def compute():
    a = wp.tile_arange(-10, 10, dtype=int)

    print(a)


wp.launch_tiled(compute, dim=[1], inputs=[], block_dim=16)

This code results in the following issue:

  File "/home/eshi/code-projects/warp/warp/builtins.py", line 1856, in tile_arange_value_func
    raise RuntimeError("wp.tile_arange() arguments must be compile time constants")
RuntimeError: Error while parsing function "compute" at /home/eshi/code-projects/warp/ershi-tests/test_tile_min_docstring.py:6:
    a = wp.tile_arange(-10, 10, dtype=int)
;wp.tile_arange() arguments must be compile time constants

(Note also that the RuntimeError raised in tile_arange_value_func() is not very helpful here).

Similarly, using a negative step doesn't work:

import warp as wp


@wp.kernel
def compute():
    a = wp.tile_arange(10, 0, -1, dtype=int)

    print(a)


wp.launch_tiled(compute, dim=[1], inputs=[], block_dim=16)

Output:

  File "/home/eshi/code-projects/warp/warp/builtins.py", line 1856, in tile_arange_value_func
    raise RuntimeError("wp.tile_arange() arguments must be compile time constants")
RuntimeError: Error while parsing function "compute" at /home/eshi/code-projects/warp/ershi-tests/test_tile_min_docstring.py:6:
    a = wp.tile_arange(10, 0, -1, dtype=int)
;wp.tile_arange() arguments must be compile time constants

System Information

No response

@shi-eric shi-eric added the bug Something isn't working label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants