Skip to content
Discussion options

You must be logged in to vote

Hi @Mephisto405

Yes, this is hard limitation of recorded loops. Every single variable in the loop should have the same size (vectorization width). Think about this loop as a parallel computation where each thread is running a 1-wide version of the loop. You cannot suddenly have some piece of code in your loop that requires a larger width.
However, I believe you can add a nested loop by doing something like this:

    (....)
    M = 16
    j = dr.zeros(mi.UInt32, shape=dr.prod(image_res))
    integral_rng = mi.PCG32(size=dr.prod(image_res))
    inner_result = mi.Float(0)
    loop2 = mi.Loop(name="", state=lambda: (integral_rng, j, inner_result))

    inner_si = mi.SurfaceInteraction3f(si)

…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Mephisto405
Comment options

@njroussel
Comment options

Answer selected by Mephisto405
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants