NVIDIA / warp

A Python framework for high performance GPU simulation and graphics

Home Page:https://nvidia.github.io/warp/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot use break in a while loop

xuan-li opened this issue · comments

To reproduce:

import warp as wp

@wp.func
def test_func():
    stop = wp.bool(False)
    while not stop:
        stop = True
        break

@wp.kernel
def test_kernel():
    test_func()

wp.init()
wp.launch(test_kernel, dim=1)

Got the following exception:

Exception: CUDA kernel build failed with error code 6

removing break works fine.

Thanks for reporting this! A fix will be available in the next release.

Similarly continue keyword doesn't work either

I think both break and continue where raised as issues before as well b57868f

This is fixed as part of Warp 1.1.0!