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

Does dynamic SNode support vector field? #6205

Open
Linyou opened this issue Sep 29, 2022 · 3 comments
Open

Does dynamic SNode support vector field? #6205

Linyou opened this issue Sep 29, 2022 · 3 comments
Labels
question Question on using Taichi

Comments

@Linyou
Copy link
Contributor

Linyou commented Sep 29, 2022

Hi, I'm trying to use dynamic snode to construct a vec3 field, but the documentation only gives the ti.append() method and only supports scalar inputs. Is there any way to construct a dynamic snode for the vector field?

Also, consider the following code.

import taichi as ti
from taichi.math import vec3
ti.init(arch=ti.gpu)

x = ti.Vector.field(3, ti.f32)
block = ti.root.dense(ti.i, 16)
pixel = block.dynamic(ti.j, 16)
pixel.place(x)

@ti.kernel
def make_lists():
    for i in range(5):
        for j in range(i):
            x_vec3 = vec3(i, j, j*j)
            ti.append(x.parent(), i, x_vec3)  

make_lists()
@Linyou Linyou added the question Question on using Taichi label Sep 29, 2022
@taichi-gardener taichi-gardener moved this to Untriaged in Taichi Lang Sep 29, 2022
@erizmr erizmr moved this from Untriaged to Todo in Taichi Lang Sep 30, 2022
@FantasyVR
Copy link
Collaborator

Hi @Linyou, you can only append an int32 value to dynamic SNode now. The walkaround is that you could append the values of vec3 one by one.

@Linyou
Copy link
Contributor Author

Linyou commented Oct 13, 2022

Hi @FantasyVR, thanks for the reply. I am using it to just store the indices when I found that it only supports append an int32 value.

@ailzhang
Copy link
Contributor

@Linyou glad that you can work around it using i32. FYI we plan to refine dynamic snode support in Q4 so stay stuned!

@ailzhang ailzhang removed their assignment Oct 14, 2022
ailzhang pushed a commit to ailzhang/taichi that referenced this issue Oct 14, 2022
taichi-gardener pushed a commit to ailzhang/taichi that referenced this issue Oct 14, 2022
ailzhang added a commit that referenced this issue Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question on using Taichi
Projects
Status: Todo
Development

No branches or pull requests

3 participants