Open main menu

CDOT Wiki β

Changes

TeamDS

3 bytes added, 22:04, 11 April 2017
GPU Optimized Phase 1
=== Assignment 3 ===
=== GPU Optimized Optimization Phase 1 ===
First step of optimizing is by finding a way to use less sqrtf function. It turns out that we are using lots of sqrtf for comparing distances to see if one is larger than the other. However, when squaring two numbers, it does not change which is the larger number. We can take advantage of this by comparing the squared distance, not the actual distance. This way we only need to use sqrtf once per pixel! Below is the optimized kernel:
116
edits