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 convert (N,3) numpy array into (N) warp vec3? #363

Open
cadop opened this issue Nov 21, 2024 · 0 comments
Open

How to convert (N,3) numpy array into (N) warp vec3? #363

cadop opened this issue Nov 21, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@cadop
Copy link
Contributor

cadop commented Nov 21, 2024

Discussed in #359

Originally posted by cadop November 15, 2024

I am trying to convert an array of integers into a warp array of vec3i, where the second dim is captured by the warp dtype.

    faces = mesh.indices.reshape((-1, 3))
    faces = wp.array(faces, shape=(N), dtype=wp.vec3i, device=device)

The kernel signature is:

@wp.kernel
def _matrix(points: wp.array(dtype=wp.vec3),
            faces: wp.array(dtype=wp.vec3i),
            mesh: wp.uint64):
     f = wp.tid()
     face = faces[f]

This was seemingly working when I was in device='cpu' , however changing device to cuda results in:
RuntimeError: Error launching kernel '_matrix', argument 'faces' expects an array with dtype=<class 'warp.types.vec3i'> but passed array has dtype=<class 'warp.types.int32'>.

@christophercrouzet christophercrouzet self-assigned this Nov 24, 2024
@shi-eric shi-eric added the bug Something isn't working label Dec 13, 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

3 participants