Monte Carlo Pi approximation 3 dimension
Subarna Falguni
Dhaka, Dhaka Division
- 0 Collaborators
Monte Carlo Simulation is a broad category of computation that utilizes statistical analysis to reach a result. This sample uses the Monte Carlo Procedure to estimate the value of pi ...learn more
Project status: Under Development
Overview / Usage
The Monte Carlo procedure for estimating pi is easily parallelized, as each calculation of a random coordinate point can be considered a discrete work item. The computations involved with each work item are entirely independent of one another except for in summing the total number of points inscribed within the circle. This code sample demonstrates how to utilize the DPC++ reduction extension for this purpose.
The code will attempt to execute on an available GPU and fallback to the system's CPU if a compatible GPU is not detected. The device used for the compilation is displayed in the output, along with the elapsed time to complete the computation. A rendered image plot of the computation is also written to a file.
Methodology / Approach
I have used One API for the simulation
I have added z axis and have the simulation more complex
Output in Devcloud
Calculating estimated value of pi...
Running on Intel(R) Core(TM) i9-10920X CPU @ 3.50GHz
The estimated value of pi (N = 40000) is: 2.1006
Computation complete. The processing time was 1.52605 seconds.
The simulation plot graph has been written to 'MonteCarloPi.bmp'
########################################################################
End of output for job 799384.v-qsvr-1.aidevcloud Date: Mon 22 Feb 2021 02:24:20 PM PST########################################################################
Job Completed in 22 seconds.
Technologies Used
One API
GPU
DPC++