Skip to content

How do I launch rays in parallel inside raygen function? #182

Answered by ingowald
MDurgaKeerthi asked this question in Q&A
Discussion options

You must be logged in to vote

The raygen program is always executed NxM times in parallel, where N and M are the "dimensions" of that launch that you specify in owlLaunch2D(...,N,M,...). Note this is exactly the same way you would launch parallel work in CUDA - the code/program you're writing is always for one thread, and the parallelism comes from launching this NxM(xK) times.

So for your example above of tracing two rays in parallel, you'd specify a launch dimension of 2x1 in owlLaunch, and in the raygen program trace only one ray - using a different ray for each launch index (see optxGetLaunchIndex()).

That said, I'm not sure if "two" rays is a useful degree of parallelism to employ here: GPUs are typically designe…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MDurgaKeerthi
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