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

How to use binary_search overloads in python. #119

Open
LeonardEyer opened this issue Jun 30, 2021 · 0 comments
Open

How to use binary_search overloads in python. #119

LeonardEyer opened this issue Jun 30, 2021 · 0 comments

Comments

@LeonardEyer
Copy link

Basically, I want to do this kind of computation:

x = Float.linspace(0, 1, 100)

def f(i : UInt32) -> Mask:
    return ek.gather(x, i) > 0.5

ek.binary_search(0, 100, f)

With Float and UInt32 being cuda arrays.
But I get the following error: Unable to cast Python instance of type <class 'enoki.cuda_autodiff.Mask'> to C++ type 'bool'
It seems like pybind doesn't choose the correct overloaded method. Am I missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant