Skip to content
Discussion options

You must be logged in to vote

Hi @tomas16

Is there any way to have a growing array/matrix/... in drjit?

In short, no.

However, most of times you can now the the maxmium length/size of your data that you're trying to record. For example, the maxmium number of bounces in the scene in your setup. In that case you can create a flat array of the appropriate size and write to it at each iteration. Here's a quick and dirty example:

import mitsuba as mi
import drjit as dr

dr.set_log_level(dr.LogLevel.Info)
mi.set_variant('cuda_ad_rgb')

W = 4 # wavefront width
N = 5 # max iterations

scene = mi.load_dict(mi.cornell_box())

origin = dr.zeros(mi.Point3f, W)
origin.z = 4
direction = mi.Vector3f(0, 0, -1)

output_t = dr.zeros(mi.

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@tomas16
Comment options

Answer selected by tomas16
Comment options

You must be logged in to vote
1 reply
@tomas16
Comment options

Comment options

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

@njroussel
Comment options

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