Content Skeleton

This Page

Previous topic

Chroma NuWa Integration

Next topic


Chroma CUDA Photon handlingΒΆ

geometry from CUDA photon propagation, in photon.h:

584 __device__ int
585 propagate_at_surface(Photon &p, State &s, curandState &rng, Geometry *geometry,
586                      bool use_weights=false)
587 {
588     Surface *surface = geometry->surfaces[s.surface_index];
590     if (surface->model == SURFACE_COMPLEX)
591         return propagate_complex(p, s, rng, surface, use_weights);
592     else if (surface->model == SURFACE_WLS)
593         return propagate_at_wls(p, s, rng, surface, use_weights);
594     else {
595         // use default surface model: do a combination of specular and
596         // diffuse reflection, detection, and absorption based on relative
597         // probabilties
599         // since the surface properties are interpolated linearly, we are
600         // guaranteed that they still sum to 1.0.
601         float detect = interp_property(surface, p.wavelength, surface->detect);
602         float absorb = interp_property(surface, p.wavelength, surface->absorb);
603         float reflect_diffuse = interp_property(surface, p.wavelength, surface->reflect_diffuse);
604         float reflect_specular = interp_property(surface, p.wavelength, surface->reflect_specular);
606         float uniform_sample = curand_uniform(&rng);
simon:cuda blyth$ grep __shared__ *.*    __shared__ unsigned long long min_area[128];    __shared__ unsigned long long adjacent_area;    __shared__ int photon_id;    __shared__ int triangle_id;    __shared__ int solid_id;    __shared__ int channel_index;    __shared__ unsigned int history;    __shared__ float photon_time;    __shared__ float weight;
mesh.h:    __shared__ Geometry sg;    __shared__ float distance_table[1000];    __shared__ unsigned int *work_queue;    __shared__ int queue_items;    __shared__ int channel_id;    __shared__ float channel_event_time;    __shared__ int distance_table_len;    __shared__ int offset;    __shared__ unsigned int counter;    __shared__ Geometry sg;    __shared__ Geometry sg;
simon:cuda blyth$
simon:cuda blyth$ grep sync *.*    __syncthreads();    __syncthreads();    __syncthreads();    __syncthreads();
mesh.h:    __syncthreads();    __syncthreads();    __syncthreads();    __syncthreads();    __syncthreads();    __syncthreads();    __syncthreads();    __syncthreads();    __syncthreads();
simon:cuda blyth$