Skip to content

Custom BSDF: Accessing the rows of a TensorXf in the megakernel mode #1156

Closed Answered by merlinND
sapo17 asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the additional detail @sapo17.

I think that the key thing to understand is that in symbolic mode, e.g. inside of a symbolic (recorded) loop of the path tracer, the wavefront size (== width of the variables == number of threads the kernel will be launched with) is fixed.
Outside of a symbolic loop, DrJit would automatically introduce a kernel boundary for you, and launch the different kernels with their required widths. But in the body of a recorded loop, that is not possible.

In your example code, you have:

  1. dr.width(tmp_idx) == dr.width(sample2.x): the wavefront size (= number of rays), which is fine
  2. And then you attempt to create arrays of size wavefront_size * n (?) in get_c…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@sapo17
Comment options

@merlinND
Comment options

Answer selected by sapo17
@sapo17
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