Changes

Jump to: navigation, search

DPS915/CodeKirin

889 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. 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 but the kernel. Don't think this value is 100% accurate thoughstill correct.
'''Approach'''
[[File:Code2.JPG]]
'''Value Execution Times for Values of 1 , 5 and 8 Million'''
[[File:MillionMonteCarloreportTime.JPG]]
'''Value of 5 MillionComparison Chart''' [[File:ChartMonteCarlo.JPG]]
[[File:5MillionMonteCarlo.JPG]]
'''Value of 8 MillionIssues'''
[[File:8MillionMonteCarloThe main issue for me was to figure out how to use the kernel for this approach. At first I tried to pass a value of either 1 or 0 for whether or not the dot landed within the circle within each thread, and pass it out into an array individually. Later on Chris gave me the idea of getting a partial sum for all the threads within each block and pass that out instead, which is a way better approach.JPG]]
Another big issue was the crashing of the graphic driver. If the program takes more than 3 seconds to execute, the driver would crash. Even when I changed the registry to allow 15 seconds before crashing, it still crashes at 3.
For optimization, I tried using reduction, however it didn't seem to speed up the program.  ''Comparison Chart'Different Approach'''
[[File:ChartMonteCarloAnother 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.JPG]]
1
edit

Navigation menu