Open main menu

CDOT Wiki β

Changes

DPS915/CodeKirin

407 bytes added, 16:45, 3 December 2014
Assignment 2 and 3
[[File:ChartMonteCarlo.JPG]]
 
 
 
''' Some Code Snippets '''
 
Sets the tid (threadIdx.x) index of the temp array in shared memory to 1, when the total <= 1.0, and sync the threads. Then sum up all the 1s in the array for that specific block and pass it out into another array.
 
[[File:Code1.JPG]]
 
After copying from the device to host, obtain the total sum of results from all kernels and calculates the value of pi.
 
[[File:Code2.JPG]]
1
edit