Changes

Jump to: navigation, search

Avengers

747 bytes added, 12:54, 15 February 2019
Bruno - Pythagorean Triples
0.00 5.98 0.00 1 0.00 0.00 _GLOBAL__sub_I__ZN8TriangleC2Edddi
We can see that the function calculateDimensions, which is called only once is responsible for almost all of the execution time. For this profiling the program calculated all triples from the most primitive (3, 4, 5) up to all the triples that satisfy the hypotenuse value of 1500. This function has O(n^3) with its nested for loops to calculate all possible values for each triple, demanding a lot of computational power to generate all of them.  Since every loop executes the same instructions I believe the parallelization of this code should be straightforward and would make it a lot faster. Calculations could be divided in tasks or the offload could be done in order since one calculation does not depend on the other explicitly.  For further utility, the results could be sorted for later display, since the values will be printed in any order from the GPU results.
[https://github.com/brucremo/DPS915 Code and Execution Instructions on GitHub]
38
edits

Navigation menu