![]() |
![]() |
![]() |
![]() | Shortest path ray tracing on parallel GPU devices | ![]() |
![]() |
Algorithm 2 is the sequential main function that
call the parallel kernels to perform the ray tracing. Its
parameters are the indices of the source vertex.
The array
holds the velocity values at each vertex location,
obtained from the velocity model.
The arrays
and
will be used to store the traveltime
from source vertex to each other vertex. At the beginning they
are set to
(or another big value) except for the traveltime
of source vertex that is set to
. The arrays
and
will contain the indices of the predecesor
vertex of each vertex along the ray. Their starting values
are
for all vertices. At this point we call the kernel function to
precalculate the weights of each vertex. The ray tracing is
conducted next by calling the two function kernels Relaxation and
WriteBack in a loop while the boolean variable
is false.
The reason to have divided the work among these two kernels is that
it is necessary to synchronize all threads after the work done by
first kernel and this global synchronization is only possible by
having the rest of the code in another kernel.
![]() |
![]() |
![]() |
![]() | Shortest path ray tracing on parallel GPU devices | ![]() |
![]() |