Replies: 1 comment 2 replies
-
Hi @g1r4ff3 Writing this sort of vectorized/SIMD code is a bit unusual. Masking is indeed the key to workaround the traditional if/else constructs. However, when replacing a conditional branch with some branching, both code paths become valid and you therefore need to create all variables for both paths. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I need a help with programming on LLVM or CUDA variant for extending existing my code in scalar varaint to those variants. I've written the code in C++ version of Mitsuba 3.
As my attempt to resolve my problem, I've read "First steps" guide of Dr.Jit by the previous answer and followed the simple solution by setting record features off before my code, but the problem hasn't been resolved. It seems to say that i need to write the code without conventional if-statements in those variants, to delay the evaluation of computation until the images are generated as the document says. But, how could i do that in complex programming situations like coding a quartic equation solver, which varies the way it computes the roots according to various conditions?
I've tried to use the Mask variable to control the execution, but it can't vary the creation of variables relevant to the solver.
Sorry for my poor question, but are there other ways or advices for me to resolve the problem i have?
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions