Open main menu

CDOT Wiki β

Changes

DPS915/CodeKirin

118 bytes added, 21:20, 5 December 2014
Calculations of Pi
'''(Note)'''
For some reason the code crashes my graphic driver past 8000000 (8 million) dots, and even at 8 million it crashes most of the time, but the value is still correct. The Nvidia Visual Profiler doesn't work either, it gets stuck on generating timeline, so I used clock_t in the code instead in order to calculate execution time of the kernel. Don't think this is 100% accurate though.
'''Approach'''
[[File:Code2.JPG]]
'''Value Execution Times for Values of 1 Million''' [[File:MillionMonteCarlo.JPG]] '''Value of , 5 Million''' [[File:5MillionMonteCarlo.JPG]] '''Value of and 8 Million''' [[File:8MillionMonteCarlo.JPG]]
[[File:reportTime.JPG]]
'''Comparison Chart'''
For optimization, I tried using reduction, however it didn't seem to speed up the program.
 
 
'''Different Approach'''
 
Another approach to do this is by using a different algorithm, as the one I used at first. However, that program will only go up to 9 significant digits, since anything over will go above the maximum value of a float. This program shows an execution time of 0.05 seconds for all values entered by the user, but will require to use the BigNumber library or such in order to show more significant digits.
1
edit