Skip to content
This repository was archived by the owner on Feb 6, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant