Open main menu

CDOT Wiki β

Changes

Skynet/GPU610

1,283 bytes added, 16:10, 3 December 2014
Assignment 3
=== Assignment 2 ===
=== Assignment 3 ===
 
====What is a Ray Tracer?====
A program that performs ray tracing, which is a technique for creating images by tracing light paths (rays) through all the pixels in the image and simulating the effects light would have based on the objects the light (rays) encounters.
 
We decided this would be a problem that could benefit greatly from parallel processing, and it has, by over 350 times speed up.
 
 
[[File:A3.jpg]]
 
 
====Optimizations Used====
 
 
'''__device__ __host__''' : we used this so that parts of classes Vec3 and Sphere could be accessed by both the host and device were necessary.
 
 
'''__device__ __forceinline__''' : because the program uses various loops and recursion we force the compiler to use inline functions to speed up the trace and mix functions as well as some methods in the Vec3 and Sphere class.
 
'''sqrtf, tanf, fmaxf''' : where std:: was being used we replaced it with CUDA's math library equivalents although gains were marginal from this.
 
'''shared memory''' : we implemented shared memory but quickly realized that it was actually slower then sticking to global memory, we believe this has to do with the number of times the array has to be copied into shared memory.
 
**We also needed to rework a few parts of code in order to be parallelized